GLAMIDL Reference

set_loopscale_policy

Sets Loopscale deposit, borrow, and market allowlist policy.

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.
  4. Set the `LoopscalePolicy` (deposit, borrow, and markets allowlists) on the GLAM state.

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 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.
  • Configuration changes must pass owner or authorized-manager checks and, when the state or mint timelock is active, must follow the propose/apply timing model instead of taking effect immediately.
  • Additional policy conditions documented for this instruction: Set the `LoopscalePolicy` (deposit, borrow, and markets allowlists) on the GLAM state.

Accounts

Uses the standard Big Seven account pattern; no instruction-specific accounts beyond it.

Arguments

ArgumentTypeNotes
policyLoopscalePolicy

Policy object written to GLAM state for this program or integration. Fields: deposit_allowlist: vec<pubkey> - Principal/collateral mints allowed for deposits into Loopscale.; borrow_allowlist: vec<pubkey> - Principal mints allowed for borrow/refinance flows.; markets_allowlist: vec<pubkey> - Loopscale market information accounts allowed for the vault.

Policy & permissions

  • The Loopscale Integration Staging integration must be enabled on the vault before this instruction can run.

  • Owner or authorized manager signer is expected. Delegates do not receive this capability by being added; it must be granted explicitly if supported.

  • Policy changes should be governed by owner controls and timelock settings.

Cross-instruction constraints

  • No additional cross-instruction constraint is documented beyond account initialization, authority checks, and policy validation.