nautechsystems / nautilus_trader

A high-performance algorithmic trading platform and event-driven backtester
https://nautilustrader.io
GNU Lesser General Public License v3.0
2.15k stars 485 forks source link

Wrong data fields used for Binance spot instrument parsers #1039

Closed logogin closed 1 year ago

logogin commented 1 year ago

Bug Report

Expected Behavior

Exchange pairs (BTCUSDT) should have base BTC and quote USDT sides.

Actual Behavior

Both base and quote sides are equal to BTC.

Steps to Reproduce the Problem

instrument_id = Instrument.from_str('BTCUSDT.BINANCE')
instrument = cache.instrument(instrument_id)

print(instrument.base_currency)
Currency { code: "BTC", precision: 8, iso4217: 0, name: "BTC", currency_type: Crypto }

print(instrument.quote_currency)
Currency { code: "BTC", precision: 8, iso4217: 0, name: "BTC", currency_type: Crypto }

The bug seems to be copy paste in https://github.com/nautechsystems/nautilus_trader/blob/12801bec93142427dbe9eafa289d71ceb08a13d5/nautilus_trader/adapters/binance/spot/schemas/market.py#L72-L79

Specifications

cjdsellers commented 1 year ago

Thanks for reporting @logogin

Now fixed from c91dc829ac78f45cea93d5803c608b2729b1c84b on develop and will make it into the next release over the next couple of days.