arbitrader icon indicating copy to clipboard operation
arbitrader copied to clipboard

Replace usages of DecimalConstants with metadata lookup

Open scionaltera opened this issue 3 years ago • 0 comments

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.

scionaltera avatar May 26 '21 20:05 scionaltera