GLAM MintProduction
price_vault_tokens
Prices the vault SOL balance and allowlisted token holdings.
Handler narrative
- Load the GLAM state or program account required by the instruction and verify the signer.
- Read the relevant vault positions and oracle accounts, calculate their base-asset value, and write the result into the state pricing records.
- Prices vault SOL balance and tokens it holds. Args: -
denom: Denomination of the price. -agg_indexes: Indexes of the aggregation oracles for the tokens (must follow the same order of mints in extra accounts). If aggregation oracle is not used for token #i,agg_indexes[i]should be set to -1. Extra accounts for pricing N tokens: - (ata, mint, oracle) x N - optional oracle mapping (only add it if any token uses an agg oracle)
Required conditions
- The submitted accounts must match the declared account list, signer requirements, writable requirements, fixed program addresses, and account relationships shown below.
- The GLAM state account is the source of truth for owner, enabled integrations, delegate permissions, policies, assets, borrowable assets, timelock settings, mint linkage, and pricing records.
- The vault account must be the PDA controlled by the core protocol program and derived conceptually from the state account; instructions use it as the vault authority for SOL, token accounts, and external positions.
- Mint actions must satisfy the linked GLAM state, Token-2022 mint configuration, mint policy, and any request queue or escrow state involved in the flow.
- All pricing instructions for the same pricing operation must be in one Solana transaction; splitting them across multiple transactions is unsupported and can produce stale, inconsistent, or rejected NAV calculations.
- Oracle, token-account, position, and pricing-record accounts must all refer to the same vault state and base asset so the AUM calculation is internally consistent.
Accounts
| Account | Role | Description |
|---|---|---|
| glam_state | writable | State account owned by the GLAM Protocol program; it records vault configuration, policies, and pricing records. |
| glam_vault | read-only | Vault account controlled by the GLAM Protocol program; conceptually derived from the state account and used as the vault authority. |
| signer | signer, writable | Calling authority. It must be the owner or a delegate with the explicit permission required by this instruction. |
| sol_usd_oracle | read-only | Pricing or oracle account used to calculate value for the instruction. |
| base_asset_oracle | read-only | Pricing or oracle account used to calculate value for the instruction. |
| integration_authority | read-only | Program-derived authority used by an integration during CPI into an external protocol. |
| glam_config | read-only | Global GLAM configuration account for fee and asset/oracle metadata. |
| glam_protocol | read-only | GLAM Protocol program account used for authorization or CPI. |
| event_authority | optional | Program-derived account used by this instruction; clients should prefer SDK helpers when available. |
| event_program | optional | Fixed program or sysvar account required by this instruction. |
Arguments
| Argument | Type | Notes |
|---|---|---|
| agg_indexes | vec<[i16; 4]> | Oracle aggregation indexes for the vault token pricing accounts passed with the instruction. |
Policy & permissions
- No external integration enablement is required beyond the program-level functionality involved in this instruction.
- Pricing callers must be authorized to update valuation records for the vault. Pricing does not grant asset-movement rights.
TypeScript SDK usage
const pricingIxs = await glamClient.price.priceVaultIxs();
const validateIx = await glamClient.price.validateAumIx();
// Submit all pricing instructions and validation together.Cross-instruction constraints
- All pricing instructions for this pricing operation must be included in the same Solana transaction. Splitting them across multiple transactions is not supported and will produce incorrect or rejected NAV calculations.