crypto-crawler / crypto-crawler-rs

A rock-solid cryptocurrency crawler library.
Apache License 2.0
227 stars 73 forks source link

Fix bybit `max_trading_qty` type to f64 #12

Closed elbart closed 2 years ago

elbart commented 2 years ago

Hi @soulmachine

First of all: Thanks for your absolutely great effort to provide such a library!

I ran into this error for the bybit exchange recently and found a simple fix, too:

2022-02-09T18:46:59.718828Z  WARN crypto_crawler::crawlers::utils: The 0th time, invalid type: floating point `1.5`, expected i64 at line 1 column 17692
2022-02-09T18:47:01.331758Z  WARN crypto_crawler::crawlers::utils: The 1th time, invalid type: floating point `1.5`, expected i64 at line 1 column 17692
2022-02-09T18:47:02.520792Z  WARN crypto_crawler::crawlers::utils: The 2th time, invalid type: floating point `1.5`, expected i64 at line 1 column 17692
2022-02-09T18:47:04.505322Z  WARN crypto_crawler::crawlers::utils: The 3th time, invalid type: floating point `1.5`, expected i64 at line 1 column 17692
2022-02-09T18:47:08.092760Z ERROR crypto_crawler::crawlers::utils: The 4th time, invalid type: floating point `1.5`, expected i64 at line 1 column 17692
thread 'tokio-runtime-worker' panicked at 'Invalid symbols: BTCUSD, bybit inverse_swap available trading symbols are ', ***/crypto-crawler-rs/crypto-crawler/src/crawlers/utils.rs:90:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Apparently, bybit changed the type of the max_trading_qty field for one of the symbols (YFIUSDT, see: https://api.bybit.com/v2/public/symbols)

Screenshot 2022-02-10 at 12 22 08

Please find attached a simple fix!

soulmachine commented 2 years ago

Nice catch!