How do I finish my Cryptocurrency Exchange side project?
I have a side project that I already spent ~$50k on – a cryptocurrency broker that acts as a middleman between a client and other exchanges. User sends me coin A, I deposit Amount minus Fee to exchange X, execute a trade on behalf of a user and withdraw currency B to a user's destination address. I've been working on the project for quite a while. The entire front-end is 100% done, so I only work on the backend now.
My biggest challenge right now is the implementation of the trading part. Say user wants to exchange LTC to ETH. I need to place a sell limit order on the LTCBTC book, wait for the order to be executed and then place another buy order on ETHBTC book. Two questions:
1. What's the best architectural pattern to keep everything synchronized (even if I restart the service)? I talk to other exchanges via websocket connection.
2. Is there anything I can read about strategies on how to place an order? Right now I simply place orders at the front of the orderbook so that it's executed as soon as possible. Once a second I check if my order is not at the front, I update its position and put it back to highest bid/lowest ask.