Closed rdeghion closed 4 years ago
How can 'free' and 'used' both be None, but there is an amount for 'total'?
Easy, because if the exchange only supplies the total, like Kraken does, we cannot possibly know how much is used
and how much is free
of the total
. Kraken just does not supply enough data from the balance endpoint – and this is considered normal. Some exchanges just don't return enough information to find all values with a single request.
You can verify that by just looking into the info
. As the CCXT Manual says, the info
contains the response from the exchange as is, untouched. Inside the info
you can see that Kraken has returned just one value for each currency. From a single value only the total
can be deduced directly from Kraken, thus free
and used
are unknown = undefined = None = null.
The documentation shows 'free' + 'used' = 'total', but my balances are showing None + None > 0.
None
means "value unknown / not available from the exchange".
So, the true meaning is X + Y > 0
.
Python says if the type of the value is None
– you should not do arithmetics with it.
Duplicate issues:
Let us know if that does not answer your question.
Link to the Manual where the above is explained: https://github.com/ccxt/ccxt/wiki/Manual#balance-inference
Thank you. I thought 'free' and 'used' were working for Kraken the other day, but I must have been mistaken. I'm new to this... my mistake
How can 'free' and 'used' both be None, but there is an amount for 'total'? The documentation shows 'free' + 'used' = 'total', but my balances are showing None + None > 0.