GLAM ProtocolProduction
jupiter_swap
Executes a Jupiter swap for vault-held assets under GLAM policies and delegate permissions.
Accounts
| Account | Role | Description |
|---|---|---|
| glam_state | writable | GLAM state account that stores vault configuration, integration ACLs, delegate permissions, policies, assets, mint linkage, and pricing records. |
| glam_vault | writable | Vault PDA associated with the GLAM state and used as the vault authority. |
| glam_signer | signer, writable | Calling authority or fee payer. |
| cpi_program | read-only | Downstream program invoked by this instruction. |
| input_stake_pool | optional | Stake, stake-pool, or staking-related account. |
| output_stake_pool | optional | Stake, stake-pool, or staking-related account. |
Arguments
| Argument | Type | Notes |
|---|---|---|
| data | bytes |
Policy & permissions
- SingleAssetVault states are rejected.
- Caller: GLAM owner, or a delegate with one of GLAM Protocol / Jupiter Swap /
SwapToAny,SwapFromAny,SwapAllowlisted, orSwapLst— selected from the configuredJupiterSwapPolicyallowlist and from whether both mints resolve as LSTs through the supplied stake-pool accounts. - Slippage is bounded by the
JupiterSwapPolicy.max_slippage_bpssetting. remaining_accountsmay not include vault token accounts other than the input and output ATAs.
TypeScript SDK usage
import { GlamClient, WSOL } from "@glamsystems/glam-sdk";
const glamClient = new GlamClient({ jupiterApiKey: "YOUR_API_KEY" });
await glamClient.jupiterSwap.swap({
quoteParams: {
inputMint: WSOL.toBase58(),
outputMint: usdcMint.toBase58(),
amount: 1_000_000_000,
slippageBps: 50,
},
});