Skip to main content
The GLAM CLI provides a powerful command-line interface for interacting with the GLAM Protocol.
GLAM CLI v0.2 is in prerelease stage. It is under active development and is subject to frequent change.
Protocol compatibility:
Program VersionSDK Version
GLAM Protocol v0.5>=0.2.0-alpha.0 (prerelease)
GLAM Protocol v0.4>=0.1.35

Getting Started

1

Install

npm install -g @glamsystems/glam-cli@0.2.0-alpha.2
This installs the CLI and makes it available in the shell as glam-cli.
2

Configure

The GLAM CLI expects a configuration file at the following path:
  • macOS / Linux: ~/.config/glam/config.json
  • Windows: %USERPROFILE%\.config\glam\config.json
It should have the following content:
{
  "cluster": "",
  "json_rpc_url": "",
  "tx_rpc_url": "",
  "keypair_path": "",
  "priority_fee": {
    "micro_lamports": 0,
    "level": "",
    "helius_api_key": ""
  },
  "glam_state": ""
}
At minimum, you need to provide cluster, json_rpc_url, and keypair_path:
{
  "cluster": "mainnet-beta",
  "json_rpc_url": "https://api.mainnet-beta.solana.com",
  "keypair_path": "/path/to/your/keypair.json",
}
3

Run

Check the version of the CLI:
glam-cli -V
Show help:
glam-cli -h

Commands Overview

CommandDescription
envDisplay current environment setup
vaultCreate, close, manage vaults
investInvestor operations (subscribe/redeem)
manageManager operations (fulfill, fees)
delegateManage vault delegates and permissions
integrationManage integration programs
jupiterJupiter swap
drift-protocolDrift protocol (spot and perp trading) integration
drift-vaultsDrift vaults integration
kamino-lendKamino lending integration
kamino-vaultsKamino vaults integration
kamino-farmsKamino farms integration
cctpCross-chain token bridge

Configuration Options

  • cluster: Value must be one of mainnet-beta, devnet, or localnet.
  • json_rpc_url: The URL of your preferred Solana JSON RPC endpoint.
  • tx_rpc_url: Optional. If not set it defaults to json_rpc_url. Use this to specify a separate RPC endpoint for landing transactions.
  • keypair_path: Path to your keypair JSON file.
  • priority_fee:
    • micro_lamports: Optional. If provided, level and helius_api_key will be ignored.
    • level: Optional (defaults to Min). Only applied if cluster is mainnet-beta. Other options are Min, Low, Medium, High, VeryHigh, UnsafeMax, Default (more info can be found here).
    • helius_api_key: Optional. Only applied if cluster is mainnet-beta. If not provided level will be ignored. The API key is needed to call Heliuls priority fee endpoint.
  • glam_state: Optional. If you want to set a default active GLAM state, you can do so here. Alternatively, you can use the set command to set the active GLAM state later on.

Dynamic Priority Fee

Use this template if you have a Helius API key and want to use dynamic priority fee:
{
  "cluster": "mainnet-beta",
  "json_rpc_url": "https://your-preferred-rpc-provider.com",
  "keypair_path": "/path/to/your/keypair.json",
  "priority_fee": {
    "level": "High",
    "helius_api_key": "YOUR_HELIUS_API_KEY"
  },
  "glam_state": "YOUR_GLAM_STATE_PUBKEY"
}

Static Priority Fee

If a fixed priority fee amount is preferred:
{
  "cluster": "mainnet-beta",
  "json_rpc_url": "https://your-preferred-rpc-provider.com",
  "keypair_path": "/path/to/your/keypair.json",
  "priority_fee": {
    "micro_lamports": 500000
  },
  "glam_state": "YOUR_GLAM_STATE_PUBKEY"
}
  • micro_lamports: Specifies a fixed priority fee per CU in micro-lamports (1,000,000 micro-lamports = 1 lamport).
  • Use this method when dynamic fee adjustment is unnecessary or unavailable.