GLAMIDL Reference

jupiter_swap_v2

Executes a Jupiter swap for vault-held assets under GLAM policies and delegate permissions, with oracle price guardrails.

Accounts

AccountRoleDescription
glam_statewritableGLAM state account that stores vault configuration, integration ACLs, delegate permissions, policies, assets, mint linkage, and pricing records.
glam_vaultwritableVault PDA associated with the GLAM state and used as the vault authority.
glam_signersigner, writableCalling authority or fee payer.
cpi_programread-onlyDownstream program invoked by this instruction.
input_stake_pooloptionalStake, stake-pool, or staking-related account.
output_stake_pooloptionalStake, stake-pool, or staking-related account.
glam_configoptionalGlobal GLAM configuration account for fee and asset/oracle metadata.
sol_usd_oracleoptionalOracle or price account used for valuation or downstream validation.
input_token_oracleoptionalOracle or price account used for valuation or downstream validation.
output_token_oracleoptionalOracle or price account used for valuation or downstream validation.

Arguments

ArgumentTypeNotes
skip_quote_price_checkbool
databytes

Policy & permissions

  • SingleAssetVault states are rejected.
  • Caller: GLAM owner, or a delegate with one of GLAM Protocol / Jupiter Swap / SwapToAny, SwapFromAny, SwapAllowlisted, or SwapLst — selected from the configured JupiterSwapPolicy allowlist and from whether both mints resolve as LSTs through the supplied stake-pool accounts.
  • Slippage is bounded by the JupiterSwapPolicy.max_slippage_bps setting.
  • The instruction performs a quote-vs-oracle price check using the supplied SOL/input/output oracles validated against glam_config asset metas. The check is skipped only when the signer holds GLAM Protocol / Jupiter Swap / SkipQuotePriceCheck (unconditional skip), or SkipQuotePriceCheckLimited and the output token has no oracle configured in glam_config (limited skip).
  • remaining_accounts may not include vault token accounts other than the input and output ATAs.

TypeScript SDK usage

await glamClient.jupiterSwap.swapV2({
  quoteParams,
  skipQuotePriceCheck: false,
  trackingAccount,
});