GLAM Protocol StagingStaging
enable_disable_protocols
Enables or disables protocol bitflags for an integration program on a vault.
Handler narrative
- Load the GLAM state or program account required by the instruction and verify the signer.
- 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
| Account | Role | Description |
|---|---|---|
| glam_state | writable | State account owned by the GLAM Protocol program; it records vault configuration, policies, and pricing records. |
| glam_signer | signer, writable | Calling authority. It must be the owner or a delegate with the explicit permission required by this instruction. |
Arguments
| Argument | Type | Notes |
|---|---|---|
| integration_program | pubkey | Integration program whose protocol permissions are being changed on the vault integration ACL. |
| protocols_bitmask | u16 | Bitmask of one or more protocol capabilities to enable or disable for that integration program. |
| set_enabled | bool |
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.