CLI Guide#
The Seesaw CLI lets you manage markets, trade, and query protocol data from your terminal.
The Seesaw CLI (@seesaw/cli) supports the operational market lifecycle — creating markets,
placing single orders, cancelling single orders, managing positions, and querying protocol
data — directly from your terminal. All commands output structured JSON by default, making
the CLI suitable for scripting, automation, and integration with AI agents.
The order group exposes the full maker/operator surface: quote free-funds custody (0x08/0x09),
bulk/range cancel and reduce (0x11..0x18), and post-only ladder placement (0x0C/0x0F)
alongside single-order trading.
Tempo and TON can be selected in config with --chain tempo or --chain ton, but transaction
commands remain Solana-only until those chain-specific CLIs are implemented. TON referral
attribution is currently exposed through the TON SDK/web deposit payload builder rather than
through Solana-style fee CLI commands.
Installation#
# From the monorepo root (recommended):
pnpm --filter @seesaw/cli exec seesaw --help
# Or link locally for global access:
cd packages/cli && npm link
seesaw --help
Quick Start#
1. Initialize config#
seesaw config init-file
Creates ~/.seesaw/config.yaml with default settings (mainnet RPC, default keypair path, JSON output).
2. Check config#
seesaw config show
Displays the resolved configuration after merging config file, environment variables, and CLI flags.
3. Create a market#
seesaw market create \
--pyth-feed <pyth-price-account-address> \
--pyth-feed-id <32-byte-hex-feed-id> \
--settlement-mint <stablecoin-mint-address>
Creates a new prediction market for the specified Pyth price feed.
4. Place an order#
seesaw order place \
--market <market-address> \
--side buy-yes \
--price 5000 \
--quantity 100 \
--token-account <stablecoin-token-account> \
--treasury-token-account <protocol-treasury-token-account> \
--settlement-mint <stablecoin-mint-address> \
--user-yes-ata <yes-share-token-account> \
--user-no-ata <no-share-token-account>
Places a limit order to buy 100 YES shares at 0.50 USDT (5000 basis points).
5. Check your position#
seesaw position get --market <market-address>
Displays your current share balances, collateral, and settlement status for the specified market.
Wallet / Keypair Setup#
The CLI uses a standard Solana keypair file for signing transactions. This is a JSON file containing a 64-byte array (32-byte secret key + 32-byte public key).
Generate a new keypair#
solana-keygen new --outfile ~/.config/solana/id.json
Use an existing keypair#
Point the CLI to your existing keypair:
# Via config file
echo 'keypair: /path/to/your/keypair.json' >> ~/.seesaw/config.yaml
# Via environment variable
export SEESAW_KEYPAIR=/path/to/your/keypair.json
# Via CLI flag
seesaw --keypair /path/to/your/keypair.json market get <address>
Devnet vs. Mainnet#
For development and testing, use a devnet keypair and RPC:
solana-keygen new --outfile ~/.config/solana/devnet.json
solana airdrop 2 --keypair ~/.config/solana/devnet.json --url https://api.devnet.solana.com
Then configure the CLI:
export SEESAW_RPC_URL=https://api.devnet.solana.com
export SEESAW_KEYPAIR=~/.config/solana/devnet.json
Security Notes#
- Never share your keypair file or commit it to version control.
- The CLI reads the keypair from disk only when a transaction needs to be signed.
- Read-only commands (
config show,market get,order list,position get, allapicommands) do not require a keypair unless--userdefaults to the wallet address.
Command Groups#
| Group | Commands | Description |
|---|---|---|
config | 3 | CLI settings and on-chain config |
market | 8 | Market lifecycle operations |
order | 11 | Trading, maker ladders, cancellations, funds |
position | 6 | Position management (mint, redeem, withdraw) |
admin | 14 | Protocol admin operations (authority only) |
fee | 4 | Fee previews, referral attribution, earnings |
treasury | 2 | Protocol and referrer treasury shard operations |
creator | 3 | Creator-market lists and creator-fee claims |
api | 7 | Indexer API queries |
widget | 2 | Partner embed snippets and signed config tooling |
In This Section#
- Configuration -- Config file, environment variables, and precedence rules
- Commands -- Full reference for all 57 commands
- Examples -- Real-world workflows and step-by-step tutorials
Next Steps#
- SDK Guide -- Build applications on Seesaw programmatically
- Trustless SDK -- Validate accounts directly from any RPC node without trusting the indexer
- API Reference -- REST and WebSocket API documentation
- Architecture -- Technical deep-dives into protocol design
How the CLI Fits In#
The CLI reads configuration and wallet credentials locally, then communicates with two remote services: a Solana RPC node for on-chain transactions and the Seesaw indexer API for aggregated protocol data.