Coder Social home page Coder Social logo

Comments (10)

Igosuki avatar Igosuki commented on July 4, 2024 1

from binance-rs-async.

fdary avatar fdary commented on July 4, 2024

I think it's not implemented. I also need this feature, and I am currently working on it.

It's going smooth so far, but it will still take some time to do it right, especially since I'm new with Rust.

from binance-rs-async.

SpaceMonkeyForever avatar SpaceMonkeyForever commented on July 4, 2024

I actually managed to get it working yesterday by just changing the URL.

However, I didn't have time to look into whether the library is building the orderbook from deltas or just getting the entire orderbook every time because that wouldn't be very efficient. Do you know? I don't even know if Binance supports sending orderbook deltas to avoid sending the entire book every 100 ms

from binance-rs-async.

fdary avatar fdary commented on July 4, 2024

I don't use the orderbooks in my application. Fom what I understood you can ask for the orderbook of a market, specifying the depth you want, and after that you can subscribe to a websocket that will send you new additions to the order book in real time. You are supposed to match the orders yourself.

from binance-rs-async.

Igosuki avatar Igosuki commented on July 4, 2024

Hi, sorry for the long delay, I was unavailable.
Futures need some work to work properly.

In spot, binance offers two modes for orderbooks, one with deltas and one where you get updates every 100ms. It maybe your opinion that getting ticks for orderbooks is overkill, however you will find that maintaining an orderbook from deltas is quite the headache because of failure management.

If you'd like example/library code for orderbook management specifically we can work on that.

from binance-rs-async.

CodeForcer avatar CodeForcer commented on July 4, 2024

however you will find that maintaining an orderbook from deltas is quite the headache because of failure management.

@Igosuki is there a better way than just refreshing the book from a new snapshot when you miss a delta, it doesn't seem to happen often to me?

I'm using the following flow in general for Binance:

  1. Start buffering deltas into a channel BEFORE I take a snapshot
  2. Initiate the data structure for the orderbook from a snapshot
  3. Start updating from deltas and just discard deltas which are pre-snapshot timestamp
  4. If there is some count or timestamp mismatch on the incoming delta then refresh the snapshot and continue

It would be great to see a suggested example implementation though in this library of following the futures orderbooks. I've had to write my own implementation by hacking together logic from this package and binance-rs as I couldn't get it to work either. Also re-initiating on failure can make the data collection for backtesting buggy

from binance-rs-async.

Igosuki avatar Igosuki commented on July 4, 2024

Ideally, you'll manage fault tolerance with having multiple websocket streams up, and a way to realign your data with live data in case the main data stream fails.
Each stream has to monitor update ids and they have to be continuous, if they aren't, the stream should go into failure and restart.

I have code from last year I can rework to match this spec, it's not complicated.

from binance-rs-async.

zelenij avatar zelenij commented on July 4, 2024

Hi @Igosuki are futures coming to the library?

Also, I can see that Binance allows live subscription/unsubscription to new instruments for depth, for example:

https://binance-docs.github.io/apidocs/spot/en/#live-subscribing-unsubscribing-to-streams

However this doesn't seem to be supported in the library.

I'm quite happy to help with the coding, in needed :)

from binance-rs-async.

zelenij avatar zelenij commented on July 4, 2024

Hasn't it been published and in use for quite a bit? The .NET library has had support for futures for awhile now.

Also, the "dynamic subscription" support sounds like an easy win. Without it, if you want to subscribe to more/fewer instruments with this library, you have to recreate the web sockets (unless I'm missing something?)

from binance-rs-async.

Igosuki avatar Igosuki commented on July 4, 2024

The latest PRs added support for futures websocket streaming

from binance-rs-async.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.