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

bug: CoinGecko estimator does not normalize price for tokens which don't have 18 decimals #2887

Closed
m-lord-renkse opened this issue Aug 13, 2024 · 0 comments · Fixed by #2899
Labels
bug Something isn't working

Comments

@m-lord-renkse
Copy link
Contributor

Problem

The CoinGecko native price estimator does not normalize the prices for the tokens which don't have 18 decimals.

Impact

We cannot enable CoinGecko until this issue is fixed.

To reproduce

Request the native price for a stablecoin, which usually have less than 18 decimals.

Expected behaviour

We expect to return the same price as 1inch native price estimator does (it is the easiest comparison).

Screenshots/logs

We can see how the price of USDc differs in decimals.
image

Additional context

Normalization PR for 1inch: #2603

@m-lord-renkse m-lord-renkse added the bug Something isn't working label Aug 13, 2024
m-lord-renkse pushed a commit that referenced this issue Aug 21, 2024
# Description
Fixes: #2887

# Changes
Adjust returned native token prices when the quoted token has a
different amount of decimals than the native token to be inline with all
other native price estimator implementations.

Additionally I also removed the option to quote without denominating in
any token mainly to reduce complexity.

## How to test
Added an `ignored` unit test that checks that prices make sense.
Also compared prices returned for `wxdai` and `usdc` with prices logged
in our infra.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant