Skip to main content

Overview

Price sources (NavData) provide USD-denominated pricing for all assets in the Multiliquid Program. Each asset can have 1-5 pricing sources, which are aggregated and validated during swap execution. The program supports three types of NAV pricing sources:

U64FixedAddress

Read price from a fixed byte offset in an on-chain account.
How It Works:
  1. Read account data at nav_account_address
  2. Read u64 at byte offset nav_price_offset
  3. Interpret value with price_decimals decimal places
Use Cases:
  • Custom price oracle accounts
  • RWA issuer-published NAV accounts
  • Any account storing price as u64 at known offset
Example Configuration:

Hardcoded

Static price value for stable-value assets.
How It Works:
  1. Return hardcoded_price directly
  2. Interpret with price_decimals decimal places
Use Cases:
  • Dollar-pegged stablecoins (USDC, USDT)
  • Assets with contractually fixed prices
  • Testing and development environments
Example Configuration:
Hardcoded prices are ideal for dollar-pegged stablecoins that maintain a 1:1 USD value. They have zero external dependencies and minimal gas costs.

PythPush

Pyth Network oracle integration for market prices.
How It Works:
  1. Deserialize the configured Pyth receiver PriceUpdateV2 account
  2. Verify the account’s feed id matches feed_id
  3. Require the update to be no older than max_age_secs
  4. Require confidence to be within max_conf_bps
  5. Normalize the Pyth price and exponent into the program’s 9-decimal NAV format
Use Cases:
  • Market-priced assets with Pyth feeds
  • Real-time price updates
  • Cross-chain price consistency
Example Configuration:
Pyth oracle integration requires the correct receiver account and feed id. Stale updates, excessive confidence ratios, or feed-id mismatches will reject the source.

Price Aggregation

When multiple NAV sources are configured for an asset, the program performs price aggregation:

Aggregation Process

Divergence Validation

The price_difference_bps setting controls maximum allowed price divergence:
Calculation:
Behavior:
  • If divergence_bps > price_difference_bps: Return 0 (block swaps)
  • If within threshold: Return average price
Example:

Decimal Normalization

All prices are normalized to 9 decimal places internally: Normalization Formula:

Configuration Examples

Single Source: Dollar-Pegged Stablecoin

Single Source: RWA with Custom Oracle

Multiple Sources: RWA with Redundancy


Reading NAV Accounts in Swaps

When executing swaps, NAV source accounts must be passed as remaining accounts:
Hardcoded NAV sources don’t require external accounts. Only U64FixedAddress and PythPush sources need their accounts passed.

Best Practices

Choosing NAV Sources

Divergence Thresholds

Monitoring

  • Track NAV source health and availability
  • Alert on divergence events (swaps blocked)
  • Monitor Pyth oracle staleness
  • Verify issuer oracle updates regularly

Error Handling


Next: Architecture Overview

Explore the program’s modular design and account structure