crates/adapters/binance/test_data/README.md
This directory stores crate-local fixtures for the Rust Binance adapter.
Start with the canonical examples from the Binance API docs.
See SOURCES.md for the current source map by parser surface.
spot/http_json/ holds Spot REST JSON fixtures.spot/user_data_json/ holds Spot user-data JSON fixtures.futures/http_json/ holds Futures HTTP JSON fixtures.futures/market_data_json/ holds Futures market-data stream fixtures.futures/user_data_json/ holds Futures user-data stream fixtures.Two capture binaries produce raw SBE fixture data.
cargo run --bin binance-spot-http-capture-fixtures --package nautilus-binance
Writes fixtures under spot/http_sbe/{env}/{category}/:
spot/http_sbe/mainnet/public/ for public mainnet captures.spot/http_sbe/testnet/private_read/ for signed read-only testnet captures.spot/http_sbe/testnet/order_flow/ for testnet order-flow captures.spot/http_sbe/demo/private_read/ for signed read-only demo captures.spot/http_sbe/demo/order_flow/ for demo order-flow captures.Public capture requires no credentials. Signed read-only capture requires Spot
credentials for the selected environment. Order-flow capture is blocked on mainnet.
It only runs on testnet or demo with --include-order-flow,
--order-quantity, and --order-price.
cargo run --bin binance-spot-ws-user-data-capture --package nautilus-binance -- \
--environment testnet --include-order-flow \
--order-quantity 0.001 --order-price 10000
Writes fixtures under spot/user_data_sbe/{env}/. Connects at the raw
WebSocket level, authenticates via session.logon, and subscribes to the user
data stream. With --include-order-flow, places and cancels a limit order to
trigger execution report (template 603) and account position (template 607)
events. All captured frames are raw SBE binary.
Each capture run writes:
.sbe file..metadata.json file.manifest.json for the full capture run.Use docs examples as the primary source for JSON fixtures. Use captured SBE
payloads as the wire-format source for decode_* coverage when Binance only
documents schema fields and message semantics.
Some branch-specific JSON fixtures are derived from a published docs example
when Binance only shows one state for a message. Keep those cases narrow.
Document each derived case in SOURCES.md.