Replace usages of DecimalConstants with metadata lookup #415

Open
opened 2021-05-26 13:02:15 -07:00 by scionaltera · 0 comments
scionaltera commented 2021-05-26 13:02:15 -07:00 (Migrated from github.com)

The DecimalConstants we use to get a BTC scaleof 8 or a USD scale of 2 are incorrect for other currencies. The correct way is to look at the metadata on Currency or CurrencyPair, look at whether it's a volume scale or a price scale and return what we find there if it's available.

If it isn't available, we need a way for users to configure the missing data themselves rather than waiting for XChange to provide it in the next update (since that can take a month or more).

Finally we need to fall back to some kind of sane default value, but it's likely to be wrong in most cases. A reasonable guess would be 8 for crypto and 2 for fiat.

The `DecimalConstants` we use to get a BTC scaleof 8 or a USD scale of 2 are incorrect for other currencies. The correct way is to look at the metadata on `Currency` or `CurrencyPair`, look at whether it's a volume scale or a price scale and return what we find there if it's available. If it isn't available, we need a way for users to configure the missing data themselves rather than waiting for XChange to provide it in the next update (since that can take a month or more). Finally we need to fall back to some kind of sane default value, but it's likely to be wrong in most cases. A reasonable guess would be 8 for crypto and 2 for fiat.
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
scion/arbitrader#415
No description provided.