Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application work flow #15

Open
amitsharma8891 opened this issue Nov 12, 2019 · 5 comments
Open

Application work flow #15

amitsharma8891 opened this issue Nov 12, 2019 · 5 comments

Comments

@amitsharma8891
Copy link

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

@greensheng
Copy link
Member

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.

@amitsharma8891
Copy link
Author

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.

@greensheng
Copy link
Member

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

@amitsharma8891
Copy link
Author

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

@ztg1
Copy link

ztg1 commented Dec 27, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants