Nouzan / exc

An abstraction layer for exchanges
MIT License
38 stars 14 forks source link

subscribe_tickers can't recv any data on binance #61

Closed rise0chen closed 1 year ago

rise0chen commented 1 year ago

The program is blocked on tickers.next().await in https://github.com/Nouzan/exc/blob/main/examples/examples/binance_ticker.rs

rise0chen commented 1 year ago

blocked on https://github.com/Nouzan/exc/blob/430a95fed042a55ad44b3359207367fd0134fdf3/exc/src/util/subscribe_tickers.rs#LL122C29-L122C29

export ENDPOINT=binance-u
export INST=BTCUSDT

And, example binance_trade_bid_ask is work

Nouzan commented 1 year ago

The correct instrument format is all lowercase and without separators for Binance, like btcusdt. But it is a problem that it won't throw an error when the format is wrong.

Nouzan commented 1 year ago

And you can also try the InstrumentsLayer which will create a conversion layer that can convert between the standard instrument format and the exchange-defined format. You can check the examples for binance and okx. Though there are too many details and not easy to use for now, not until I define the ToExchange trait.

rise0chen commented 1 year ago

ok, export INST=btcusdt is work