Kamino Integration StagingStaging
set_lending_policy
Sets Kamino lending market and borrow allowlists.
Handler narrative
- Load the GLAM state or program account required by the instruction and verify the signer.
- Verify that the integration is enabled on the vault and that the caller has the required delegate permission or owner authority.
- Validate the instruction-specific policy, then invoke the external protocol with the vault authority where required.
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 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.
Accounts
Uses the standard Big Seven account pattern; no instruction-specific accounts beyond it.
Arguments
| Argument | Type | Notes |
|---|---|---|
| policy | LendingPolicy | Policy object written to GLAM state for this program or integration. Fields: markets_allowlist: vec<pubkey> - Kamino lending markets/reserves the vault may access.; borrow_allowlist: vec<pubkey> - Assets the vault may borrow inside Kamino lending. |
Policy & permissions
- The Kamino Integration Staging integration must be enabled on the vault before this instruction can run.
- Only the owner is expected. Delegates do not receive this capability by being added; it must be granted explicitly if supported.
- Policy changes should be governed by owner controls and timelock settings.
Cross-instruction constraints
- No additional cross-instruction constraint is documented beyond account initialization, authority checks, and policy validation.