Price Sources
When deriving a price from on-chain data, we look at pools in the following decentralized exchanges (DEXes):
- Uniswap v2
- Uniswap v3
- Sushiswap
- Curve
When our price endpoints are called, they first try to retrieve DEX-derived price data. If none is available, they fall back on Chainlink. This is the default behavior, but it can be overridden so that Chainlink is checked before falling back on DEX data.
When token prices are returned in USD, the USD value is derived from a basket of USD stablecoins. In other words, all of the data use comes from on-chain. When token prices are returned in other fiat currencies, we:
- 1.compute the price in USD, then
- 2.use the ratio of ETH-USD/ETH-{EUR, GBP, etc} found on Chainlink to yield the price of the requested token in the non-USD fiat currency.
This implies that prices returned in anything but USD include centralized data.
Forex prices on Chainlink started to become available from Feburary 2021. For prior prices, we used daily price from Yahoo Finance, e.g. https://finance.yahoo.com/quote/EURUSD=X.
⚠
DEXes are relatively new. Since people sometimes need prices of assets pre-DEXes, we retrieve those from Yahoo Finance and return them via API price endpoints.
⚠
Last modified 2mo ago