Examples#
Real-world workflows demonstrating common Seesaw CLI usage patterns. Each example walks through a complete scenario with full commands.
1. Complete Market Lifecycle#
Create a market, mint shares, trade, snapshot the end price, resolve, redeem winnings, and close the market.
Prerequisites#
# Initialize config and verify setup
seesaw config init-file
seesaw config show
Step 1: Create a market#
seesaw market create \
--pyth-feed Gnt27xtC473ZT2Mw5u8wZ68Z3gULkSTb5DuxJy7eJotD \
--pyth-feed-id ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d \
--settlement-mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--duration 900
Save the returned market, marketId, and orderbook addresses for later steps.
Step 2: Mint share pairs#
Deposit USDC to receive equal YES and NO shares:
seesaw position mint \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--amount 1000000 \
--token-account ATA1abc123def456ghi789jkl012mno345pqr678stu
Step 3: Place a sell order#
Sell the NO shares you do not want, effectively taking a YES position:
seesaw order place \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--side sell-no \
--price 4500 \
--quantity 1000000 \
--token-account ATA1abc123def456ghi789jkl012mno345pqr678stu
Step 4: Wait for the market window to end#
Monitor the market state:
seesaw market get Mkt1abc123def456ghi789jkl012mno345pqr678stu
When tEnd has passed, proceed to snapshot.
Step 5: Snapshot the end price#
seesaw market snapshot \
--market-id 112640 \
--pyth-feed Gnt27xtC473ZT2Mw5u8wZ68Z3gULkSTb5DuxJy7eJotD \
--pyth-feed-id ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d \
--creator Cre8orAddr123456789abcdefghijklmnopqrstuv \
--duration 900
Step 6: Resolve the market#
seesaw market resolve \
--market-id 112640 \
--pyth-feed-id ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d \
--creator Cre8orAddr123456789abcdefghijklmnopqrstuv \
--duration 900
Step 7: Redeem winning shares#
If the outcome was UP and you hold YES shares:
seesaw position redeem \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--amount 1000000 \
--token-type yes \
--token-account ATA1abc123def456ghi789jkl012mno345pqr678stu
Step 8: Close the market#
Reclaim rent after all positions are settled:
seesaw market close \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--creator Cre8orAddr123456789abcdefghijklmnopqrstuv
2. Emergency Force-Close#
When a market has been resolved or expired but a position owner has not redeemed, anyone can force-close their position. This settles the position and returns funds to the owner.
Scenario#
Market Mkt1abc... was resolved 2 hours ago but user User1abc... has not redeemed. You want to force-close their position to reclaim account rent.
Step 1: Verify market state#
seesaw market get Mkt1abc123def456ghi789jkl012mno345pqr678stu
Confirm the market state is RESOLVED or EXPIRED.
Step 2: Check the position#
seesaw position get \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--user User1abc123def456ghi789jkl012mno345pqr678s
Confirm settled is false and shares are present.
Step 3: Force-close#
seesaw market force-close \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--position-owner User1abc123def456ghi789jkl012mno345pqr678s \
--user-usdc-ata ATA1abc123def456ghi789jkl012mno345pqr678stu \
--settlement-mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
The position owner's USDC ATA receives their payout (if any), and the position account is closed.
Step 4: Close the market#
Once all positions are force-closed or redeemed:
seesaw market close \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--creator Cre8orAddr123456789abcdefghijklmnopqrstuv
3. Market Making#
Provide liquidity by placing simultaneous bid and ask orders on a market.
Step 1: Check the current order book#
seesaw order list --market Mkt1abc123def456ghi789jkl012mno345pqr678stu
Step 2: Mint shares for inventory#
seesaw position mint \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--amount 5000000 \
--token-account ATA1abc123def456ghi789jkl012mno345pqr678stu
Step 3: Place a bid (buy YES)#
seesaw order place \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--side buy-yes \
--price 4800 \
--quantity 2000000 \
--token-account ATA1abc123def456ghi789jkl012mno345pqr678stu \
--order-type post-only
Step 4: Place an ask (sell YES)#
seesaw order place \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--side sell-yes \
--price 5200 \
--quantity 2000000 \
--token-account ATA1abc123def456ghi789jkl012mno345pqr678stu \
--order-type post-only
You are now quoting a 4-cent spread (4800-5200 bps). The post-only order type ensures your orders are never matched as taker (and thus pay no taker fee).
Step 5: Monitor your orders#
seesaw order list \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--owner $(solana address)
Step 6: Cancel and re-quote as needed#
# Cancel the bid
seesaw order cancel \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--order-id 42 \
--token-account ATA1abc123def456ghi789jkl012mno345pqr678stu
# Place a tighter bid
seesaw order place \
--market Mkt1abc123def456ghi789jkl012mno345pqr678stu \
--side buy-yes \
--price 4900 \
--quantity 2000000 \
--token-account ATA1abc123def456ghi789jkl012mno345pqr678stu \
--order-type post-only
4. Querying Protocol Data#
Use the api commands to query the indexer for aggregated data without submitting transactions.
List active markets#
seesaw api markets
Get detailed market info#
seesaw api market Mkt1abc123def456ghi789jkl012mno345pqr678stu
View the leaderboard#
# Weekly PnL leaderboard
seesaw api leaderboard --period weekly --metric pnl
# All-time win rate
seesaw api leaderboard --period all_time --metric winRate
# Daily volume leaders
seesaw api leaderboard --period daily --metric volume
Check protocol stats#
seesaw api stats
View personal stats (requires auth)#
export SEESAW_API_TOKEN=eyJhbGci...
seesaw api stats-personal
Check copy-trading leaders#
seesaw api copy-trading-leaders
Run a compliance check#
seesaw api compliance-check \
--address User1abc123def456ghi789jkl012mno345pqr678s \
--token eyJhbGci...
5. Admin Operations#
These commands require the protocol authority keypair.
Step 1: Initialize the protocol#
This is a one-time operation that creates the on-chain config account:
seesaw --keypair /path/to/authority-keypair.json admin init \
--treasury TreasuryAddr123456789abcdefghijklmnopqrst \
--settlement-mint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v \
--taker-fee 200 \
--maker-rebate 0 \
--tick-size 100
Step 2: Verify the config#
seesaw config get
Step 3: Update fee structure#
Change taker fees from 2% to 1.5% (150 bps), split 100 bps to protocol and 50 bps to creators:
seesaw --keypair /path/to/authority-keypair.json admin update-fees \
--taker-fee 150 \
--protocol-fee 100 \
--creator-fee 50
Step 4: Update tick size#
Reduce the minimum price increment from 100 bps to 50 bps for finer price granularity:
seesaw --keypair /path/to/authority-keypair.json admin update-tick-size \
--tick-size 50
Step 5: Emergency pause#
If an issue is detected, pause all trading:
seesaw --keypair /path/to/authority-keypair.json admin pause
Verify the protocol is paused:
seesaw config get
Step 6: Resume trading#
After the issue is resolved:
seesaw --keypair /path/to/authority-keypair.json admin unpause