Overview
GLAM vaults are on-chain accounts that hold assets and manage permissions. You can create different types of vaults:- Vault: Non-tokenized vault for direct asset management
- TokenizedVault: Vault with share tokens for investors
- SingleAssetVault: Specialized vault for single asset strategies
Prerequisites
Before creating a vault, ensure you have:- A funded Solana wallet
- The GLAM SDK installed
- RPC endpoint configured
Creating a vault
Initialize the GlamClient
First, create a new instance of You can also pass custom configuration:
GlamClient. The client automatically uses environment variables for wallet and RPC configuration:Prepare vault parameters
Define your vault configuration including name, account type, and base asset:The
name must be converted to a character array using stringToChars(). The base asset mint determines what asset investors deposit.Initialize the vault
Call The transaction signature is returned upon successful creation. The vault and state PDAs are automatically set on the client instance.
state.initialize() to create the vault on-chain:Complete example
Here’s a complete example from the SDK’s Node.js application:examples/nodejs-app/src/index.ts
Working with existing vaults
To connect to an existing vault, you need the state PDA:examples/nodejs-app/src/utils.ts
Updating vault state
After creation, you can update vault configuration:Next steps
Managing assets
Learn how to deposit, withdraw, and transfer assets
Access control
Set up permissions and delegate access