GLAMIDL Reference

vaults_withdraw

Withdraws shares or assets from a Kamino vault back to the GLAM vault.

Required conditions

  • The vault integration ACL must enable this integration before the instruction is accepted; that enablement is defined on the GLAM state account.
  • If the signer is not the owner, the delegate ACL on the GLAM state must contain the exact protocol permission required by this instruction; registering a delegate alone is insufficient.
  • Instruction-specific destination accounts must satisfy the external protocol's own account model; GLAM validates the accounts it needs for authorization and policy enforcement, then passes the remaining protocol accounts through CPI.

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.
integration_authorityread-onlyProgram-derived authority used by the integration for downstream invocation.
cpi_programread-onlyDownstream program invoked by this instruction.
glam_protocol_programread-onlyGLAM Protocol program account used for authorization or CPI.
system_programread-onlySolana System Program.
withdraw_from_available_vault_statewritableVault or downstream vault account.
withdraw_from_available_global_configread-onlywithdraw from available global config account read by Kamino Integration's vaults withdraw instruction.
withdraw_from_available_token_vaultwritableVault or downstream vault account.
withdraw_from_available_base_vault_authorityread-onlyVault or downstream vault account.
withdraw_from_available_user_token_atawritableToken account read or written by this instruction.
withdraw_from_available_token_mintwritableToken mint account used or validated by this instruction.
withdraw_from_available_user_shares_atawritableToken account read or written by this instruction.
withdraw_from_available_shares_mintwritableToken mint account used or validated by this instruction.
withdraw_from_available_token_programread-onlyToken program account.
withdraw_from_available_shares_token_programread-onlyToken program account.
withdraw_from_available_klend_programread-onlywithdraw from available Kamino Lending program account invoked or checked by this instruction.
withdraw_from_available_event_authorityread-onlyEvent authority or downstream event account.
withdraw_from_available_programread-onlywithdraw from available program account invoked or checked by this instruction.
withdraw_from_reserve_vault_statewritableVault or downstream vault account.
withdraw_from_reserve_reservewritableKamino reserve account.
withdraw_from_reserve_ctoken_vaultwritableVault or downstream vault account.
withdraw_from_reserve_lending_marketread-onlyKamino reserve account.
withdraw_from_reserve_lending_market_authorityread-onlyKamino reserve account.
withdraw_from_reserve_reserve_liquidity_supplywritableKamino reserve account.
withdraw_from_reserve_reserve_collateral_mintwritableToken mint account used or validated by this instruction.
withdraw_from_reserve_reserve_collateral_token_programread-onlyToken program account.
withdraw_from_reserve_instruction_sysvar_accountread-onlySolana sysvar account.
event_authorityread-onlyEvent authority or downstream event account.
programread-onlyAnchor program account used by the downstream protocol.

Arguments

ArgumentTypeNotes
shares_amountu64

Policy & permissions

  • Enable KaminoVaults on the vault integration ACL.
  • Delegate permission: Kamino Vaults Withdraw.

TypeScript SDK usage

await glamClient.kaminoVaults.withdraw(
  kaminoVault,
  new BN(500_000_000),
);

Cross-instruction constraints

  • The target Kamino vault must be allowed by the Kamino vaults policy before deposit or withdrawal.