Skip to content

Update Binance Data Structures#288

Open
snow-avocado wants to merge 7 commits into
ccxt:masterfrom
snow-avocado:upstream-master-event-times
Open

Update Binance Data Structures#288
snow-avocado wants to merge 7 commits into
ccxt:masterfrom
snow-avocado:upstream-master-event-times

Conversation

@snow-avocado
Copy link
Copy Markdown

@snow-avocado snow-avocado commented Feb 17, 2026

Per futures documentation, event and book time exist on the data stream. Below I add optional elements so they are captured for futures streams. Let me know if you prefer I add this in a different way.

Also, I have removed buyer_order_id and seller_order_id on TradeEvent, which are no longer set by futures or spot feeds (https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#trade-streams)

@snow-avocado snow-avocado force-pushed the upstream-master-event-times branch from b41005e to 9cc3f63 Compare February 18, 2026 00:57
Binance Spot WebSocket trade stream no longer documents fields 'b' and 'a' (buyer/seller order IDs).

Reference: https://developers.binance.com/docs/binance-spot-api-docs/web-socket-streams#trade-streams
@snow-avocado snow-avocado changed the title Support event_time and book_time in BookTickerEvent Update Binance Data Structures Feb 20, 2026
@snow-avocado
Copy link
Copy Markdown
Author

@carlosmiei could you review this change? Thanks!

SpaceMonkeyForever pushed a commit to SpaceMonkeyForever/binance-rs that referenced this pull request May 11, 2026
The futures `@bookTicker` payload carries `E` (event time) and `T`
(transaction time) on the wire, but the spot `BookTickerEvent` struct
that the futures stream was reusing didn't declare those fields, so
serde silently dropped them. Downstream consumers had to fall back to
`Utc::now()` for "when did this market event happen", which conflates
wire/decode latency with exchange-side timing.

Add a futures-specific `BookTickerEvent` in `futures::model` that carries
both timestamps, and rewire `FuturesWebsocketEvent::BookTicker` /
`FuturesEvents::BookTickerEvent` to use it. Spot's struct is untouched —
the spot `@bookTicker` payload still doesn't carry exchange time.

Equivalent to the BookTickerEvent slice of upstream PR ccxt#288
without the dependency/TradeEvent churn.
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

Successfully merging this pull request may close these issues.

1 participant