GLAMIDL Reference

deposit_collateral

Deposit collateral into a Loopscale 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.
  • The instruction metadata names DepositCollateral as the delegate permission for this instruction.
  • deposit_mint must be present in the Loopscale deposit allowlist.

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 deposit collateral instruction.
loanwritableLoopscale loan account.
borrower_collateral_tawritableToken account read or written by this instruction.
loan_collateral_tawritableToken account read or written by this instruction.
deposit_mintread-onlyToken mint account used or validated by this instruction.
asset_identifierread-onlyLoopscale asset identifier account used to validate collateral metadata.
token_programread-onlyToken program account.
associated_token_programread-onlyAssociated Token Account program.
event_authorityread-onlyEvent authority or downstream event account.

Arguments

ArgumentTypeNotes
paramsDepositCollateralParams

Policy & permissions

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

TypeScript SDK usage

const depositCollateralIx =
  await glamClient.loopscale.txBuilder.depositCollateralIx(
    { amount, assetType: 0, assetIdentifier, assetIndexGuidance },
    { loan, depositMint: collateralMint },
  );

Cross-instruction constraints

  • The Loopscale loan must exist; locking and unlocking determine when principal and collateral movements are valid.