Concepts
How it works
Moxie turns an event on a prediction market into a perpetual contract you can trade continuously, with fully collateralized risk and permissionless upkeep.
The big picture#
Source market (Panta)
A yes/no event with its own order book and price, e.g. “Saka 7+ points, GW6”.
Moxie oracle
An off-chain reporter reads the source price and posts it on-chain, together with the event’s close time and lifecycle schedule.
Percolator engine
Holds every portfolio’s collateral and positions, enforces margin, charges funding and settles PnL. All USDC sits in one program-owned vault.
Moxie matcher
Quotes prices for the liquidity provider (LP) around the protected mark. Every trade fills against the LP’s portfolio.
Keepers
Permissionless bots that “crank” the market: bring prices and funding up to date and run the end-of-market steps.
Indexer
Reads the chain and serves markets, charts, fills and portfolios to the website and the API.
Three prices#
Each market has three related prices. They usually sit within a cent or two of each other.
| Price | What it is | Used for |
|---|---|---|
| Source index | The latest price from the source market, as posted by the oracle. | Anchoring the mark, and funding. |
| Protected mark | The source index plus a time-averaged premium. It moves gradually, so one sudden quote or trade can’t trigger liquidations. This is the “Price” shown across the site and the main line on the chart. | Margin, estimated PnL, and closing positions at hard-flat. |
| Moxie price | Where you actually trade: the liquidity provider’s quote around the mark, adjusted for spread, order size and inventory. Order flow moves it. | Your fill. The order ticket shows it as Est. fill price. |
Trading against the liquidity provider#
Moxie has no order book. When you trade, the Percolator engine calls the Moxie matcher, which prices your order for the liquidity provider’s portfolio and the trade settles immediately between the two portfolios. The matcher’s price depends on:
- Base spread: a small fixed distance from the mark.
- Size: bigger orders get a slightly wider price.
- Inventory: if the LP already holds a lot of one side, prices lean to encourage trades that rebalance it.
- Limits: a maximum size per fill and a maximum total LP position. Orders beyond them are refused, and the ticket asks you to trade smaller.
Your order carries a limit price, so the transaction fails rather than fill worse than you agreed to.
Collateral and margin#
Your portfolio is an on-chain account owned by the Percolator program. It records your USDC collateral, realized PnL, funding paid and received, and your position in each market. Before any trade that adds risk, the engine checks that your equity covers the margin of every position you hold.
Prices can jump to $0 or $1 on news, so margin covers the worst case: a long needs its price plus $0.05 per contract, a short needs $1 minus the price plus $0.05 (or the price, if larger). As a result no position can lose more than the collateral behind it.
Funding#
Funding keeps Moxie anchored to the source market. The gap between the two is measured in absolute price terms and averaged over time; longs pay shorts when Moxie is above the source, shorts pay longs when it is below. Payments accrue every slot and are applied whenever the market is cranked, so they show up in your portfolio balance without any action from you.
Keepers and cranks#
Percolator updates markets lazily. A crank is a transaction that brings a market up to date: it accrues funding, refreshes prices and runs any lifecycle step that is due. Anyone can send one, and Moxie runs a keeper that cranks continuously. If a market falls behind, trades that add risk wait until it catches up — that’s the “market data is updating” message you may occasionally see.
Lifecycle and settlement#
Each market is listed with a schedule tied to the source event’s close time:
| Phase | Default timing | Effect |
|---|---|---|
| Active | Listing → close − 30 min | Normal trading. |
| Restricted | Close − 30 min | The matcher lowers its per-fill and inventory limits. |
| Reduce only | Close − 10 min | Only trades that reduce a position are accepted. |
| Hard-flat | Close − 1 min | Keepers close every remaining position at the protected mark. |
| Resolved | After the source resolves | The market is closed; remaining accounting is finalized. |
Why close before the outcome?
A perpetual has no expiry, but the event behind it does. Closing everyone at the protected mark just before the event closes means no one is exposed to the final jump to $0 or $1, and the LP and traders settle at a fair, manipulation-resistant price.
On-chain programs (devnet)#
| Program | Address |
|---|---|
| Percolator engine | 9GnPynrGbmQqQw8715neTB6xqeEw7ZcpRTHCT3AEDM4e |
| Moxie matcher | H6z6Z5KSQtXj7sYvqX7oCwskBuhWvUDDB8KGNqeuNWXS |
| Moxie oracle | dLAPcvtkqAtYHh6QFogmm8E3ovCeZtoWvtsWJFP8AQ3 |
| Market group | AihBkr17D9hSSyWRLK5cetZC2P5xMVbft112bHjZWgc2 |
| Test USDC mint | 5yV4TPjnwvAGTmqJdjeM7rFZUVcrxSfPVVK87YNK3NRS |