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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user