> ## Documentation Index
> Fetch the complete documentation index at: https://docs.multiliquid.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Asset Configuration

> Per-token NAV pricing configuration and asset management

## Overview

Asset Configuration accounts store the NAV (Net Asset Value) pricing sources and settings for each token in the protocol. Every RWA and stablecoin must have an AssetConfig account before it can be used in trading pairs.

## Account Structure

```rust theme={null}
pub struct AssetConfig {
    pub mint_address: Pubkey,               // Token mint address
    pub nav_data: Vec<NavData>,             // Up to 5 NAV pricing sources
    pub price_difference_bps: u16,          // Maximum price divergence tolerance
    pub paused: bool,                       // Asset-level pause flag
    pub version: u8,                        // Configuration version
    pub asset_type: AssetType,              // Rwa or Stable
    pub used_in_pairs_count: u16,           // Number of pairs using this asset
    pub bump: u8,                           // PDA bump seed
    pub padding: Vec<[u8; 128]>,
}
```

**PDA Seeds**: `["asset", mint_address]`

Treasury uses a separate `AssetConfig` PDA derived from `["ASSET_CONFIG", asset_mint]` under the Treasury program. Swap registration does not register an asset in Treasury. Both programs use the NAV source types below.

### Asset Type

```rust theme={null}
pub enum AssetType {
    Rwa,     // Real World Asset token
    Stable,  // Stablecoin token
}
```

## Asset Availability

The program admin controls asset registration, NAV sources, classification, price divergence thresholds, and asset pause state.

* `nav_data` contains 1–5 pricing sources, with prices normalized to 9 decimal places.
* `price_difference_bps` sets the maximum allowed price divergence (0–9900 BPS).
* When `paused` is `true`, swaps involving this asset, including as the configured fee asset, and liquidity additions of this asset are blocked. Liquidity removals, other assets' pause flags, and the global pause state are unaffected.
* `used_in_pairs_count` tracks the number of pairs using the asset. Its `asset_type` cannot change while this count is greater than zero.

The [Integration Guide](https://docs.multiliquid.xyz/svm/guides/integration.md#checking-pair-status) describes pause checks before swapping.

## NAV Data Types

The program supports four types of NAV pricing sources:

### U64FixedAddress

Read price from a fixed byte offset in an on-chain account.

```rust theme={null}
NavData::U64FixedAddress {
    nav_account_address: Pubkey,  // Account containing price data
    nav_price_offset: u16,        // Byte offset to read price
    price_decimals: u8,           // Decimal places (0-9)
}
```

**Use Cases**:

* Custom price oracle accounts
* RWA issuer-published NAV accounts
* Any account with a u64 price at known offset

### Hardcoded

Static price value for stable-value assets.

```rust theme={null}
NavData::Hardcoded {
    hardcoded_price: u64,   // Fixed price value
    price_decimals: u8,     // Decimal places (0-9)
}
```

**Use Cases**:

* Dollar-pegged stablecoins (price = 1.0)
* Assets with contractually fixed prices

### PythPush

Pyth Network oracle integration.

```rust theme={null}
NavData::PythPush {
    pyth_push_account_address: Pubkey,  // Pyth receiver price update account
    feed_id: [u8; 32],                  // Expected Pyth feed id
    max_age_secs: u64,                  // Maximum accepted price age
    max_conf_bps: u16,                  // Maximum accepted confidence ratio
}
```

**Use Cases**:

* Market-priced assets
* Assets with Pyth price feeds
* High-frequency price updates

### RedstonePush

Redstone PriceData account pricing.

```rust theme={null}
NavData::RedstonePush {
    price_feed_account: Pubkey,
    feed_id: [u8; 32],
    max_age_secs: u64,
}
```

The source checks the configured account, feed ID, price, and age.

> [card] [View Price Source Details](https://docs.multiliquid.xyz/svm/instructions/price-sources.md)
>
> Complete documentation on NAV pricing configuration and validation

***

## Price Aggregation

When multiple NAV sources are configured:

1. **Read All Sources**: Each source returns a price
2. **Normalize**: All prices converted to 9 decimal places
3. **Validate Divergence**: Check all prices within `price_difference_bps`
4. **Average**: Return average of all valid prices

If any source diverges beyond threshold, the function returns 0, blocking swaps.

***

## Error Codes

| Error | Description |
| - | - |
| `InvalidNav` | Pyth or Redstone update is stale, malformed, or for a different Pyth feed, or sources diverged beyond `price_difference_bps` |
| `NavMustBePositive` | NAV source returned a non-positive price |
| `InvalidAccountPublicKey` | Required NAV source account was not passed |
| `MissingRedstoneAccount` | Redstone price account was not passed |
| `FeedIdMismatch` | Redstone price account is for a different feed |
| `InvalidNavAccountOwner` | Pyth account is not owned by the expected receiver program |
| `ConfidenceTooLow` | Pyth confidence ratio exceeds `max_conf_bps` |
| `PriceDecimalsTooLarge` | Redstone price reports more than 9 decimals |

***

> [card] [Next: Pair Management](https://docs.multiliquid.xyz/svm/instructions/pair.md)
>
> Learn about trading pair creation and configuration


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.