GLAMIDL Reference

update_strategy

Update direct lender strategy terms.

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. Update direct lender strategy terms. - Permission requirement: `UpdateStrategy`. - Policy - `strategy` must be tracked in `StateAccount::external_positions`. - `params.external_yield_source_args` must be unset when `params` is provided. - `principal_mint` must be present in `LoopscalePolicy::deposit_allowlist`. - When provided, `params.market_information` must be present in `LoopscalePolicy::markets_allowlist`.

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.
  • 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.
  • The instruction metadata names `UpdateStrategy` as the delegate permission for this instruction.
  • Additional policy conditions documented for this instruction: Policy; `strategy` must be tracked in `StateAccount::external_positions`; `params.external_yield_source_args` must be unset when `params` is provided; `principal_mint` must be present in `LoopscalePolicy::deposit_allowlist`; When provided, `params.market_information` must be present in `LoopscalePolicy::markets_allowlist`.

Accounts

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

AccountRoleDescription
bs_authsignerFixed program or sysvar account required by this instruction.
strategywritableExternal strategy account used by the instruction.
principal_mintread-onlyToken mint account used by the instruction.
strategy_tawritableExternal strategy account used by the instruction.
associated_token_programread-onlyStandard Solana program account required by the instruction.
event_authorityread-onlyInstruction-specific account supplied by the caller or SDK.

Arguments

ArgumentTypeNotes
collateral_termsvec<MultiCollateralTermsUpdateParams>

apy: u64; indices: vec<CollateralTermsIndices>

paramsoption<UpdateStrategyParams>

Instruction parameter object; field details are listed below. Fields: originations_enabled: option<bool>; liquidity_buffer: option<u64>; interest_fee: option<u64>; origination_fee: option<u64>; principal_fee: option<u64>; origination_cap: option<u64>; market_information: option<pubkey>; external_yield_source_args: option<ExternalYieldSourceArgs>

Policy & permissions

  • Enable the Loopscale integration program on the vault integration ACL before Loopscale position actions.

  • Delegate permission: UpdateStrategy.

Cross-instruction constraints

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