Glossary#
Terminology and definitions for the Seesaw protocol.
A#
Ask#
An offer to sell shares at a specified price. In Seesaw, a Sell YES rests as a SellYes ask in the YES lane and a Sell NO rests as a SellNo ask in the NO lane, each at its own outcome's price.
Atomic#
An operation that either fully succeeds or fully fails, with no partial state changes. All Seesaw instructions are atomic.
B#
Basis Point (bps)#
One hundredth of a percentage point. 100 bps = 1%, 10,000 bps = 100%. Seesaw uses basis points for all price representation.
Best Ask#
The lowest price at which someone is willing to sell. Represented as best_ask_price in the orderbook.
Best Bid#
The highest price at which someone is willing to buy. Represented as best_bid_price in the orderbook.
Bid#
An offer to buy shares at a specified price. In Seesaw, a Buy YES rests as a BuyYes bid in the YES lane and a Buy NO rests as a BuyNo bid in the NO lane, each at its own outcome's price.
Binary Market#
A market with exactly two possible outcomes. In Seesaw, these are UP (price increased) or DOWN (price decreased).
BPF (Berkeley Packet Filter)#
The virtual machine used by Solana to execute on-chain programs. Seesaw is compiled to BPF.
C#
Canonical Order Book#
The single per-market order-book account. It has a bid arena and an ask arena, and each arena holds a YES lane and a NO lane. Every order is stored at its own outcome's price; NO orders are never converted to YES prices, and orders match only within their own outcome lane.
Closer Reward#
A time-escalating (Dutch) SOL bounty paid from a native market's rent-safe
prepaid budget to the caller who successfully completes snapshot_end (oracle
class, paid only to the price update's poster), resolve_market or
expire_market (plain class). The reward rises linearly from 0 at the step's
eligibility time to a cap over a ramp (genesis: oracle 1,710,000 lamports over
2,480 s; plain 200,000 lamports over 1,000 s). Each market copies the caps and
ramps at creation and is pre-funded with cap_oracle + 2 * cap_plain.
force_close and close_market pay no closer reward; remaining market
lamports are recovered by the creator. The reward incentivizes
permissionless crank operators without requiring privileged protocol
infrastructure.
Collateral#
The USDT (or other settlement currency) locked to back positions. Full collateralization ensures the protocol can always pay out.
Confidence Interval#
The Pyth oracle's uncertainty range for a price. Markets may optionally reject prices with wide confidence intervals.
Crank#
A permissionless operation that advances protocol state, such as creating markets or capturing price snapshots. Anyone can run a crank.
Crossed Book#
An invalid state where the best bid is >= the best ask. Seesaw prevents this condition.
D#
Discriminator#
An 8-byte prefix that identifies the account type. Used to prevent account confusion attacks.
Dual-View Single Engine#
Seesaw's order book design where clients send an outcome (YES or NO), an intent (BUY or SELL), and a price in that outcome's own price space. The program derives one of four stored custody sides (BuyYes, SellYes, BuyNo = bid receiving NO, SellNo = ask escrowing NO) and keys every order in its own outcome lane at the price the client sent. YES and NO lanes share one account but never match each other.
E#
Epoch#
A time window during which a single market operates. Durations are configurable from 60 seconds to 7 days (default: 15 minutes). The window starts when market creation lands and lasts the full configured duration; markets do not share creation epochs.
Expiry#
The deadline after which a market can be force-closed if not properly resolved. Set to 7 days after the epoch ends (MARKET_EXPIRY_WINDOW = 604,800 s).
F#
Fill#
A trade execution where a taker's order matches against a maker's resting order.
Free Funds#
Settlement tokens or share credits held in a trader's TraderLedgerAccount
slot rather than in their external wallet. Used by the *WithFreeFunds
instructions (swap_with_free_funds 0x0E, place_limit_with_free_funds
0x0F, batch_post_only_with_free_funds 0x10, cancel and reduce variants
0x16–0x19). deposit_funds (0x08) moves tokens into the ledger;
withdraw_funds (0x09) moves them back out. Free funds reduce per-trade
transaction overhead for active market makers.
Force Close#
An emergency mechanism to close markets that are stuck. Available after the expiry window.
Full Collateralization#
The requirement that every share is backed by exactly 1 USDT in the vault. This ensures the protocol is always solvent.
G#
Governance#
The mechanism for updating protocol parameters. Currently controlled by protocol authority.
H#
Health Check#
A system to verify the protocol and crank infrastructure are operating correctly.
I#
Idempotency#
The property that an operation can be safely repeated without changing the result. All crank operations are idempotent.
Immediate-Or-Cancel (IOC)#
An order type that executes whatever quantity is possible immediately and
cancels the remainder. Use order_type = 2 in PlaceOrderArgs. A
worst_acceptable_price_bps guard limits how far the fill price may deviate
from the specified price (SlippageExceeded, 0x3007).
Invariant#
A condition that must always be true. Violating an invariant indicates a bug or attack.
K#
Keypair#
A public/private key pair used for signing transactions. Crank operators need a funded keypair.
L#
Limit Order#
An order that specifies a maximum buy price or minimum sell price. Unfilled portions rest on the order book.
Liquidity#
The availability of orders on the book. More liquidity means tighter spreads and better execution.
Locked Shares#
Shares committed to open sell orders. Locked shares cannot be sold again until the order is cancelled or filled.
Locked Collateral#
USDT committed to open buy orders. Locked collateral cannot be used for other orders.
M#
Maker#
A trader whose order rests on the order book before execution. Makers pay zero taker fee.
Market#
A prediction market for one configured trading window. Each market predicts whether the underlying asset's price will go UP or DOWN within its configured duration.
Market ID#
A unique identifier for a market. A native market uses a positive creator-chosen Unix-microsecond preparation identity; it does not encode lifecycle timestamps.
Matching Engine#
The component that pairs buy and sell orders and executes trades.
Mid Price#
The average of the best bid and best ask. Used to estimate the market's implied probability.
N#
Naked Short#
Selling shares you don't own. Prohibited in Seesaw - you can only sell shares in your position.
NO Share#
A share that pays out 1 USDT if the market resolves to DOWN (price strictly decreased: P_end < P_start). Note: if the price is unchanged, the outcome is UP and YES shares win.
O#
Oracle#
An external data source providing price information. Seesaw uses Pyth Network exclusively through the Pull-only Pyth Receiver flow.
Pull-only Oracle#
The caller posts an ephemeral PriceUpdateV2 account produced by the pinned
Pyth Receiver. The program verifies feed ID, Receiver ownership, freshness,
confidence, and firstness; no oracle-mode selector or mutable config ID exists.
Pull makes Sampling Rule A firstness deterministic because the caller controls
which exact update is submitted.
Order Book#
A data structure that stores all open buy and sell orders, sorted by price.
Order ID#
A unique identifier for an order within a market's orderbook. Monotonically increasing.
Outcome#
The final result of a market: UP or DOWN. Determined by comparing end price to start price.
P#
PDA (Program Derived Address)#
A deterministic address derived from seeds and the program ID. PDAs can sign on behalf of the program.
PriceUpdateV2#
The Pyth Solana Receiver account format for pull-mode price data. A caller
posts a PriceUpdateV2 (verified by the Pyth Receiver program) immediately
before a lifecycle instruction like create_market or snapshot_end. Seesaw
reads it by checking the account owner against the pinned Receiver ID and the
feed ID against market.pyth_feed_id, then extracts price, confidence,
exponent, and publish time from fixed offsets.
Permissionless#
Operations that can be executed by anyone without special authorization.
Position#
A user's holdings in a specific market, including YES shares, NO shares, and locked amounts.
PostOnly Order#
An order that will only be placed if it doesn't immediately match. Rejected if
it would cross the spread (WouldCross, 0x3004). Use order_type = 1 in
PlaceOrderArgs. The place_multiple_post_only (0x0D) instruction
submits up to four post-only bids and four post-only asks in a single instruction.
Price Band (Maker Price Band)#
A guard on resting maker orders. A bid or ask may not be placed more than
MAKER_BAND_BPS (1,000 bps = 10%) away from the current orderbook midpoint.
The static fallback floor is STATIC_MIN_BPS_FOR_BAND (100 bps) and the
ceiling is STATIC_MAX_BPS_FOR_BAND (9,900 bps), used when the book is empty
and no midpoint exists. Orders outside the band return OrderPriceOutOfBand
(0x3012).
Price-Time Priority#
The matching rule where better prices match first, and at equal prices, earlier orders match first.
Protocol#
The Seesaw smart contract and its rules.
Pyth Network#
The decentralized oracle network providing price feeds for Seesaw markets.
Q#
Quantity#
The number of shares in an order or position.
R#
Referral Account#
A per-user PDA (["seesaw", "referral", user]) recording the attributed referrer and the attribution timestamp. Written once by set_referrer; immutable for 365 days.
Referrer#
An address recorded in a user's ReferralAccount. Earns the configured referral allocation on eligible taker fees (5% at shipped defaults; see fee constants). Can be any Solana address.
Referrer Treasury#
Eight sharded escrow token account PDAs (["seesaw", "referrer_treasury", &[shard_index]], shard_index ∈ [0, 8)) that receive rolled-up eligible referral allocations from market vaults. Per-referrer balances are tracked in individual ReferrerEarningsAccount PDAs and claimed via claim_referrer_earnings.
Rent#
Solana's fee for storing data on-chain. Accounts must be rent-exempt (hold enough SOL to cover 2 years of rent).
Resolution#
The process of determining a market's outcome based on the start and end price snapshots.
Resting Order#
An order that is sitting on the order book waiting to be filled.
S#
Self-Trade Behavior#
How the matching engine handles a taker order that would match against the same
user's own resting order. Configured per-order via self_trade_behavior in
PlaceOrderArgs:
| Value | Name | Action |
|---|---|---|
0 | Abort | Reject the entire taker order |
1 | CancelProvide | Cancel the resting maker order and continue taker fill |
2 | DecrementTake | Reduce the taker quantity by the maker's size, skip fill |
CancelProvide (1) is the default.
Settlement Sweep#
The process by which claim_creator_fees (0x1F) transfers deferred creator
fee earnings from the market vault to the creator's token account, and
claim_referrer_earnings (0x21) transfers accumulated referral earnings from
the referrer_treasury shard to the referrer's token account. Both are
permissionless — any caller may trigger them after market resolution, but funds
always flow to the designated recipient.
Sampling Rule#
The rule for which Pyth price to use for snapshots. Seesaw uses "first price with publish_time >= boundary."
Settlement#
The process of paying out winning positions after a market resolves.
Settlement Currency#
The token used for collateral and payouts. Default: USDT.
Snapshot#
A captured oracle price at a market's start or end timestamp.
Slippage#
The difference between the price a trader expected to pay (their limit price)
and the average price they actually received. In Seesaw the
worst_acceptable_price_bps field in PlaceOrderArgs sets a hard floor for
IOC/taker orders; if the fill price would cross this guard the instruction
returns SlippageExceeded (0x3007). Slippage is not the same as price impact.
Price Impact#
The permanent shift in the orderbook's mid price after a fill. A large taker order that sweeps several resting orders moves the best bid or best ask and therefore changes the mid price for all subsequent participants. Price impact is distinct from slippage (the deviation for the current taker) and distinct from the taker fee (which is charged on the fill amount separately).
Solvency#
The property that the protocol can always pay all obligations. Ensured by full collateralization.
Spread#
The difference between the best bid and best ask. Tighter spreads indicate better liquidity.
State Machine#
The formal model of market states (PENDING, CREATED, TRADING, SETTLING, RESOLVED, CLOSED) and valid transitions.
T#
Terminal Forfeiture#
When a market expires (outcome = 0 past the MARKET_EXPIRY_WINDOW) and a user
does not call force_close before the market is cleaned up, any remaining
collateral in that position is irrecoverably locked. Users should monitor
market state and claim positions before expiry or call force_close to recover
collateral from an unresolved market.
Trader Ledger#
The TraderLedgerAccount PDA (["seesaw", "trader_ledger", market]) that
tracks per-trader free and locked balances (settlement tokens and YES/NO shares)
for each market. The seat count is the protocol constant 8,193 and
determines maximum concurrent traders. Balances are debited and credited
directly by the matching engine on every fill, cancel, and settlement operation.
See Free Funds for the on-chain deposit/withdraw mechanism.
Taker#
A trader whose order matches immediately against resting orders. Takers pay fees.
Taker Fee#
The per-fill fee paid by the taker. Seesaw uses a linear fee with no cap: fee_bps(p) = taker_fee_coefficient_bps × (10_000 − p) / 10_000. With the shipped coefficient taker_fee_coefficient_bps = 400, the fee is 2.00% at a price of 0.50, 3.60% at 0.10, and falls toward 0 as prices approach 1.00 (p is in bps in the formula). The fill fee is ceiling(fill_notional × coefficient × (10_000 − p) / 10_000²), with no intermediate rounding of the rate. Makers pay 0 and may earn a rebate.
The shipped allocation is 45% protocol / 5% creator / 5% referral / 5% builder / 40% maker rebate. Eligible maker fills credit the maker's free quote balance; ineligible maker allocation and rounding dust go to protocol, as do the referral allocation without an eligible referrer and the builder allocation when the order names no approved builder. See fee constants and allocation details.
<!-- src: program/src/logic/fee.rs:187 FeeSplit5::TARGET -->Tick#
The minimum price increment for orders. Default: 100 bps (1%).
Tick Rounding#
The process of rounding order prices to valid tick levels. Bids round down, asks round up.
Trade#
An executed match between a bid and an ask.
Trading Window#
The time period during which orders can be placed, from the market's landed creation time through its stored end timestamp.
Treasury Shard#
One of eight sharded escrow SPL Token accounts (["seesaw", "referrer_treasury", &[shard_index]], shard_index ∈ [0, 8)) that accumulate the referral share of taker fees. Sharding spreads write contention so concurrent fee-routing transactions across different markets do not all serialize on the same account. Referrers are associated with a referral shard when their ReferrerEarningsAccount is initialized; protocol treasury recipients are selected separately per fee-paying order via protocol_treasury_index. See Referrer Treasury for derivation details.
Trustless SDK#
The @seesaw/core SDK is designed to be trustless: it constructs transactions
locally without relying on a backend API to sign on behalf of the user. All
instruction data, PDA derivations, and account resolution happen client-side;
the user's wallet signs the final transaction. This means integrators can verify
the complete transaction before submission. The SDK bundles the
EnsureTraderLedgerSpace prelude and Pyth pull-price posting automatically.
Treasury#
The protocol account that holds accumulated fees and funds crank rewards.
U#
UP#
The market outcome when the end confidence interval is strictly above the start interval: end_low > start_high. DOWN requires end_high < start_low; touching, overlapping, equal, or unusable intervals resolve to neutral EXPIRED and pay both sides at 50%.
V#
Vault#
The token account holding all collateral for a market. Owned by the market PDA.
W#
Wallet#
A user's Solana account holding their keypair. Used to sign transactions.
Wash Trading#
Trading with yourself to create fake volume. Prevented by self-trade prevention.
Y#
YES Share#
A share that pays out 1 USDT if the market resolves to UP (price increased).
Symbols and Formulas#
Price Conversion#
Clients always quote the named outcome's own price p, and the program stores
exactly that price in the outcome's own lane (no complement for NO):
| outcome | intent | stored side | canonical book | resource flow |
|---|---|---|---|---|
| YES | BUY | BuyYes 1 | BID @ p | locks p·q, receives YES |
| YES | SELL | SellYes 2 | ASK @ p | escrows YES, receives p·q |
| NO | BUY | BuyNo 3 | BID @ p | locks p·q, receives NO |
| NO | SELL | SellNo 4 | ASK @ p | escrows NO, receives p·q |
Market ID#
t_start = landed CreateMarket Clock timestamp
t_end = t_start + duration_seconds
Collateral#
collateral = price_bps * quantity / 10,000
Solvency Invariant#
vault_balance >= lifecycle_share_liability + accumulated_creator_fees + accumulated_referral_fees + active_spline_commitment
Before resolution the share-liability term is the conservative maximum side; after resolution it follows the authenticated payout vector.
For a resolved leg, its aggregate integer payout is:
aggregate_leg_payout = floor(total_leg_supply * authenticated_payout_numerator / 10,000)
CloseMarket blocks while any aggregate_leg_payout > 0. It permits residual
entire-leg supply whose payout floors to zero, including dust under a nonzero
numerator.
Fee Calculations#
Linear taker fee, no cap:
fill_fee = ceiling(fill_notional * taker_fee_coefficient_bps * (10_000 - p) / 10_000^2)
taker_fee = sum(fill_fee)
creator_fee = floor(taker_fee * default_creator_fee_bps / 10_000)
referral_fee = floor(taker_fee * referral_share_bps_of_fee / 10_000)
builder_fee = floor(taker_fee * min(builder_share_bps, approval.max_builder_bps) / 10_000)
(0 when the order names no approved builder)
maker_rebate = actual credited eligible maker rebates
protocol_fee = taker_fee - creator_fee - referral_fee - builder_fee - maker_rebate
The five configured shares are bps of the fee and MUST sum to exactly 10_000:
protocol_fee_bps + default_creator_fee_bps + referral_share_bps_of_fee + builder_share_bps + maker_rebate_share_bps == 10_000
See shipped allocation constants. The referral amount above is reallocated to protocol without an eligible referrer. Creator/referral allocations use the aggregate fee; ordinary book rebates floor each eligible fill, while spline rebates use cumulative floor deltas. The protocol receives the exact remainder, including dust and unused maker allocation.
<!-- src: program/src/logic/fee.rs:349 apply_split4_with_slack --> <!-- src: program/src/logic/fee.rs:187 FeeSplit5::TARGET -->Abbreviations#
| Abbreviation | Meaning |
|---|---|
| BPF | Berkeley Packet Filter |
| bps | Basis points |
| CU | Compute units |
| IOC | Immediate-Or-Cancel |
| PDA | Program Derived Address |
| RPC | Remote Procedure Call |
| SOL | Solana's native token |
| SPL | Solana Program Library |
| USDT | Tether (USD₮) |
Next Steps#
- Review Error Codes for troubleshooting
- See Constants for protocol values