Treasury and Fee Split#
How Seesaw's taker fee curve and five-way allocation work. The numeric defaults live in Constants. This complements referrals and the lifecycle overview.
The fee curve#
Seesaw uses a linear taker fee that falls with the fill price in the taker's own outcome lane. Resting makers pay no taker fee and receive a rebate when their fills meet the configured eligibility gate.
fee_bps(p) = taker_fee_coefficient_bps × (10_000 − p) / 10_000
fee_atoms = ceil(notional × taker_fee_coefficient_bps × (10_000 − p) / 10_000²)
notional is the fill's quote amount in the taker's lane, already rounded, and
p is the fill price in bps in that lane.
| Parameter | Default | Meaning |
|---|---|---|
taker_fee_coefficient_bps | 400 | Slope: the fee is 4% of notional times (1 − p) |
The coefficient is admin-tunable up to 10,000 bps. At the default the midpoint fee is 2.00%, as under the former curve, but there is no cap: cheaper fills pay more.
Effective rate by fill price#
| Fill price | Taker fee rate |
|---|---|
| 0.10 | 3.60% |
| 0.30 | 2.80% |
| 0.50 | 2.00% |
| 0.80 | 0.80% |
| 0.90 | 0.40% |
| 0.95 | 0.20% |
| 0.99 | 0.04% |
Under the shipped coefficient, a fill at p = 0.50 pays 2.00% of its notional; a fill at p = 0.95 pays 0.20%.
Example calculation#
Trade: Buy 100 YES @ 0.50 (5000 bps), notional 50 USDT
fee_bps(5000) = 400 × 5000 / 10000 = 200 (2.00%)
Taker fee: 50 × 0.02 = 1.00 USDT
→ Protocol: 0.50 | Creator: 0.05 | Referral: 0.05 | Maker: 0.40 USDT
Trade: Buy 100 YES @ 0.95 (9500 bps), notional 95 USDT
fee_bps(9500) = 400 × 500 / 10000 = 20 (0.20%)
Taker fee: 95 × 0.002 = 0.19 USDT
→ Protocol: 0.095 | Creator: 0.0095 | Referral: 0.0095 | Maker: 0.076 USDT
Both examples assume an eligible referrer and maker, with the shipped split. Amounts use six-decimal settlement-token units.
The five-way allocation#
The shipped split allocates fees as follows. This page focuses on routing the protocol leg; actual allocations use the current config.
<!-- src: program/src/logic/fee.rs:187 FeeSplit5::TARGET -->| Slice | Recipient | Routing |
|---|---|---|
| 45% | Protocol treasury | One of 8 admin-configured SPL token accounts (this doc) |
| 5% | Market creator | Accumulated in the market's accumulated_creator_fees field |
| 5% | Referrer | Retained in the market vault until RollupCurrencyReferralFees (0x51) moves it to the referrer's bound treasury shard |
| 5% | Approved builder | Transferred to the builder's settlement-token account during the order, when the order names an approval |
| 40% | Eligible maker | Credited to TraderLedger.quote_free; withdrawn with WithdrawFunds |
Unused referral, builder and maker allocations go to the protocol. Split-rounding dust also goes to the protocol so the allocations exactly equal the collected fee.
The percentages above are the target allocation (FeeSplit4::TARGET) with
which a new ConfigAccount is initialized. The live split is governance state
that UpdateFeeConfig can retune within source bounds, so read the deployed
config rather than assuming these values. The next section uses the field names
(protocol_bps, creator_bps, referral_bps, maker_bps) for that reason.
Fee types at a glance#
Every charge the program makes on trading, who pays it, who receives it, and when the money moves. Rows 2 to 5 are the four slices of the one taker fee in row 1; rows 6 and 7 are separate incentives. Solana network fees, priority fees, and account rent are outside the protocol and not listed.
| # | Fee or payment | Payer | Payee | Formula | Settles | Rounding |
|---|---|---|---|---|---|---|
| 1 | Taker fee (the total) | The taker, on the part of an order that fills against the book. Resting makers pay none. | Split into rows 2 to 5 | ceil(notional × taker_fee_coefficient_bps × (10_000 − p) / 10^8), p = fill price in bps | At the fill, in the placing transaction | Rounds up, independently for each fill. |
| 2 | Protocol allocation | Out of the taker fee | One of the 8 protocol treasury recipients (index chosen per order) | fee − creator − referral − maker (the remainder) | At the fill | Receives all rounding dust, ineligible maker shares, and forfeited referral shares. |
| 3 | Creator allocation | Out of the taker fee | The market creator | floor(fee × creator_bps / 10_000) | Accrues in the market's accumulated_creator_fees at the fill. Paid by ResolveMarket or ExpireMarket if the creator's token account is valid; otherwise deferred and paid by ClaimCreatorFees | Rounds down. |
| 4 | Referral allocation | Out of the taker fee | The taker's referrer, when the taker has an active referral binding | floor(fee × referral_bps / 10_000) | Stays in the market vault as a pending amount. RollupCurrencyReferralFees (anyone) moves it to the referrer's treasury shard. The referrer then signs ClaimCurrencyReferrerEarnings | Rounds down. With no binding or an expired binding it goes to the protocol at the fill. |
| 5 | Maker rebate | Out of the taker fee | The resting maker, if its order met the resting-age gate | Per fill: floor(fill_fee × maker_bps / 10_000) | At the fill, into the maker's TraderLedger.quote_free. It reaches the wallet only after WithdrawFunds | Rounds down per fill. An ineligible fill's share goes to the protocol. |
| 6 | Expired-order reclaim bounty | The maker whose order expired, deducted from the refund | The caller of ReclaimExpiredOrder who supplies a settlement token account | min(refund × 10 / 10_000, 100_000 base units), at least 1 for a non-zero refund | At the reclaim. Bid-side, before-resolution reclaims only | Integer division, with the floor and cap shown. |
| 7 | Lifecycle (closer) reward | The market account's SOL balance, funded at creation | The caller of a lifecycle instruction (create, snapshot, resolve, expire) | A fixed lamport amount per call, up to CLOSER_REWARDS_PER_MARKET calls | When the instruction succeeds. Paid in SOL, not in the settlement token | None. Never debits below the market's rent floor. |
Sources: program/src/logic/fee.rs (compute_fee_amount_at_price,
apply_split4, FeeSplit4::TARGET), program/src/processor/cancel_order_trait.rs
(RECLAIM_BOUNTY_BPS, RECLAIM_BOUNTY_MAX), program/src/processor/shared/settlement.rs
(pay_closer_reward), and program/src/processor/claim_creator_fees.rs. Constants
are in Constants. The closer reward
amount and count are in Automation.
Non-obvious notes#
- Shares apply to the fee, not the notional. Each
*_bpsfield is a share of the collected taker fee. The four shares sum to 10,000 bps. - The charged fee keeps the fractional rate. The formula does not floor the
bps rate first; it rounds up once on the exact amount, per book fill or per
cumulative spline epoch. Setting
taker_fee_coefficient_bpsto zero turns the taker fee off. - Only the taker pays. A resting order that fills pays no fee, and may earn a rebate. Exiting inventory as a taker pays the same curve as entering.
- Two legs are not paid at trade time. The referral leg waits for a rollup and a
claim. The creator leg waits for the market to reach a terminal state, and
ClaimCreatorFeesis rejected while the market is still trading. - The referral leg has a deadline. After the seven-day post-resolution grace,
closing a settled position clears any unrolled pending referral amount and
reclassifies it as creator fees (
ReferralPendingForfeited). It does not go to the protocol. See Referrals. - Rounding dust goes to the protocol, with two exceptions that are not fee dust. Residual vault dust at market teardown goes to the creator (Claiming winnings). The maker leg is the sum of per-fill floors, so it can be below the aggregate maker share. The difference goes to the protocol; the legs still sum to the collected fee.
- The maker leg needs a resting-age gate. The shipped minimum resting age is 10 seconds, and governance can set it up to the 3,600-second ceiling. A fill against a younger order credits no rebate.
- Maker rebates are not in the trades API.
GET /tradesexposestaker_fee,fee_protocol,fee_creator, andfee_referral; the three parts do not sum to the total when a maker rebate was paid. UseMakerRebateCreditedevents for the maker leg (Monitor a trading bot). - Fee policy can change between quote and fill. Pin the fee epoch
(
--expected-fee-epochin the CLI) where a strategy depends on the quoted fee. Fee updates are rate-limited to one per 3,600 seconds. - The close residual is not a treasury inflow. When any market closes, its whole vault residual (rounding dust and any donations) goes to the market creator, never to a treasury recipient.
Eight treasury recipients, not one#
The protocol stores treasury_recipients: [Pubkey; 8] directly in
ConfigAccount. Each entry is a plain SPL Token v1 account address owned
by whoever the protocol authority designates — typically a multisig, a
treasury custody account, or a routing wallet.
These addresses are not PDAs the program derives. They're regular SPL token accounts the admin pre-creates and registers. The admin controls them; the program just routes funds to them.
| Field | Type | Notes |
|---|---|---|
config.treasury_recipients[0..8] | [Pubkey; 8] | Eight SPL token accounts, mint = config.default_settlement_mint, all pairwise distinct, all non-zero |
Why 8?#
The same Solana write-contention argument as the referrer treasury shards:
- Solana parallelizes transactions only when their writable accounts don't overlap. If every trade in the protocol credited a single treasury account, every trade would serialize through that account.
- Eight slots let the admin spread receipts across distinct accounts so concurrent trades on different markets don't conflict.
- Eight is small enough that the indexer and any downstream reconciliation job can trivially enumerate all of them.
Unlike the referrer shards (which the program derives deterministically), the protocol treasury recipients are admin-chosen. This gives the authority flexibility — they can split across cold storage / hot wallets / operating accounts / dedicated fee accounts however they want.
Per-trade recipient selection#
When a taker places an order via PlaceOrder, the client passes
args.protocol_treasury_index: u8 to choose which of the 8 recipient
accounts is preferred for this trade's protocol allocation.
place_order validates the index before crediting any fee:
protocol_treasury_index < 8(out-of-range is rejected,TreasuryIndexOutOfRange).- The supplied account must match a recipient in the live config. The requested
index is preferred; if the supplied account matches a different approved
slot, that slot becomes the effective index. An account outside the approved
set is rejected with
TreasuryRecipientMismatch. - That account must be a valid SPL Token v1 account on the settlement mint. (Already enforced when the recipient set is registered, but re-validated defense-in-depth.)
The client supplies a preferred index and a recipient account. The loader validates membership and uses the effective slot; a recipient outside the registered list cannot receive the protocol allocation.
<!-- src: program/src/validation/loaders.rs:788 effective_treasury_index -->How does the client pick the index?#
Clients (web, mobile, SDKs) typically use a round-robin or random selection
across [0, 8) to avoid all clients hitting the same shard. The protocol
takes no position — any valid index is accepted.
Replacing the recipient set#
The admin can replace all 8 recipients atomically via the
UpdateTreasuryRecipients (0x1D) instruction.
Accounts:
0. Config PDA (writable)
1. Authority (signer, must match config.authority)
2-9. New recipient accounts (8 SPL Token accounts)
Validation#
| Check | Enforcement |
|---|---|
| Authority is the config authority | Signer must equal config.authority |
| Rate limit | TREASURY_UPDATE_RATE_LIMIT_SECONDS = 3600 (1 hour) between updates |
| Exactly 8 accounts supplied | Rejects fewer or more than 8 recipient accounts |
| Every account is owned by SPL Token program | Token-account ownership check |
Every account's mint matches config.default_settlement_mint | Token-account deserialize + mint comparison |
| All 8 are pairwise distinct | Setter rejects duplicate pubkeys |
| No zero pubkeys | Setter rejects zero/default pubkeys |
Atomicity#
The update is atomic — either all 8 entries are replaced and the new
last-update timestamp is recorded, or the entire transaction reverts. There's
no partial state where some indices point at the old set and some at the
new. This means the next PlaceOrder after a successful
UpdateTreasuryRecipients either uses the full old set or the full new
set, never a mix.
Rate limit#
A 1-hour cooldown (TREASURY_UPDATE_RATE_LIMIT_SECONDS = 3600) sits
between successive updates. This:
- Bounds how fast the recipient set can churn under an active key.
- Gives the indexer and any treasury-monitoring job time to ingest the new set before it changes again.
- Limits damage if the authority key is compromised — an attacker can only rotate the recipients once per hour, not in a tight loop.
Invariants#
Treasury recipient invariants are catalogued in
security/invariants.md as INV-FEE-T1
through INV-FEE-T5. In summary: exactly 8 recipients are always stored,
all are valid SPL token accounts on the settlement mint, all are pairwise
distinct and non-zero, trades only credit a recipient validated against
the live config, and the recipient set is replaced atomically with a 1-hour
rate limit. The referral invariants (INV-REFERRAL-T1..T3) are covered
in referrals.md § Invariants.
Operational considerations (for the config authority)#
Setting recipients up#
A typical mainnet setup:
- Pre-create 8 ATAs (associated token accounts) for the settlement mint, owned by the treasury wallet(s) the protocol authority controls.
- Call
UpdateTreasuryRecipientsonce during deployment to register them. - Document the mapping (which index points where) externally — this mapping is not stored on-chain beyond the addresses themselves.
Rotating a single recipient#
There's no "rotate index N" — the only way to change the set is to call
UpdateTreasuryRecipients with all 8 new addresses. To rotate just index
N, the admin re-sends the existing 7 addresses unchanged plus the new
address at position N.
Recipient closed / lost#
If one of the 8 SPL token accounts becomes unusable (closed, owner lost
the keys, etc.), trades that pick that index will fail at the SPL Token
transfer step. The fix is UpdateTreasuryRecipients replacing that index.
Clients that observe TreasuryRecipientMismatch or token-transfer
failures on a specific index should drop that index from their selection
rotation and surface the issue to the operator.
Consolidating earnings#
Each recipient accumulates settlement-token transfers from trades. To consolidate, the recipient's owner just sweeps the SPL token balance to wherever they want. There's no on-chain "claim" — the recipient is the SPL token account; whoever controls it controls the funds.
Related docs#
how-it-works/referrals— the referral allocationhow-it-works/README§ Fee Structure — fee curve and allocation overviewhow-it-works/flow-of-funds— where every fee slice fits in the overall money flowfor-traders/referrals-and-fees— user-facing fee explanation- The multi-fee-recipients design rationale in the repository specification documents
security/invariants— INV-FEE-T1..T5 catalog