Skip to content

feat: add oracle price fallback for custom-priced tokens #29

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michaeldim
Copy link

Some collateral tokens used in lending markets don't have Curve pool data or CoinGecko prices available for getUsdRate(), resulting in their collateral values displaying as $0.

This PR adds a fallback mechanism that retrieves oracle prices from the lending markets API when neither pools nor CoinGecko can provide pricing data.

The oracle prices are fetched from https://prices.curve.finance/v1/lending/markets and converted from crvUSD to USD, ensuring all lending market collateral displays accurate values.

Some collateral tokens don't appear in the pools api or coingecko, causing
getUsdRate() to return 0. These assets rely on custom oracles that chain
multiple Curve pools or vault exchange rates.

When both primary sources fail, fall back to
https://prices.curve.finance/v1/lending/markets to retrieve the oracle-reported
price.

This restores missing USD values for lending markets that use custom
oracles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant