-
Notifications
You must be signed in to change notification settings - Fork 127
Description
Pair's decimal_places are really about rate. Amount, as long as it's greater than the minimum, can have up to 8 decimal places regardless the pair and currency (at least in Trade method parameter and result set, but I suspect it applies everywhere). Enforcing 8 decimal places in parameter values ARE important, 9 or more places are rejected.
I failed to find a reference to 8-digit amount precision in the documentation -- maybe some other libraries have it, as there are obviously many bots buying and selling amounts like 0.01003882 BTC.
Looking at the code, I'd suggest that format_currency should be split in format_rate and format_amount (the latter doesn't really need pair information, so it's unclear in what class should in be defined). For existing code calling format_currency, it should probably be treated like format_rate to be on the safe side. Maybe I'll have some time to prepare a complete patch.