Vault Setup
Refer to CLI docs to create the vault, enable integrations and manage delegates.Project Setup
Install@glamsystems/glam-sdk using your preferred package manager (npm, pnpm, yarn etc). An example TypeScript project using the GLAM SDK can be found on Github.
Solana Basics
Key building blocks used across programs and integrations:- Program Derived Address (PDA) – A deterministic address controlled by a program, often used for vaults or state accounts.
- Mint – Defines a token’s supply, decimals, and authorities.
- Associated Token Account (ATA) – Standardized token holding account for each user-token pair.
- Token Standards
- Tokens on Solana – High-level overview.
- Token Program – Original SPL token implementation.
- Token-2022 – Newer standard with added features like transfer hooks and confidentiality.
Initialize a GlamClient
Build GlamClient from environment variables:Transaction Options
All glam sdk methods that initiate transactions accept a paramtxOptions which can be used to customize priority fees, simulation behavior, lookup tables, etc. It’s recommended to enable simulation and put a max cap on the priority fee:
getPriorityFeeMicroLamports callback function:
Kamino
Initialize User Metadata
Deposit
Borrow
Repay
Withdraw
Claim Rewards
Claiming rewards from Kamino refers to harvesting current farm incentives. Future KMNO token distributions are not yet available and are planned for a later version.