Currently I’m working on a fully automated trading system. The project is already running for a long time because I had taken a lot of heavy architectural changes since the start and the project had some larger development breaks in between. It started as a micro service architecture using plain Java servlets, which was quite a mess since I had to write a lot of boilerplate code for registering the REST endpoints and mapping messages. Later in development I learned about Spring Boot and decided to do a rewrite for a more simple code base. But I was not happy after that since I noticed that with the micro service architecture a lot of heavy communication between the parts of the system would be necessary. For example every Source (which had its own service at that time) had to register at the database. Every database node would need to register to the backend and if a new price occurs that price would have been needed to be synchronized across all running database nodes. How to detect which data row between mismatching databases is correct? Maybe using some kind of versioning tool like Git? But that would have meant more complexity, more possible error sources and a lot more development time. So I did another rewrite for a more monolistic approach. It now consists of a backend which holds the database, runs the Sources and handles requests and a client application which allows the user to interact with the system.
Currently the user can create Sources by uploading a JAR plugin that can query price information for a specified product on a specified market from a given data source. The data source can be a website which HTML tree is crawled or any other source that provides price information. After creation, the source can be configured and activated or deactivated. When activated, the source provides information to the system either by polling or by waiting for messages from its underlying data source.
At the moment I’m working on storing the collected prices to the database and communicating new collected price data to the client application. When that works, I will show the price data in the client application using charts. I’m currently experimenting on using WebSockets to communicate the prices to the client so that I hopefully can avoid polling against the database for new price information. Originally I thought about using RSocket for this, but WebSocket is better supported and allows me to maybe later add a web interface to the trading system for users that don’t want to use the dedicated client application.
The source code of the project can be found here:
https://gitlab.marvin-haagen.de/software/oskar
Alternativly you can also find the source code on my old gitlab.com account, where the projects main branch is being duplicated to:
https://gitlab.com/marvinh/oskar