gitbitex-spot icon indicating copy to clipboard operation
gitbitex-spot copied to clipboard

Application work flow

Open amitsharma8891 opened this issue 6 years ago • 5 comments

Dear @greensheng,

First of all Awesome work. Can you help me to understand or have any documentation for how the order gets settled? For eg. When we place the it first goes to the MySQL database after that we push it into Kafka. After this, how/where we read it? I mean how we execute our code to settle the order. If you can share any block diagram that would be really helpful.

Also, I was thinking can we consider separate tables for each currency Pair order and order settlement. For e.g. Consider the Pair BTC_USDT for that, we'll have BTC_USDT_order, BTC_USDT_trade and so on

amitsharma8891 avatar Nov 12 '19 14:11 amitsharma8891

Hi The match engine will use KafkaOrderReader to read the order, and the match engine will generate a series of match logs (MatchLog, DoneLog, OpenLog). FillMaker will read these logs and insert the Fill into the database, and then FillExecutor will execute these fill logs

It is necessary to operate separate tables, especially for high-frequency trading system. But it may take some work to accomplish this, and we will consider the implementation later.

greensheng avatar Nov 12 '19 14:11 greensheng

Thanks for your, response.

I am trying to build an exchange with a separate Currency pair table for each currency as mentioned above thread. But I couldn't understand the whole life cycle of the application. Also, I want to use MongoDB as a secondary database. That means all read data will come from mongo only and all order creation will take place in MongoDB.

It would be really helpful if you can explain a little bit more about Application life cycle(workflow) with block diagram

Also, Should we consider the MongoDB as a secondary database?

Sorry, if it's too much to ask.

amitsharma8891 avatar Nov 13 '19 11:11 amitsharma8891

Sorry, there are not many documents at present. I will write some documents later to explain the design idea of gitbitex

If you want to use MongoDB as storage, you just need to implement the store.go interface, https://github.com/gitbitex/gitbitex-spot/blob/master/models/store.go

greensheng avatar Nov 14 '19 02:11 greensheng

Let me know if you need some helping hand to create the documentation as I have some spare time.

amitsharma8891 avatar Nov 14 '19 06:11 amitsharma8891

我还是有点看不到撮合是怎么实现

ztg1 avatar Dec 27 '19 09:12 ztg1