Price Oracles
How the protocol turns LP position state into credit-relevant collateral values.
Overview
Avana prices LP collateral by reconstructing the position and valuing the assets inside it. For fungible LPs, the protocol derives value from external asset prices and pool balance reconstruction. For concentrated liquidity, it decomposes the position by liquidity, range, current tick, token exposure, and accrued fees. The result is discounted to estimate recoverable collateral value under the market's risk assumptions. Borrowing capacity therefore reflects both the position's underlying assets and the conditions under which they could be recovered during liquidation. The distinction between position value and recoverable value matters because the oracle supplies inputs to lending decisions. ERC-20 LP tokens, position NFTs, and multi-asset pools share an interface, but each format has its own reconstruction, validation, and manipulation checks before its value reaches the Borrow Spoke.
LP collateral value depends on:
- The prices of the underlying assets
- The pool reserves or inventory split
- Fee accrual
- For concentrated liquidity, the current tick relative to the position range
- Whether the position is in-range or mostly one-sided
Oracle Interface: IOracle
`IOracle` gives Borrow Spokes a common valuation interface across LP formats. Its return values distinguish principal, accrued fees, and reserved buffers so the caller can account for each component separately:
function getValue(uint256 tokenId, address asset)
external view returns (
uint256 fullValue,
uint256 feeValue,
uint256 reserveValue
);The adapter behind this interface handles the DEX-specific reconstruction and validation. Borrow Spokes receive the same return fields for ERC-20 LP tokens, position NFTs, and multi-asset pools, while each implementation applies the checks required by its collateral type.
Multi-Layer Architecture
LP valuation is a staged process rather than a single spot-price read. The oracle path moves through the following steps:
Price underlying assets from external robust oracles
External feeds provide reference prices for the underlying tokens. This separates the asset-price input from the pool's instantaneous trading price, which can be affected by short-lived trades or manipulation.
Derive LP value conservatively
The oracle reconstructs fungible LP balances or decomposes concentrated-liquidity positions using reserves, liquidity, range, and accrued fees. These inputs determine the assets represented by the position.
Haircut for impermanent loss and liquidation slippage
The reconstructed value is discounted for stressed market conditions, liquidation slippage, and the position's exit route. The resulting value estimates what liquidation could recover.
Cap exposure by LP family and pool depth
Exposure controls use the LP family, pool type, and available liquidity depth to limit how much borrowing a market can support.
Apply recoverable value to borrowing and liquidation
Borrowing capacity and liquidation checks use the estimated value recoverable through the configured unwind route.
DEX-Specific Handling
Each DEX exposes different position and pool data. The oracle reconstructs the underlying assets from that data and verifies the resulting valuation against its reference prices and risk controls.
| DEX / LP Type | Oracle Source | Notes |
|---|---|---|
| Curve Stable/Stable ERC-20 LPs | External stablecoin feeds + pool-state checks + TWAP verification | External prices anchor the assets while pool balances and fee accrual determine discounted collateral value. |
| Uniswap V2 ERC-20 LPs | Chainlink + reserve reconstruction + TWAP verification | Standard LP tokens are valued from reconstructed underlying balances, with TWAP used as a manipulation-resistant cross-check. |
| Uniswap V3 NFT LPs | Chainlink + position decomposition + tick/TWAP checks | The NFT is decomposed by liquidity, active range, and current price, then haircut for recoverable liquidation value. |
| Balancer Multi-Asset LPs | Chainlink + weighted inventory reconstruction | Multi-token pools use external prices and weighted pool inventory to estimate conservative collateral value. |
| SushiSwap / Aerodrome | Chainlink + reserve reconstruction + TWAP verification | Pool-derived observations verify reconstructed value and help resist same-transaction abuse in lower-liquidity markets. |
| PancakeSwap | Chainlink + block-based TWAP verification | External prices remain the anchor while block-based observations validate position state and unwind assumptions. |
TWAP Computation by DEX
Time-weighted average prices (TWAPs) provide verification data alongside external asset prices and position reconstruction. Comparing these inputs helps identify short-lived price distortions or inconsistent pool state. TWAP data supplements the valuation process rather than supplying the collateral value on its own.
Uniswap V2 & SushiSwap
On-chain cumulative price data over a 1-hour window is used to cross-check the reconstructed reserve picture and reduce sensitivity to flash swaps or other short-lived pool distortions.
Uniswap V3
For concentrated-liquidity positions, checks use tick range, liquidity distribution, and accrued fees to verify the token exposure represented by each NFT.
Balancer
Weighted token observations are combined with pool weights to validate multi-asset inventory splits before the oracle assigns a conservative collateral value.
Curve
Stablecoin observations are used mainly to detect stale feeds, reserve drift, and short-term anomalies while external prices remain the primary anchor.
Trader Joe & Aerodrome
Cumulative price observations over a 30-60 minute window help validate lower-liquidity pool state and resist same-transaction manipulation during collateral checks.
Safety & Manipulation Prevention
- Deviation Thresholds
New loans or liquidations can be paused when pool-derived verification data moves too far away from external reference prices beyond
maxDifference. - maxPoolPriceDifference
This keeps pool-implied state aligned with underlying token prices and limits instantaneous pool manipulation or same-transaction oracle abuse.
- Open Interest Caps
Exposure is capped by LP family, pool depth, and collateral complexity so thinner markets receive tighter borrow limits.
- Recovery Haircuts
The oracle discounts theoretical LP value for impermanent loss, unwind slippage, and stressed liquidation assumptions before any borrow power is granted.
- Oracle Sentinel
Oracle Sentinel watches feed health and verification inputs and can trigger fallback behavior when data is stale, compromised, or inconsistent with position-state checks.
Configurable Oracle Parameters
Pool-specific oracle settings are configured per token through setTokenConfig. The table below lists the parameters used to validate a token's price feed and associated pool:
| Parameter | Description |
|---|---|
| Token | Collateral token address |
| AggregatorV3Interface | Chainlink feed for underlying token |
| maxFeedAge | Maximum acceptable age for Chainlink feed |
| Pool | Specific DEX pool (Uniswap V3, Balancer, Curve, etc.) |
| twapSeconds | Window for TWAP computation |
| Mode | Oracle operational mode (standard/fallback) |
| maxDifference | Max allowed deviation between DEX and verification price |
In practice, oracle behavior comes from the combination of external asset pricing, LP reconstruction logic, recoverable-value treatment, and the per-token settings configured through setTokenConfig.
