
General concepts
Tangent uses Chainlink and Curve’s oracles to price tokens, and LP tokens. For Pendle PTs, Tangent uses the official oracle provided by Pendle.Single assets oracle
For markets with single-assets as collateral, Tangent uses Chainlink price feeds. If the asset doesn’t have a Chainlink price feed, Tangent uses theprice_oracle from a reference Curve pool, wherein the pool’s counterparty has a Chainlink price feed.
Pessimistic oracle for Curve stableswap LP tokens
Stablepool LP tokens represent a position in a stableswap liquidity pool consisting of two or more tokens whose prices are correlated. To ensure safe pricing, Tangent considers that all tokens in a pool have the price of the lowest asset in the pool, hence the pessimistic oracle naming. If any asset in a pool doesn’t have a Chainlink price feed, Tangent uses theprice_oracle from a reference Curve pool, wherein the pool’s counterparty has a Chainlink price feed.
Once the lowest asset in the pool is determined, its price is multiplied by the virtual_price of the pool to compute the price of the LP token.
For example in the situation where we consider the fxUSD/USDC pool:
USDC has a Chainlink price feed, while fxUSD doesn’t. fxUSD is then priced using the price_oracle in the fxUSD/USDC pool.
If we have the following values:
USDCChainlink price feed = $1.0005fxUSDprice_oracle= 0.9975USDCvirtual_price= 1.055
fxUSD is then the asset with the lowest price in the pool, and is used to compute the LP token’s price as follows:
Oracle for Curve cryptoswap LP tokens
Cryptoswap LP tokens (for both twocrypto and tricrypto pools) represent a position in a liquidity pool consisting of two or more tokens whose prices aren’t correlated. To ensure safe pricing, Tangent uses thelp_price, a pool’s internal and manipulation-resistant oracle.
The lp_price returns the price of the pool, denominated in the first pool’s asset. If this asset doesn’t have a Chainlink price feed, Tangent uses the price_oracle from a reference Curve pool, wherein the pool’s counterparty has a Chainlink price feed.
For example in the situation where we consider the FXN/ETH pool:
ETH has a Chainlink price feed, and is the primary asset in the pool. Hence, the lp_price is denominated in ETH.
If we have the following values:
ETHChainlink price feed = $3000lp_price= 0.25ETH
