Binance COIN-M futures fetchPositions() raises KeyError: 'precision'
See original GitHub issuefetchPositions() on Binance COIN-M futures raises KeyError: ‘precision’, could not reproduce this error with a fresh application but an older running instance produce this error always. Issue might be related to the changes for #11123 .
- OS: Ubuntu 20.04.3
- Programming Language version: Python 3.8.10
- CCXT version: 1.66.23
exchange_id = 'binance'
exchange_class = getattr(ccxt, exchange_id)
options['defaultType'] = 'delivery'
binancecoinm = exchange_class({
'apiKey': 'apikey',
'secret': 'secret',
'enableRateLimit': True
'options': options,
})
position = binancecoinm.fetchPositions()
Exception happened during processing of request from ('myip', myport)
Traceback (most recent call last):
File "/usr/lib/python3.8/socketserver.py", line 683, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.8/socketserver.py", line 747, in __init__
self.handle()
File "/usr/lib/python3.8/http/server.py", line 427, in handle
self.handle_one_request()
File "/usr/lib/python3.8/http/server.py", line 415, in handle_one_request
method()
File "server.py", line 67, in do_POST
strategist.webhook_signal_analyzer(request_data)
File "/home/ubuntu/Bot/strategist.py", line 56, in webhook_signal_analyzer
position = binancecoinm.fetchPositions()
File "/home/ubuntu/.local/lib/python3.8/site-packages/ccxt/binance.py", line 4486, in fetch_positions
return self.fetch_positions_risk(symbols, params)
File "/home/ubuntu/.local/lib/python3.8/site-packages/ccxt/binance.py", line 4587, in fetch_positions_risk
parsed = self.parse_position_risk(response[i])
File "/home/ubuntu/.local/lib/python3.8/site-packages/ccxt/binance.py", line 4387, in parse_position_risk
collateralString = Precise.string_div(Precise.string_mul(leftSide, contractsAbs), '1', market['precision']['quote'])
KeyError: 'precision'
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Fee Rate
Fee Schedules for Trading on the Binance Exchange. ... volume meets the standard (Futures trading volume includes USDS-M futures and COIN-M futures).
Read more >Exchanges — ccxt 2.4.71 documentation
The ccxt library is a collection of available crypto exchanges or exchange classes. Each class implements the public and private API for a...
Read more >Close position Binance Futures with ccxt - python
I'm trying to close a position on Binance Futures using ccxt ccxt-1.39.93, Python 3.
Read more >Errors with Binance connection
"Invalid API Key" error occurs for several reasons: a trader did not enable Future ... Binance Futures error in Quantower - Timestamp for...
Read more >Binance API — python-binance 0.2.0 documentation
each object is identical to Client.aggregate_trades(). ... API Key created before your futures account opened does not support futures API service ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Verbose output for error for USD-M trading. @aidanjbailey it happens without serverload too, maybe expired contracts for delivery futures could be the reason because i only see this error after running the instance for days.
@kasimsuzen I cannot reproduce it with CCXT 1.72.79+, let us know if you have this issue with the most recent version of CCXT. Feel free to reopen it or just ask further questions if any: