initialize_state
Initializes a GLAM state account for a vault or related account type.
Handler narrative
- Load the GLAM state or program account required by the instruction and verify the signer.
- Apply the requested state, policy, pricing, or system action after enforcing owner/delegate checks.
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.
- Creation-style flows require the target account or PDA to be uninitialized or intentionally updatable, the fee payer to be writable, and the System Program to be present when rent or allocation is needed.
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. |
| system_program | read-only | Standard Solana program account required by the instruction. |
| base_asset_mint | read-only | Token mint account used by the instruction. |
Arguments
| Argument | Type | Notes |
|---|---|---|
| state | StateModel | account_type: option<AccountType> - Vault type such as Vault, TokenizedVault, Mint, or SingleAssetVault.; name: option<[u8; 32]>; uri: option<string>; enabled: option<bool>; assets: option<vec<pubkey>> - Vault asset allowlist. These assets are also the pricing source of truth for tokenized vault AUM.; created: option<CreatedModel>; owner: option<pubkey>; portfolio_manager_name: option<[u8; 32]>; borrowable: option<vec<pubkey>> - Vault-level borrowable asset allowlist for lending integrations.; timelock_duration: option<u32> - Delay applied to sensitive owner changes when timelock enforcement is active.; integration_acls: option<vec<IntegrationAcl>> - Enabled integration programs and protocol bitmasks.; delegate_acls: option<vec<DelegateAcl>> - Delegate permissions limited by integration program and protocol. |
Policy & permissions
- No external integration enablement is required beyond the program-level functionality involved in this instruction.
- Only the owner is expected. Delegates do not receive this capability by being added; it must be granted explicitly if supported.
TypeScript SDK usage
import { GlamClient, StateAccountType, nameToChars } from "@glamsystems/glam-sdk";
const glamClient = new GlamClient();
await glamClient.state.create({
accountType: StateAccountType.VAULT,
name: nameToChars("Managed Vault"),
});Cross-instruction constraints
- No additional cross-instruction constraint is documented beyond account initialization, authority checks, and policy validation.