GLAMIDL Reference

vaults_deposit

Deposits vault assets into an allowlisted Kamino vault.

Handler narrative

  1. Load the GLAM state or program account required by the instruction and verify the signer.
  2. Verify that the integration is enabled on the vault and that the caller has the required delegate permission or owner authority.
  3. Validate the instruction-specific policy, then invoke the external protocol with the vault authority where required.

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.
  • 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

Uses the standard Big Seven account pattern, plus the instruction-specific accounts below.

AccountRoleDescription
vault_statewritableVault or external protocol account used by the instruction.
token_vaultwritableVault or external protocol account used by the instruction.
token_mintread-onlyToken mint account used by the instruction.
base_vault_authorityread-onlyVault or external protocol account used by the instruction.
shares_mintwritableToken mint account used by the instruction.
user_token_atawritableToken account read or written by the instruction.
user_shares_atawritableToken account read or written by the instruction.
shares_token_programread-onlyInstruction-specific account supplied by the caller or SDK.
event_authorityread-onlyInstruction-specific account supplied by the caller or SDK.

Arguments

ArgumentTypeNotes
max_amountu64Maximum underlying asset amount to deposit into the Kamino vault.

Policy & permissions

  • Enable KaminoVaults on the vault integration ACL. Protocol bitflag: 0b00000010.
  • Delegate permission: Kamino Vaults Deposit (0b0000000000000001).

TypeScript SDK usage

await glamClient.kaminoVaults.deposit(
  kaminoVault,
  new BN(1_000_000_000),
);

Cross-instruction constraints

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