Skip to main content
Avana logo

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
  );
fullValueReconstructed value of the principal liquidity before later liquidation stress adjustments are applied.
feeValueValue of the fees accrued by the position that can be recognized alongside principal.
reserveValueReserved portion held back for oracle, unwind, and protocol risk buffers.

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:

1

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.

2

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.

3

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.

4

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.

5

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 TypeOracle SourceNotes
Curve Stable/Stable ERC-20 LPsExternal stablecoin feeds + pool-state checks + TWAP verificationExternal prices anchor the assets while pool balances and fee accrual determine discounted collateral value.
Uniswap V2 ERC-20 LPsChainlink + reserve reconstruction + TWAP verificationStandard LP tokens are valued from reconstructed underlying balances, with TWAP used as a manipulation-resistant cross-check.
Uniswap V3 NFT LPsChainlink + position decomposition + tick/TWAP checksThe NFT is decomposed by liquidity, active range, and current price, then haircut for recoverable liquidation value.
Balancer Multi-Asset LPsChainlink + weighted inventory reconstructionMulti-token pools use external prices and weighted pool inventory to estimate conservative collateral value.
SushiSwap / AerodromeChainlink + reserve reconstruction + TWAP verificationPool-derived observations verify reconstructed value and help resist same-transaction abuse in lower-liquidity markets.
PancakeSwapChainlink + block-based TWAP verificationExternal 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:

ParameterDescription
TokenCollateral token address
AggregatorV3InterfaceChainlink feed for underlying token
maxFeedAgeMaximum acceptable age for Chainlink feed
PoolSpecific DEX pool (Uniswap V3, Balancer, Curve, etc.)
twapSecondsWindow for TWAP computation
ModeOracle operational mode (standard/fallback)
maxDifferenceMax 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.