Designing a Modular Architecture for a Trading Platform (part 1)
Designing a proper application architecture is the difference between a project that flourishes and one that gets pigeonholed into a set of inextensible features. When it comes to an open source project like Ostia, it becomes especially important, as the ‘activation energy’ for a developer to get up to speed on a project is a huge barrier.
A simple and easily understandable application architecture provides perspective and context. The less a developer has to think about how and application is set up, the faster she/he will be able to contribute.
In the case of a cryptocurrency trading platform like Ostia, the most important system design aspects are (1) the capability to add any exchange to trade on and (2) the capability to plug any strategy and run it.
To achieve this, I needed to design a blackbox-esque structure that would hold all (financial) data that any strategy would ever need — the DataHub. The Datahub gets data via exchange APIs and WebSockets feeds and stores all the currency pairs those exchanges trade in the form of orderbooks. These orderbooks can then be called from any strategy.
This setup incorporates the design aspects I mentioned above: the capabilities to add any exchange and add any strategy. The next challenge now is creating the most general API possible that the strategies can use. This will be covered in Part 2.
And here’s a link to the Github project: https://github.com/aegean-isle/Ostia :)