[Polymarket] Mechanics of Trading Probability

4 min read Original article ↗

Polymarket is a decentralized prediction market where users trade on real-world event outcomes. Unlike traditional betting, you trade against other users, not the house.

Each market has two outcome tokens: YES and NO shares. These are separate assets that trade independently.

Each share pays $1 if correct, $0 if wrong. If you buy YES at $0.65 and Max wins, the share pays $1 ($0.35 profit). If Max loses, shares are worth $0.

Buying NO ≠ Selling YES.

  • BUY YES: Pay $, receive YES tokens

  • SELL YES: Sell owned YES tokens, receive $

  • BUY NO: Pay $, receive NO tokens

  • SELL NO: Sell owned NO tokens, receive $

This distinction is enforced at the smart contract level.

polymarket/ctf-exchange:OrderStructs.sol#L49-L55

Unlike stocks, tokens are minted on demand. When a YES buyer and NO buyer match, their combined collateral (USDC) creates new shares.

The exchange (smart contract) determines the match type.

polymarket/ctf-exchange:Trading.sol#L275-L279

The available match types are

polymarket/ctf-exchange:OrderStructs.sol#L57-L65

  • MINT: Two buyers (YES vs NO) → mint new tokens from collateral.

  • MERGE: Two sellers (YES vs NO) → burn tokens, return collateral. Every YES + NO pair is backed by exactly $1.

  • COMPLEMENTARY: Normal trade; tokens transfer between wallets.

Minting uses the Gnosis Conditional Token Framework to split collateral.

polymarket/ctf-exchange:AssetOperations.sol#L38-L45

splitPosition takes USDC collateral and creates an equal amount of YES and NO tokens. Traders set prices via limit orders; there is no “initial offering”.

MERGE reverses this by burning tokens to return collateral.

polymarket/neg-risk-ctf-adapter:NegRiskAdapter.sol#L155-L167

Market makers primarily initiate merges to arbitrage price deviations. Regular users typically hold until resolution or sell to other traders.

The exchange enforces a crossing rule: for a MINT (two BUY orders - YES and NO), prices must sum to at least $1.

polymarket/ctf-exchange:CalculatorHelper.sol#L69-84

The diagram below shows three possible scenarios.

If prices sum to less than $1, collateral is insufficient for minting. Orders wait in the book, creating a spread. If prices exceed $1, surplus collateral creates an arbitrage opportunity.

A CLOB (Central Limit Order Book) matches bids (buys) against asks (sells) by price and time priority. Polymarket operates its own hybrid-decentralized CLOB - off-chain matching with on-chain settlement.

Users set prices. A “65% chance” means traders value the outcome at $0.65.

The full order book aggregates bids and asks.

polymarket/clob-client:types.ts#L310-L320

The mid-price (average of best bid and ask) is often displayed as “the price,” while the spread represents trading friction.

The SDK accesses Polymarket’s backend for midpoint and spread calculations.

polymarket/clob-client:client.ts#L294-L298

Polymarket supports limit and market orders.

Limit orders specify an exact price. If you sell YES at $0.55 and no buyer matches, the order sits in the book.

polymarket/clob-client:types.ts#L86-L127

Market orders execute immediately. You specify the buy amount (dollars) or sell amount (shares), and the system calculates the price.

polymarket/clob-client:types.ts#L129-L174

price is optional (calculated), and amount is asymmetric (dollars for buys, shares for sells).

Polymarket’s smart contracts only support limit orders. There’s no native “market order.” Signed orders must include a fixed price. The SDK simulates market orders by calculating the worst price - the most unfavorable level needed to fill your order—and uses that as the limit price.

The SDK calculates 0.55 as the limit price to ensure the order fills.

Buy orders accumulate dollar value up to the budget.

polymarket/clob-client:helpers.ts#L322-L357

Sell orders accumulate share quantity up to the sell amount.

polymarket/clob-client:helpers.ts#L359-L394

  1. Traders: Sign orders to buy/sell.

  2. Operator (Polymarket): Matches orders off-chain and submits transactions.

  3. Exchange (Smart Contract): Immutable contract holding assets.

  4. Validators: Secure the network.

Polymarket uses a Relayer model. Users sign messages on the Polymarket App, and the Operator submits them.

  • Trading Fee: Traders pay the Operator.

  • Gas Fee: Operator pays Validators.

Polymarket (Operator) pays gas fees and collects trading fees (Profit = Trading Fees - Gas Fees).

Orders include an immutable feeRateBps.

polymarket/ctf-exchange:Fees.sol#L6-L14

The exchange enforces a 10% fee cap to prevent abuse.

polymarket/ctf-exchange:Trading.sol#L72-L73

Polymarket scales fees using min(price, 1-price) to neutralize arbitrage between opposing sides. This scaling reduces fees for outcomes with thin profit margins (e.g., pricing at $0.99 implies 1¢ max profit).

polymarket/ctf-exchange:CalculatorHelper.sol#L27-L48

The exchange defines price using _calculatePrice.

polymarket/ctf-exchange:CalculatorHelper.sol#L58-L61

For BUY orders, makerAmount is collateral (USDC) and takerAmount is tokens. For SELL orders, it’s vice-versa. In both cases, price = collateral/tokens.

The smart contract directs trading fees to the Operator (Polymarket), who covers gas costs. Trades occur via _fillOrder (trading directly against Polymarket) or _matchOrders (trading against other users). Polymarket uses the latter to match users peer-to-peer.

Case 1: Direct Fill (_fillOrder)

The fee is implicitly deducted from the asset transfer; since the Operator provides the assets, the fee remains in their wallet.

polymarket/ctf-exchange:Trading.sol#L89-L109

Case 2: Matching (_matchOrders)

Operator matches Maker and Taker. Exchange transfers fee explicitly via _chargeFee.

polymarket/ctf-exchange:Trading.sol#L126-L173

The SDK fetches fee rates from the API and validates that user fee rates match the market.

polymarket/clob-client:client.ts#L1212-L1220

Polymarket abstracts away the blockchain, eliminating gas fees and wallet prompts. Smart contracts ensure trustless settlement. It represents a seamless convergence of Web2 usability and Web3 transparency.

Please let me know if I missed any other major contributors to asymmetric market price calculation!

Discussion about this post

Ready for more?