i25959341 / orderbook

Matching Engine for Limit Order Book in Golang
MIT License
442 stars 154 forks source link

Trying to implement it to a real project #13

Open KabDeveloper opened 5 years ago

KabDeveloper commented 5 years ago

Hi

I wanted to implement it to a real project, but it's a bit complicated.

Is there a way that for each rotation, I will get this rows: -> Complete result for each BUY orders processed -> Complete result for each SELL orders processed

Returning both of them no matter it is a BID or ASK.

SO I can for example update users balance, send notifications via websocket to update orderbook, update database order history etc...

Your help will be appreciated !

ooolxxx-dj commented 4 years ago

@bcashier did you get an answer yet? I'm wondering about the same stuff. I'm also trying to keep a record of each order so I changed it to write to a RDB.

nilber commented 4 years ago

The order book is just part of an exchange, you will not find it here!

https://app.showdobitcoin.com.br/#/trade/BTC_USDT

etc...

Hi

I wanted to implement it to a real project, but it's a bit complicated.

Is there a way that for each rotation, I will get this rows: -> Complete result for each BUY orders processed -> Complete result for each SELL orders processed

Returning both of them no matter it is a BID or ASK.

SO I can for example update users balance, send notifications via websocket to update orderbook, update database order history etc...

Your help will be appreciated !

The order book is just part of an exchange, you will not find it here!

https://app.showdobitcoin.com.br/#/trade/BTC_USDT

etc...

ooolxxx-dj commented 4 years ago

The order book is just part of an exchange, you will not find it here!

https://app.showdobitcoin.com.br/#/trade/BTC_USDT

  • order book
  • wallet
  • blockchain
  • WS
  • accounts
  • console
  • chart

etc...

Hi I wanted to implement it to a real project, but it's a bit complicated. Is there a way that for each rotation, I will get this rows: -> Complete result for each BUY orders processed -> Complete result for each SELL orders processed Returning both of them no matter it is a BID or ASK. SO I can for example update users balance, send notifications via websocket to update orderbook, update database order history etc... Your help will be appreciated !

The order book is just part of an exchange, you will not find it here!

https://app.showdobitcoin.com.br/#/trade/BTC_USDT

  • order book
  • wallet
  • blockchain
  • WS
  • accounts
  • console
  • chart

etc...

Great thank you.

  1. Understood orderbook is only one service/module of exchanges.
  2. It seems like the exchange you mentioned is not yet live?
nilber commented 4 years ago

Great thank you.

  1. Understood orderbook is only one service/module of exchanges.
  2. It seems like the exchange you mentioned is not yet live?

In fact it is just a demonstration of my platform, I rent it to customers, in this version I made a bot to simulate actions. But my clients already use it normally.

KabDeveloper commented 4 years ago

Hi guys, hope you are doing well !

In order to implement it with other operations, the main thing is to use GOROUTINE ! So that you execute tasks simultaniousely.

And like @nilber said, an exchange requires many parts:

And for each part, you have to choose the right technology, and in memory database is a requirment as same as containerzing parts for performances, and a way to interact between them etc, some technologies for example:

You have to combine each of them to get the best performances possible.

@nilber What kind of technology do you use KLINE datas ? Timeline database ?

Thank you

nilber commented 4 years ago

What kind of technology do you use KLINE datas ? Timeline database ?

Hi @bcashier,

I made my own algorithm/micro service in C# that works in memory (for a quick return to the user) observing the public data via the exchange's websocket. From time to time it does a disk persistence for a possible reload.

KabDeveloper commented 4 years ago

@nilber You are loading chart datas in memory? Only the last XXXX Frames or for all time frames ?

What if someone load a year of data into the chart ? How will your micro service will manage this please ?

Thanks again !

nilber commented 3 years ago

@bcashier Exactly, everything is in a list in memory and a thread for each pair of trades, to be consuming the webservice and accumulating the totalizers in RAM, according to the maximum time and intervals configuration.

As the list is in memory, the microservice makes consultations in this list, at a very high speed, so I have practically no delay in a consultation of 1 month or 1 year.

there are some specific uses and lists for each pair and time interval, this helps to segment and be even faster.

KabDeveloper commented 3 years ago

@nilber Thank you sir !

By reading you, I just learned about Redis Time Series, I hear good things about it.

I was thinking to use ElasticSearch, I read everywhere that it is fast and support big datas easily.

nilber commented 3 years ago

@bcashier

I don't really like external tools, mainly because of the cost when you need scale.

I always prefer to try to develop solutions, if they are not going to take a lot of time, obviously. I usually do it when the development time will be less than the apprehension time

if you’re doing learning, the more technologies the better ...