fix: use dynamic quantity/price precision per symbol from exchange info

Hardcoded round(qty, 1) caused -1111 Precision errors for TRXUSDT and
DOGEUSDT (stepSize=1, requires integers). Now lazily loads quantityPrecision
and pricePrecision from Binance futures_exchange_info per symbol. SL/TP
prices also use symbol-specific precision instead of hardcoded 4 decimals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
21in7
2026-03-08 13:07:23 +09:00
parent 97aef14d6c
commit c6c60b274c
3 changed files with 53 additions and 4 deletions

View File

@@ -23,6 +23,8 @@ def client():
c = BinanceFuturesClient.__new__(BinanceFuturesClient)
c.config = config
c.symbol = config.symbol
c._qty_precision = 1
c._price_precision = 4
return c
@@ -39,6 +41,8 @@ def exchange():
c.config = config
c.symbol = config.symbol
c.client = MagicMock()
c._qty_precision = 1
c._price_precision = 4
return c