GLAMIDL Reference

enable_disable_protocols

Enables or disables protocol bitflags for an integration program on a vault.

Handler narrative

  1. Load the GLAM state or program account required by the instruction and verify the signer.
  2. Update the access-control record in the state account after checking owner authority and timelock or emergency rules.

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.
  • Owner-level actions must be signed by the state owner unless the instruction is explicitly an integration callback, mint-authority callback, delegate action, or emergency access update.
  • The selected integration program and protocol bitflag are written into the state integration ACL; disabling a protocol prevents both owner-driven delegated use and delegate-driven use of that protocol through integration checks.

Accounts

AccountRoleDescription
glam_statewritableState account owned by the GLAM Protocol program; it records vault configuration, policies, and pricing records.
glam_signersigner, writableCalling authority. It must be the owner or a delegate with the explicit permission required by this instruction.

Arguments

ArgumentTypeNotes
integration_programpubkeyIntegration program whose protocol permissions are being changed on the vault integration ACL.
protocols_bitmasku16Bitmask of one or more protocol capabilities to enable or disable for that integration program.
set_enabledbool

Policy & permissions

  • No external integration enablement is required beyond the program-level functionality involved in this instruction.
  • Caller must be the owner or a delegate with the explicit protocol permission required by this instruction.

TypeScript SDK usage

import { GlamClient, getProgramAndBitflagByProtocolName } from "@glamsystems/glam-sdk";
import { PublicKey } from "@solana/web3.js";

const glamClient = new GlamClient({ statePda: vaultState });
const [program, bitflag] = getProgramAndBitflagByProtocolName()["KaminoVaults"];
await glamClient.access.enableProtocols(new PublicKey(program), parseInt(bitflag, 2));

Cross-instruction constraints

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