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
["asset", mint_address]
Asset Type
Instructions
init_asset_config_account
Register a new token for use in the protocol.Parameters
| Parameter | Type | Description |
|---|---|---|
nav_data | Vec<NavData> | 1-5 NAV pricing sources |
price_difference_bps | u16 | Maximum allowed price divergence (0-9900 BPS) |
asset_type | AssetType | Whether token is RWA or Stablecoin |
Required Accounts
Behavior
- Creates AssetConfig PDA for the token mint
- Creates the fee-vault ATA owned by
program_authorityfor fee collection - Validates NAV data (1-5 sources, decimals ≤ 9) and
price_difference_bps <= 9900 - Sets
pausedtofalseby default - Sets
used_in_pairs_countto 0
Access Control
Access: Admin onlyExample
update_asset_config_account
Update NAV sources for an existing asset.Parameters
| Parameter | Type | Description |
|---|---|---|
nav_data | Vec<NavData> | Updated NAV pricing sources (1-5) |
price_difference_bps | u16 | Updated price divergence tolerance (0-9900 BPS) |
asset_type | AssetType | New asset type (change blocked if asset is in use) |
Required Accounts
Behavior
- Updates NAV sources and price divergence threshold after validating
price_difference_bps <= 9900 - Can update
asset_type, but change is blocked ifused_in_pairs_count > 0 - Does not affect pause state or usage count
Access Control
Access: Admin onlyExample
set_paused_for_asset
Set the pause state for a specific asset.Parameters
| Parameter | Type | Description |
|---|---|---|
paused | bool | New pause state |
Required Accounts
Behavior
- Updates asset’s pause state
- When paused, all swaps involving this asset are blocked
- Does not affect other assets or global state
Access Control
Access: Admin onlyExample
NAV Data Types
The program supports three types of NAV pricing sources:U64FixedAddress
Read price from a fixed byte offset in an on-chain account.- 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.- Dollar-pegged stablecoins (price = 1.0)
- Assets with contractually fixed prices
- Testing and development
PythPush
Pyth Network oracle integration.- Market-priced assets
- Assets with Pyth price feeds
- High-frequency price updates
View Price Source Details
Complete documentation on NAV pricing configuration and validation
Price Aggregation
When multiple NAV sources are configured:- Read All Sources: Each source returns a price
- Normalize: All prices converted to 9 decimal places
- Validate Divergence: Check all prices within
price_difference_bps - Average: Return average of all valid prices
Error Codes
| Error | Description |
|---|---|
Unauthorized | Caller is not admin |
MustProvideAtLeastOneNavData | No NAV sources provided |
Max5NavData | More than 5 NAV sources |
PriceDecimalsTooLarge | Decimals exceed 9 |
MustProvideHardcodedPrice | Hardcoded price is zero |
NavMustBePositive | NAV source returned a non-positive price |
InvalidAccountPublicKey | Required NAV source account was not passed |
InvalidFeedId / InvalidMaxAge / MaxAgeTooLarge / ConfBpsTooLarge | Pyth configuration failed scalar validation |
MissingPythAccount / FeedIdMismatch | Pyth receiver account was missing or did not match the configured feed |
OutOfRange | price_difference_bps exceeds 9900 |
Next: Pair Management
Learn about trading pair creation and configuration