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

Improvement: CoinGecko coin id fetching #14511

Open
Cuteivist opened this issue Apr 24, 2024 · 1 comment
Open

Improvement: CoinGecko coin id fetching #14511

Cuteivist opened this issue Apr 24, 2024 · 1 comment

Comments

@Cuteivist
Copy link
Contributor

CoinGecko is our fallback market data provider. It operates on its own coin ids to identify each token. At the moment coin id is fetched so later token symbol can be mapped to coin id for url.
CoinGecko api (coins/list) returns mapping where token symbol name can be mapped to different values meaning token symbol will be later mapped to wrong coingecko's coin id.

To prevent that other APIs must be used.
Steps:

  1. Remove coins/list API call and add 3 token_price/{id} API calls with token contract addresses for each network - https://docs.coingecko.com/v3.0.1/reference/simple-token-price . This might require additional thought to optimize grouping the contract addresses to correct networks.
  2. Update all historical calls to also use contract addresses https://docs.coingecko.com/v3.0.1/reference/coins-contract-address

While it increase number of requests, it will allow to get proper values for prices.

@Cuteivist
Copy link
Contributor Author

After checking each endpoint response I found out that even when we would use addresses there still might be some problems, because not all addresses exists on coingecko.

I found out that we can pintpoint correct tokens by checking platforms property and marking those on eth platform. This might still produce some corner case errors, but it gives us best coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants