@bundie/sol-cli
v0.6.0
Published
Bundie Solana CLI — prepare-only agent interface. Returns unsigned transactions (base64) for external signing; --execute opt-in for BYOW.
Maintainers
Readme
@bundie/sol-cli
Bundie Solana CLI — the prepare-only agent surface for composing strategies, opening prediction markets, and resolving them on-chain.
Binary: bundie-sol
Network: Solana devnet (mainnet post-hackathon)
Programs: Strategy Token + Prediction Market on Solana
Version: 0.2.0 — prepare-only by default (breaking change from 0.1.x)
Install
npm install -g @bundie/sol-cliOr run ad-hoc with npx:
npx @bundie/sol-cli --helpPrepare-only design
Every write command defaults to prepare mode — it builds a transaction, prints a JSON envelope (base64 unsigned tx + metadata) to stdout, and exits. No keys are touched.
bundie-sol buy-shares --strategy <PUBKEY> --amount 25 --payer <MY_PUBKEY>Output:
{
"description": "Buy 25 USDC worth of shares in strategy ...",
"tx": "AQAAAA...base64...",
"signers": [{ "pubkey": "...", "role": "buyer" }],
"accounts": [...],
"metadata": { "strategy": "...", "mint": "...", "amountUsdc": 25 },
"blockhash": "...",
"lastValidBlockHeight": 12345678,
"preparedAt": "2026-04-22T17:00:00.000Z"
}An agent, MCP server, CI pipeline, or multi-sig can deserialize tx, add the payer signature, and send it:
const tx = Transaction.from(Buffer.from(prepared.tx, "base64"));
tx.sign(myKeypair);
await connection.sendRawTransaction(tx.serialize());--execute (opt-in BYOW)
For local iteration you can pass --execute to sign + send using the local keypair (reads ~/.config/solana/id.json, or --keypair <path>, or $ANCHOR_WALLET). This preserves the pre-0.2 UX for devs who prefer it.
bundie-sol buy-shares --strategy <PUBKEY> --amount 25 --executeQuick start
# Prereqs
solana-keygen new --outfile ~/.config/solana/id.json
solana airdrop 2 --url devnet
# Get devnet USDC from https://faucet.circle.com
# PREPARE a create-strategy tx (prints JSON, does not send)
bundie-sol create-strategy --name "Stable Compounder" --protocol kamino --fee-bps 1000 --deposit 50
# ...or EXECUTE end-to-end locally
bundie-sol create-strategy --name "Stable Compounder" --protocol kamino --fee-bps 1000 --deposit 50 --execute
# Read-only commands (always just print)
bundie-sol nav --strategy <PUBKEY>
bundie-sol list-strategies
bundie-sol get-snapshot --strategy <PUBKEY>Commands
| Command | Mode | What it does |
|---|---|---|
| create-strategy | prepare / --execute | Mint a new strategy share (returns up to 2 txs: create + optional seed-deposit) |
| buy-shares | prepare / --execute | Buy shares at current NAV |
| create-market | prepare / --execute | Open a prediction market on a strategy |
| predict | prepare / --execute | Take a YES/NO position on a market |
| resolve-market | prepare / --execute | Permissionlessly resolve a market after its resolution slot |
| snapshot-positions | prepare / --execute | Write a 24h-lagged composition snapshot (keeper archetype) |
| nav | read-only | Read live NAV / share price / APY |
| list-strategies | read-only | List every on-chain strategy |
| get-snapshot | read-only | Read the most recent position snapshot for a strategy |
Payer resolution
In prepare mode the CLI only needs the pubkey of the fee payer. Resolution order:
--payer <base58>(pubkey only, never reads a secret)--keypair <path>(reads pubkey in prepare; reads secret on--execute)$ANCHOR_WALLET~/.config/solana/id.json
Why prepare-only?
CLI, MCP, and Skills are parallel interfaces that target the same protocol. Only one of them should hold keys. Making CLI prepare-only means:
- Agents / MCP servers / Skills can compose a call and return the tx to the caller for signing.
- CI pipelines and multi-sig flows can inspect the tx before signing.
- BYOW UX stays available via
--executefor local devs.
For AI agents
Point Claude Code, Cursor, elizaOS, ZerePy, or any shell-capable agent at this CLI. Because every command emits structured JSON on stdout, agents can pipe output directly into their signing layer without bespoke parsing.
Links
- Protocol: bundie.fi
- EVM sibling:
@bundie/evm-cli(scaffolded later) - MCP sibling:
bundie-fi/mcp - Skills sibling:
bundie-fi/skills
License
MIT
