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

Currency conversion is not working and is wrong in production #2418

Closed
arrenv opened this issue May 21, 2024 · 4 comments · Fixed by #2525
Closed

Currency conversion is not working and is wrong in production #2418

arrenv opened this issue May 21, 2024 · 4 comments · Fixed by #2525
Assignees
Labels
bug Something isn't working

Comments

@arrenv
Copy link
Member

arrenv commented May 21, 2024

Steps to reproduce

  1. Add funds to a colony with value, examples included in screenshots USDC, ETH, and ARB.
  2. Check the balance of funds in the users denominated currency.
  3. The values are either incorrect or missing.

Expected behaviour

  • The currency conversions should show a value if it has a value.
  • The currency conversion value should show correctly.

Actual behaviour

  • Token values are not being shown, when a value exists.
  • Token values are showing wrong, if a value does exist.

image

image

image

image

@arrenv arrenv added the bug Something isn't working label May 21, 2024
@rdig
Copy link
Member

rdig commented May 22, 2024

Needs to be investigated but I suspect this to be Coingecko limitation for Arbitrum

@davecreaser davecreaser self-assigned this Jun 12, 2024
@davecreaser
Copy link
Contributor

Looking into this now, it looks like on production it's calling coingecko to get a price like this:

https://api.coingecko.com/api/v3/simple/token_price/xdai?contract_addresses=0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9&vs_currencies=eur&x_cg_demo_api_key=

Correct me if i'm wrong, but on production it should be using arbitrum one as the asset platform, so using:

https://api.coingecko.com/api/v3/simple/token_price/arbitrum-one?contract_addresses=0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9&vs_currencies=eur&x_cg_demo_api_key=

The contract address is from Arbitrum, so when it's called using xdai the contract address is wrong and everything is coming back as 0 value.

@rdig if this sounds right, i'll work on correcting the asset platform in these urls

@arrenv
Copy link
Member Author

arrenv commented Jun 12, 2024

Looking into this now, it looks like on production it's calling coingecko to get a price like this:

https://api.coingecko.com/api/v3/simple/token_price/xdai?contract_addresses=0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9&vs_currencies=eur&x_cg_demo_api_key=

Correct me if i'm wrong, but on production it should be using arbitrum one as the asset platform, so using:

https://api.coingecko.com/api/v3/simple/token_price/arbitrum-one?contract_addresses=0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9&vs_currencies=eur&x_cg_demo_api_key=

The contract address is from Arbitrum, so when it's called using xdai the contract address is wrong and everything is coming back as 0 value.

@rdig if this sounds right, i'll work on correcting the asset platform in these urls

If that is the case, then that does seem like a straight forward solution :) perhaps it should be an environment variable.

@davecreaser
Copy link
Contributor

I think I've got it working using the environment variables that we currently have (network_id) and updating the asset_platform map that we use in the coingecko config to handle all the possible network_ids that we currently support. I'll check with the other devs to see what they think.

davecreaser added a commit that referenced this issue Jun 17, 2024
…n-wrong-in-production

Fix: Use correct asset platform when calling CoinGecko
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
3 participants