Skip to main content

Overview

PMX uses a Conditional Token Framework (CTF) inspired by Polymarket. This model ensures the market is always 100% collateralized and provides a clean mechanism for trading binary outcomes. For any binary prediction market (e.g., “Will X happen?”), there are exactly two outcomes: YES and NO. The CTF model represents these as Token-2022 tokens with the Market PDA as a permanent delegate:
  • 1 YES token = Pays $1 USDC if the outcome is YES, $0 if NO
  • 1 NO token = Pays $1 USDC if the outcome is NO, $0 if YES
Since exactly one outcome will occur:
1 YES + 1 NO = $1 USDC (always). This invariant is the foundation of the entire system.

Split: Creating Outcome Tokens

Users split collateral (USDC) into outcome tokens via an on-chain instruction:
SPLIT: 1 USDC → 1 YES token + 1 NO token

Example:
  User calls split(100) on-chain.

  Before: 100 USDC in wallet, 0 YES, 0 NO
  After:  0 USDC, 100 YES, 100 NO

  The 100 USDC transfers to the Market vault.
  The Market PDA mints 100 YES + 100 NO tokens to the user.
Why split? To trade on the orderbook, users need outcome tokens. A user who wants to sell YES tokens must first acquire them by either:
  1. Splitting USDC (creates both YES and NO)
  2. Buying YES tokens from another user on the orderbook

Merge: Reclaiming Collateral

Users merge outcome tokens back into collateral:
MERGE: 1 YES token + 1 NO token → 1 USDC

Example:
  User has 50 YES and 80 NO tokens.
  User calls merge(50) on-chain.

  Before: 0 USDC, 50 YES, 80 NO
  After:  50 USDC, 0 YES, 30 NO

  The Market PDA burns 50 YES + 50 NO tokens.
  The vault transfers 50 USDC back to the user.
Why merge? Users can exit without needing a counterparty. If you hold both YES and NO tokens, you can always merge them back to USDC regardless of market liquidity.

Redeem: After Market Resolution

When a market is resolved, winning tokens can be redeemed for $1 USDC each:
REDEEM (if YES wins): 1 YES token → 1 USDC
REDEEM (if NO wins):  1 NO token  → 1 USDC

Example (YES wins):
  Market resolves with outcome = YES.
  User has 100 YES tokens and 20 NO tokens.

  User calls redeem(100) with their YES tokens.

  Before: 0 USDC, 100 YES, 20 NO
  After:  100 USDC, 0 YES, 20 NO

  The 100 YES tokens are burned.
  User receives 100 USDC from the vault.
  The 20 NO tokens are now worthless.

Price Discovery

On the orderbook, users trade outcome tokens against USDC. Prices are quoted in basis points (bps) where 10,000 bps = $1.00:
Price (bps)Price ($)Implied Probability
6,000$0.6060%
5,000$0.5050%
8,500$0.8585%
The price of a YES token represents the market’s implied probability of YES occurring.

Trading Example

Scenario: Alice thinks “Will Bitcoin hit $100K by EOY?” is 70% likely. Current YES price is $0.60.
1. ALICE BUYS YES

   Alice has 100 USDC in her smart wallet.
   She places a BUY order: 100 YES tokens @ $0.65.

   Bob has 100 YES tokens (from a previous split).
   He places a SELL order: 100 YES tokens @ $0.60.

   Orders match at $0.60 (maker's price).

   Settlement (on-chain):
   — 60 USDC: Alice's smart wallet → Bob's smart wallet (CPI transfer, Exchange PDA signs)
   — 100 YES tokens: Bob → Alice (via Market PDA permanent delegate)

   After:
   — Alice: 40 USDC + 100 YES tokens
   — Bob: 160 USDC + 0 YES tokens

2. MARKET RESOLVES AS YES

   Alice redeems 100 YES tokens → receives 100 USDC from vault.

   Alice P&L: Paid 60, received 100 = +$40 profit
   Bob P&L: Received 60 for tokens worth 100 = -$40 loss

Complementary Matching

The engine supports two additional matching modes beyond direct (buy vs sell):

Complementary (Buy YES + Buy NO)

When a Buy YES order and a Buy NO order have prices that sum to ≥ $1.00, they can be matched:
Buy YES @ $0.65 + Buy NO @ $0.40 → Match!
(0.65 + 0.40 = 1.05 ≥ 1.00)

Both buyers deposit USDC into the vault.
Vault mints YES tokens to the YES buyer, NO tokens to the NO buyer.

Sell Complementary (Sell YES + Sell NO)

When a Sell YES order and a Sell NO order have prices that sum to ≤ $1.00, they can be matched:
Sell YES @ $0.55 + Sell NO @ $0.40 → Match!
(0.55 + 0.40 = 0.95 ≤ 1.00)

Both sellers' tokens are burned.
Vault sends USDC to both sellers.

Why This Model?

Always Fully Collateralized

Every YES + NO pair is backed by exactly 1 USDC. Zero counterparty risk.

No Market Maker Required

Users split/merge to create liquidity. The platform doesn’t need to provide tokens.

Clean UX

Users think in “buy YES” or “sell YES” without understanding the underlying mechanics.

Arbitrage-Free

If YES + NO prices drift from $1, arbitrageurs profit by correcting it.

Program Instructions Summary

InstructionWhat It DoesToken Flow
splitUSDC → YES + NOUSDC from wallet → vault; YES + NO minted to user
mergeYES + NO → USDCYES + NO burned; USDC from vault → user
settle_fillDirect buy/sell matchUSDC: buyer → seller; tokens: seller → buyer
settle_complementaryBuy YES + Buy NO matchUSDC: both buyers → vault; tokens minted to each buyer
settle_sell_complementarySell YES + Sell NO matchTokens burned from both sellers; USDC: vault → both sellers
redeemWinning tokens → USDCWinning tokens burned; USDC from vault → user