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

feat(usd-estimation): add defillama price source #4341

Merged
merged 11 commits into from
May 16, 2024

Conversation

alfetopito
Copy link
Collaborator

Summary

Part of #4238

  • Add Defillama price source as fallback
  • Fix Coingecko rate limit detection
  • Refactor usd price fetching

To Test

  1. On mainnet/gchain, load an account that has many funds and/or many trades with surplus for different tokens
  2. Open the tokens page, open the activity modal page
  3. Open the console in the network tab
  • Once there are coingeckoProxy requests failing with 429 errors, there should be requests for defillama
  1. Open the console logs and filter by UsdPricesUpdater
  • There should be logs indicating when coingecko, defillama or cowprotocol prices are being used

Note

The console logs are noise, I know.
Will remove them before merging.

@alfetopito alfetopito self-assigned this Apr 30, 2024
Copy link

vercel bot commented Apr 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
cosmos ✅ Ready (Inspect) Visit Preview May 16, 2024 8:24am
cowfi ✅ Ready (Inspect) Visit Preview May 16, 2024 8:24am
cowfi-new ✅ Ready (Inspect) Visit Preview May 16, 2024 8:24am
explorer-dev ✅ Ready (Inspect) Visit Preview May 16, 2024 8:24am
swap-dev ✅ Ready (Inspect) Visit Preview May 16, 2024 8:24am
widget-configurator ✅ Ready (Inspect) Visit Preview May 16, 2024 8:24am

@alfetopito alfetopito requested review from a team April 30, 2024 16:46
Copy link
Contributor

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (but tested in #4345 , as here I was not able to get 429 conigecko requests even after placing 22 limit orders)

@elena-zh
Copy link
Contributor

elena-zh commented May 1, 2024

UPD: also noticed defilama requests in the PR after coingecko ones failed:
image

Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants