GLAMIDL Reference

close_strategy

Close a direct lender strategy owned by 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.
  • The target account must be writable and controlled by the program or authority expected by the instruction.
  • The rent refund destination or signer account must be writable because closing returns lamports to that account.
  • Any protocol-specific empty-state requirement, such as zero balance, zero supply, no pending request, or no active position, must be satisfied before closure.
  • The instruction metadata names CloseStrategy as the delegate permission for this instruction.
  • strategy must be tracked in the vault's registered-position registry.

Accounts

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

AccountRoleDescription
bs_authsignerFixed program or sysvar account.
strategywritableExternal strategy account.
principal_mintread-onlyToken mint account.
token_programread-onlyToken program (SPL Token or Token-2022) used by the strategy's principal mint during close.
associated_token_programread-onlyStandard Solana program account.
event_authorityread-onlyAnchor event authority PDA used when the invoked program emits events.

No arguments

Policy & permissions

  • Enable the Loopscale integration program on the vault integration ACL before Loopscale position actions.
  • Delegate permission: CloseStrategy.

Cross-instruction constraints

  • The Loopscale strategy must be tracked in the vault's registered positions when required by policy.