KeyError: 'price' when calling calculate_fee with Gemini
See original GitHub issue- OS: macOS Mojave (version 10.14.5)
- Programming Language version: Python 3.7.3
- CCXT version: 1.18.758
- Exchange: Gemini
- Method: calculate_fee
I am trying to use calculate_fee
method but getting KeyError: 'price'
error. When I browse through the section Precision and limits in the manual it is not clear what I am doing wrong. Also, I can place the order itself on the exchange without any issues (last line that I have commented out).
symbol = 'ETH/USD'
order_type = 'StopLimit'
side = 'sell'
amount = 1.0
price = 500.0
exchange.load_markets()
# Error --> KeyError: 'price'
print(exchange.calculate_fee(symbol, order_type, side, amount, price))
# Works fine without issues.
#order = exchange.create_order(symbol, order_type, side, amount, price)
Error:
File "/usr/local/lib/python3.7/site-packages/ccxt/base/exchange.py", line 1566, in calculate_fee
cost = float(self.cost_to_precision(symbol, amount * price))
File "/usr/local/lib/python3.7/site-packages/ccxt/base/exchange.py", line 1070, in cost_to_precision
return self.decimal_to_precision(cost, ROUND, self.markets[symbol]['precision']['price'], self.precisionMode)
KeyError: 'price'
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Feature engineering, key error in python? - Stack Overflow
Im running it in Jupyter notebook and it is executed in the given order. Same error occurs when I try to change dtype....
Read more >How to Fix KeyError Exceptions in Python - Rollbar
The Python KeyError is an exception that occurs when an attempt is made to access an item in a dictionary that does not...
Read more >Python KeyError Exceptions and How to Handle Them
In this tutorial, you'll learn how to handle Python KeyError exceptions. They are often caused by a bad key lookup in a dictionary,...
Read more >How to fix Python KeyError Exceptions in simple steps?
The KeyError is raised when the item 'Eraser' is being accessed which is not present in prices. Whenever an exception is raised in...
Read more >Python KeyError Exception Handling Examples - DigitalOcean
Python KeyError is raised when we try to access a key from dict, which doesn't exist. ... 1 Traceback (most recent call last):...
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 FreeTop 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
Top GitHub Comments
Working now. Thanks.
@kroitor After installing the build 1.18.791 getting error –
NotSupported: gemini the Gemini API doc HTML markup has changed, breaking the parser of order limits and precision info for Gemini markets