GLAMIDL Reference

update_weight_matrix

Update the collateral weight matrix on a loan.

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.
  • 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 ManageLoan as the delegate permission for this instruction.

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.
bs_authsignerbs auth account read by Loopscale Integration Staging's update weight matrix instruction.
loanwritableLoopscale loan account.

Arguments

ArgumentTypeNotes
paramsUpdateWeightMatrixParams

Policy & permissions

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

TypeScript SDK usage

const updateWeightMatrixIx =
  await glamClient.loopscale.txBuilder.updateWeightMatrixIx(
    { collateralIndex, weightMatrix, expectedLoanValues, assetIndexGuidance },
    { loan },
  );