Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Clearing & Settlement

The clearing module turns fills produced by the matching engine into balance and position changes. All of it completes atomically within the same block — there is no separate settlement cycle.

Settlement by instrument type

TypeSettlement
Spotsettles on fill — the buyer's and seller's spot balances are swapped directly
Perpsper-fill update of the position (size, average entry price) and realized PnL; funding continues to accrue against the open size and is settled on the funding cycle
Outcomeshares trade as synthetic assets; at market resolution they are redeemed to the margin asset at 0 or 1

See TIP — Improvement Proposal for the full per-type semantics.

Fees

Fees are charged at settlement:

  • Each user is matched to a single fee tier based on their 14-day rolling trading volume, which combines weighted perpetual and spot volume. The matched tier then supplies four rates: perps maker/taker and spot maker/taker. Outcome instruments use their own type-specific fee schedule instead of the perpetual / spot tier ladder.
  • When no tier ladder is configured, the instrument's own base maker/taker rates apply.
  • Referral system:
    • a referred user pays a discounted fee (billed at 95% of the standard rate);
    • the referrer earns a rebate on those fees (default 10%);
    • the discount has a per-address volume cap.
  • Remaining fees accrue to the protocol fee account.

Realized vs. unrealized PnL (perps)

  • Realized PnL is booked when a position is reduced or closed — the difference between the average entry price and the fill price, times the closed size.
  • Unrealized PnL is marked continuously against the mark price and feeds the margin / health calculation (see Margin System).
  • Funding is accrued per position and settles into margin (isolated) or account equity (cross) — see Risk Engine § Funding.