Thassa.

Protocol

Markets & order book

Every Thassa market is a binary YES/NO order book priced in cents. A share pays $1 to the winning side. Price is probability: YES at 62¢ is the book saying 62%.

The pricing model

  • An order is always “buy side at limit price p cents for shares shares” — there is no separate sell verb; exiting a YES position means buying NO (or redeeming after settlement).
  • Limit prices are integers 1..99 cents.
  • Escrow: a YES buyer at p escrows p × shares cents; a NO buyer at q escrows q × shares cents (all in payment-token base units).
  • Crossing: buy YES @ p matches resting buy NO @ q whenever p + q ≥ 100 — together the pair fully collateralizes the $1 payout.

Matching rules

Matching happens at order placement: the incoming order takes the best crossing price levels first, then any remainder rests on the book as a maker order.

  • Price-time priority. Better-priced resting orders fill first; within a price level, first in, first filled (FIFO).
  • Execution at the maker’s price. The resting order’s level sets the execution price — a taker’s aggressive limit only widens what can cross; it never worsens the fill.
worked match
Resting (maker):  buy NO  @ 40¢ × 500 shares     — the maker
Incoming (taker): buy YES @ 65¢ × 300 shares     — crosses: 65 + 40 ≥ 100

Execution: 300 shares AT THE MAKER'S LEVEL — taker pays 100 − 40 = 60¢/share
  taker escrow used:  300 × $0.60 = $180  (+ taker fee)
  maker escrow used:  300 × $0.40 = $120
  → each matched pair holds $1.00/share, fully collateralized

Under the hood the book is gas-friendly: per market and side, a uint128 price-level bitmap gives O(1) best-price discovery, and each level holds a FIFO queue of packed orders.

Market lifecycle

Markets move through six one-word states, used verbatim across the app, the API, and these docs:

StateMeaning
PENDINGCreation or settlement transaction in flight.
OPENLive; the creator’s opening bet has not been taken yet. Creator-side microcopy: “You’re committed. Waiting for someone to take your bet.”
MATCHEDFirst fill against the creator’s opening liquidity landed (“Your bet was taken.”). Trading continues.
SETTLINGSettlement query running through the oracle pipeline.
SETTLEDYESOutcome final, direction recorded (YES or NO). Winners redeem $1/share.
VOIDInvalidated via the owner-only escape hatch; all deposits refundable.

Order states

StateMeaning
SIGNINGAwaiting the user’s signature.
QUEUEDAccepted; waiting in a relayer batch.
RESTINGOpen on the book as a maker order.
PARTIALPartially filled; remainder still resting.
FILLEDFully filled.
CANCELEDCanceled by the maker (unfilled remainder refunded).

Creating a market

Market creation is free — no protocol fee — but the creator’s initial order must deposit at least $1 of capital. That opening bet is the market’s first liquidity, and the creator is committed to it: the market shows OPEN until someone takes the other side, then MATCHED. Both the question and the structured settlement query are stored onchain as public strings at creation.

Fees

Kalshi-style, taker-side only. Makers pay nothing. The fee on each match, at execution price p (the maker’s price, in cents):

taker fee
fee = ceil(7% × shares × p × (100 − p) / 10000)   // dollars, p = execution price in cents
    = ceil(takerFeeBps × shares × p × (100 − p) / 10000 / 10000)   // takerFeeBps = 700

The fee is quadratic in uncertainty — largest at 50¢, vanishing toward 1¢/99¢ — and is deducted from the taker’s escrow, rounded up at the token’s base unit.

Worked examples

Fillp × (100−p) / 10000Fee mathTaker fee
100 shares @ 50¢0.250.07 × 100 × 0.25$1.75
100 shares @ 62¢0.23560.07 × 100 × 0.2356$1.6492
10 shares @ 95¢0.04750.07 × 10 × 0.0475$0.03325
1 share @ 99¢0.00990.07 × 1 × 0.0099$0.000693 (ceils to 693 base units at 6 decimals)

Where fees go

  • 10% of every collected fee accrues to the market creator (claimable via claimCreatorFees).
  • 5% goes to the affiliate — the post whose market widget routed the order (affiliatePostId; 0 = none, in which case the share goes to the protocol).
  • The remainder goes to the protocol vault.

Flat fees

ActionFeeNotes
Market creationFreeRequires a ≥ $1 initial order.
Settlement trigger$0.05Paid by whoever calls settleMarket; funds the hub bid. Re-triggerable if the bid is cancelled or expires.
Withdrawal$0.10 flat (default, owner-configurable)Charged on redeem/withdraw transfers out; sized ≈ market-creation gas.

Settlement & redemption

  1. Anyone calls settleMarket(marketId) and pays the $0.05 trigger. Status → SETTLING.
  2. The oracle pipeline resolves the outcome — see Settlement & sources. Status → SETTLEDYES.
  3. Winners call redeem(marketId) for $1/share, minus the flat withdrawal fee. Unmatched or resting deposits are refundable any time via withdraw.

Fee constants (owner-settable)

takerFeeBps = 700 · creatorFeeShareBps = 1000 · affiliateFeeShareBps = 500 · withdrawalFlatFee default $0.10 · settlementFee default $0.05.