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 cancel and reduce (0x11..0x15, 0x54, 0x55), and post-only ladder placement (0x0D/0x10)
alongside single-order trading.
The beta CLI is Solana-only. Non-Solana chain values are rejected in config and via
--chain.
Installation#
# From the monorepo root (recommended):
bun run --cwd packages/cli 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-id <32-byte-hex-feed-id> \
--settlement-mint <stablecoin-mint-address> \
--max-total-shares <u64> \
--max-confidence-ratio <bps>
Creates a new Pull market for the specified Pyth price feed. Configure
PYTH_API_KEY in the local environment or key vault; the CLI posts the
Receiver update. See creation options for provider
and exact tip approvals.
4. Place an order#
seesaw order place \
--market <market-address> \
--outcome yes \
--intent buy \
--price 5000 \
--quantity 100000000 \
--self-trade-behavior 0 \
--max-age-seconds 300 \
--protocol-treasury-index 3 \
--token-account <stablecoin-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),
assuming six-decimal shares; --quantity is in share base units.
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
No public devnet deployment is assumed. To create and trade a test market, use a Seesaw program you deployed to devnet or a local validator, then configure the program, settlement mint, and feed variables explicitly:
# Disposable 6-decimal settlement mint for test markets.
spl-token create-token --decimals 6 --url https://api.devnet.solana.com \
--fee-payer ~/.config/solana/devnet.json
export SEESAW_PROGRAM_ID=<deployed-seesaw-program-id>
export SEESAW_SETTLEMENT_MINT=<mint-from-spl-token-create-token>
export SEESAW_PYTH_FEED_ID_HEX=ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d
Use those values in seesaw market create as --settlement-mint,
--pyth-feed-id. Pull creation obtains its update through the configured API
or a local Hermes key; it does not accept a cached --pyth-feed account.
For local validator work, replace
SEESAW_RPC_URL with http://127.0.0.1:8899 and set SEESAW_PROGRAM_ID to the
local deployment id.
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 | 18 | Market lifecycle and Pyth Pull settlement |
order | 17 | Trading, maker ladders, cancellations, funds |
trade | 3 | Quote and submit guarded outcome routes |
position | 11 | Positions and idle-seat recovery |
admin | 16 | Protocol admin operations (authority only) |
fee | 5 | Fee previews, referral attribution, earnings |
builder | 3 | Builder fee approvals: approve, revoke, status |
treasury | 5 | Protocol and referrer treasury shard operations |
spline | 23 | Maker series and market-specific seat lifecycle |
creator | 3 | Creator-market lists and creator-fee claims |
currency | 3 | Currency registration and freeze exceptions |
source | 27 | Signed source markets and witness registry |
api | 9 | Indexer API queries |
replay | 5 | Record, replay, simulate and measure a market |
publisher | 6 | Publish and inspect maker quotes |
embed | 2 | Embeddable market widget URL and iframe snippet |
referral | 1 | First-party referral links |
strategy | 13 | On-chain trading strategies |
quotes | 8 | Managed maker book quotes and inventory |
river | 17 | River gateway orders, market data, accounts and fees |
stop-loss | 3 | Stops held by a stop-loss keeper |
confidential | 13 | Private wallet data on this device |
pyth | 2 | Pyth price updates (Hermes BYOK and Seesaw relay) |
keeper | 1 | Run the permissionless lifecycle keeper |
bridge | 2 | Bridge deposits to mainnet USDT through Relay |
watchlist | 3 | Indexer watchlist |
alerts | 3 | Indexer price alerts |
notifications | 4 | Indexer notification inbox and preferences |
profile | 2 | Indexer profile |
handle | 2 | Referral handles |
share | 2 | PnL share snapshots |
compliance | 4 | Jurisdiction attestation and responsible-trading limits |
service | 2 | Public indexer service status |
In This Section#
- Configuration -- Config file, environment variables, and precedence rules
- Commands -- Full CLI reference
- Examples -- Real-world workflows and step-by-step tutorials
Next Steps#
- SDK Guide -- Build applications on Seesaw programmatically
- Reading Data -- Read accounts directly from RPC
- 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.