Skip to main content

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:

Initialize a GlamClient

Build GlamClient from environment variables:
Alternatively you can create a GlamClient instance from RPC URL and wallet keypair programmatically:

Transaction Options

All glam sdk methods that initiate transactions accept a param txOptions 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:
If you want to enable a dynamic priority fee, use the 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.

Jupiter Swap

Create quote params:
Execute the swap: