kamino-scripts, spot-scripts, trustful-scripts, lend-scripts, drift-scripts, client-raydium-clmm-scripts) with two complementary entry points:
CLI
The recommended interface for vault managers and operators. Every operation is one
<group>:<action> command driven by a JSON profile and per-call flags. No source edits to change runtime values.Programmatic examples
Runnable TypeScript for developers embedding the operation builders directly in their own services, bots, or transaction pipelines. One self-contained file per action.
The CLI and examples both wrap the lower-level
@voltr/vault-sdk and the protocol adapter packages. Use the CLI for routine operations; drop down to the SDK or examples when you embed Voltr in your own code.Repository layout
| Path | What it is |
|---|---|
apps/cli | The unified CLI (@voltr/scripts-cli) exposing every <group>:<action> command |
packages/core | Shared vault behavior — signers, RPC, token accounts, lookup tables, transaction modes (@voltr/scripts-core) |
packages/kamino · packages/spot · packages/trustful | Per-integration adapter packages (account derivation + instruction building) |
examples/ | One runnable TypeScript file per action, for SDK consumers |
docs/ | Canonical guides: operator-guide.md, kamino.md, spot.md, trustful.md, adaptor-admin.md, architecture.md |
Install
pnpm cli -- <args>: the leading -- separates pnpm’s own arguments from the CLI’s. Flags after it (--profile, --mode, …) are parsed normally.Profiles
A profile is one JSON file describing one vault deployment: its cluster, asset, optional lookup table, and any integration addresses. Routine operational values live in the profile; per-call values are flags; secrets are never in the profile. The profile is validated with zod on load, so a missing or malformed field fails before any RPC call.Keypairs & roles
Commands sign as one of three roles. Each resolves its keypair path from a flag, falling back to an environment variable — the flag wins. If neither is set, the command fails up front naming both.| Role | Flag | Env var | Used by |
|---|---|---|---|
admin | --admin-keypair | ADMIN_KEYPAIR | vault:init*, metadata, config, adaptor admin, harvest-fee |
manager | --manager-keypair | MANAGER_KEYPAIR | strategy operations (Kamino/Spot/Trustful, claims) |
user | --user-keypair | USER_KEYPAIR | deposit/withdraw, direct-withdraw |
--rpc-url flag → RPC_URL env → HELIUS_RPC_URL env → rpcUrl in the profile.
Transaction modes — verify before you execute
Every transaction command takes--mode (default print). A command builds first (reading chain state over RPC, and the Jupiter API for swaps), then dispatches the mode — so a reachable RPC is required in every mode except check.
| Mode | Sends on-chain? | What it does |
|---|---|---|
print (default) | No | Prints { label, instructionCount, lookupTableAddresses } + operation metadata. The no-send preview. |
simulate | No | One simulateTransaction RPC; prints OK/FAILED, compute units, program logs, explorer URL. |
multisig | No | Emits a base64/base58 transaction message to import into a multisig (e.g. Squads). Requires --multisig-address. |
execute | Yes | Signs with the role keypair, sends, confirms; prints the signature and compute units. |
Global options
| Option | Purpose |
|---|---|
--profile <path> | Profile JSON to load (required) |
--rpc-url <url> | RPC override |
--mode <mode> | print (default) / simulate / multisig / execute |
--multisig-address <pubkey> | On-chain signer PDA; required for --mode multisig |
--priority-fee <kind> | helius (default) / rpc / fixed / none |
--priority-fee-micro-lamports <n> | microLamports for --priority-fee fixed |
--compute-unit-limit <n> | Override the estimated compute-unit limit |
Command groups
Commands are grouped by<group>:* prefix. The CLI itself is the authoritative reference for the full command surface and every flag:
| Group | Commands | Reference |
|---|---|---|
| Vault (core) | vault:init, vault:init-and-set-token-metadata, vault:set-token-metadata, vault:update-config, vault:accept-admin, vault:harvest-fee, vault:deposit, vault:request-withdraw, vault:withdraw, vault:cancel-request-withdraw, vault:instant-withdraw, vault:query:position, vault:query:strategy-positions | operator-guide.md |
| Adaptor admin | vault:add-adaptor, vault:remove-adaptor, vault:init-direct-withdraw | adaptor-admin.md |
| Kamino | kamino:market:{init,deposit,withdraw,claim-reward}, kamino:kvault:{init,deposit,withdraw,claim-reward-with-index,direct-withdraw,request-and-direct-withdraw} | kamino.md |
| Spot | spot:swap:{init,buy,sell}, spot:earn:{init,extend-lut,deposit,withdraw,init-direct-withdraw}, spot:query:strategy-positions | spot.md |
| Trustful | trustful:arbitrary:{init,deposit,withdraw}, trustful:curve:{init,borrow,repay,remove} | trustful.md |
| Maintenance | check (offline profile validation) | — |
Recipes
The following assumeRPC_URL and the role keypairs are set in .env. Run each with --mode print then --mode simulate before --mode execute.
Initialize a vault
Initialize a vault
vault:init cannot use --mode multisig: a fresh vault keypair must sign initialization, which a multisig payload can’t carry. Use --mode execute.Add an adapter (one-time admin step)
Add an adapter (one-time admin step)
vault:add-adaptor defaults to the Kamino adaptor; pass --adaptor-program for the others.Deposit / withdraw (user)
Deposit / withdraw (user)
Kamino market & kVault (manager)
Kamino market & kVault (manager)
Spot swap & Earn (manager)
Spot swap & Earn (manager)
Register the Spot adaptor first.
Trustful arbitrary & curve (manager)
Trustful arbitrary & curve (manager)
Register the Trustful adaptor first.
Programmatic examples
For automation, bots, and services that embed Voltr directly, theexamples/ directory holds runnable TypeScript — one self-contained file per action that imports the public operation builders, inspects a BuiltOperation, and routes it through the shared transaction processor. They are the lower-level programmatic path; the CLI remains the primary interface for routine operations.
--profile, --rpc-url, --mode, --multisig-address, --yes); --help lists them.
Example catalog
| Group | Files |
|---|---|
| Vault / core | initialize, deposit, request-withdraw, withdraw, instant-withdraw, cancel-request-withdraw, query-position, query-strategy-positions |
| Kamino | market-{init,deposit,withdraw,claim-reward}, kvault-{init,deposit,withdraw,claim-reward,direct-withdraw,request-and-direct-withdraw} |
| Spot | swap-{init,buy,sell}, earn-{init,deposit,withdraw,extend-lut,init-direct-withdraw}, query-strategy-positions |
| Trustful | arbitrary-{init,deposit,withdraw}, curve-{init,borrow,repay,remove} |
| Composition | allocate — sequence builders from more than one package through the shared processor |
@voltr/scripts-core, @voltr/scripts-kamino, @voltr/scripts-spot, @voltr/scripts-trustful). See examples/README.md for the full catalog and the offline pnpm examples:check verification.
Where to go next
Supported Integrations
The adaptors and their CLI command groups
Strategy Setup Guide
Add adaptors and initialize strategies
Fund Allocation
Deploy idle funds into strategies
SDK Reference
The lower-level
@voltr/vault-sdk builders