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

Trying to implement it to a real project #13

Open
KabDeveloper opened this issue Sep 23, 2019 · 10 comments
Open

Trying to implement it to a real project #13

KabDeveloper opened this issue Sep 23, 2019 · 10 comments

Comments

@KabDeveloper
Copy link

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
Copy link

@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
Copy link

nilber commented Nov 9, 2020

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...

@ooolxxx-dj
Copy link

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
Copy link

nilber commented Nov 10, 2020

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
Copy link
Author

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:

  • Wallet API
  • Blockchain Server
  • Web Sockets
  • Databases
  • Orderbook
  • Kline datas
  • KYC
  • etc.

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:

  • Apache Kafka (A Distributed Streaming Platform)
  • Redis (In memory database)
  • Rabbit MQ (Websocket)
  • MySQL/Postgres (Database)
  • Docker (Containerize each service)
  • Kubernetes and others....

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
Copy link

nilber commented Nov 13, 2020

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
Copy link
Author

@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
Copy link

nilber commented Nov 16, 2020

@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
Copy link
Author

@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
Copy link

nilber commented Nov 19, 2020

@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 ...

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