GLAMIDL Reference

farms_harvest_reward

Harvests Kamino Farms rewards for a vault-owned farm position.

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.
user_statewritableUser position state account updated by the downstream protocol.
farm_statewritableKamino farm account.
global_configread-onlyglobal config account read by Kamino Integration Staging's farms harvest reward instruction.
reward_mintread-onlyToken mint account used or validated by this instruction.
user_reward_atawritableToken account read or written by this instruction.
rewards_vaultwritableVault or downstream vault account.
rewards_treasury_vaultwritableVault or downstream vault account.
farm_vaults_authorityread-onlyVault or downstream vault account.
scope_pricesoptionalOracle or price account used for valuation or downstream validation.
token_programread-onlyToken program account.

Arguments

ArgumentTypeNotes
reward_indexu64

Policy & permissions

  • Enable KaminoFarms on the vault integration ACL.
  • Delegate permission: Kamino Farms HarvestReward.

TypeScript SDK usage

await glamClient.kaminoFarm.harvest([farmState]);

Cross-instruction constraints

  • The Kamino farm user state must be initialized before stake, unstake, withdrawal, or reward harvest flows.