Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace usages of DecimalConstants with metadata lookup #415

Open
scionaltera opened this issue May 26, 2021 · 0 comments
Open

Replace usages of DecimalConstants with metadata lookup #415

scionaltera opened this issue May 26, 2021 · 0 comments
Labels
tech debt Refactors, tests, documentation, etc.

Comments

@scionaltera
Copy link
Member

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 scionaltera added the tech debt Refactors, tests, documentation, etc. label May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech debt Refactors, tests, documentation, etc.
Projects
None yet
Development

No branches or pull requests

1 participant