For the complete documentation index, see llms.txt. This page is also available as Markdown.

Polymarket Integration

All prediction market trades on Bullpen execute through Polymarket's hybrid-decentralized orderbook on Polygon.

What is Polymarket?

Polymarket is a prediction market protocol built on Polygon. It operates a hybrid-decentralized Central Limit Order Book (CLOB) where order matching happens off-chain while settlement and execution occur on-chain.

The system has three core components:

  • CLOB Operator: Handles order matching and book management off-chain

  • Exchange Contract: Executes matched trades on-chain via atomic swaps

  • Conditional Token Framework (CTF): Gnosis-based ERC1155 tokens representing market outcomes

Bullpen routes prediction market orders to Polymarket's CLOB.

How Orders Execute

  1. You place an order through Bullpen

  2. Order is signed with your wallet (EIP-712 structured data)

  3. Submitted to Polymarket's CLOB operator

  4. Operator matches your order against resting liquidity

  5. Matched orders are submitted to the Exchange contract on Polygon

  6. Trade settles on-chain, tokens transfer to your proxy wallet

Order matching is off-chain for speed. Settlement is on-chain for security and custody.

Order Book Mechanics

Polymarket uses price-time priority with a unified orderbook:

  1. Best prices execute first

  2. At the same price, oldest orders fill first

  3. Yes and No orders match against each other on a single book

The unified book means a Yes buy at $0.60 can match against a No buy at $0.40. When their prices sum to $1.00, the operator creates new outcome tokens from collateral and distributes them.

Order Matching Types

Orders can match in three ways:

Match Type
Description

Fill

Your order matches against an existing resting order

Mint

Two opposing orders (Yes + No) summing to $1.00 create new tokens

Merge

Two sell orders (Yes + No) burn tokens and release collateral

Supported Order Types

Polymarket supports limit orders as the base primitive. Market orders are simulated by using marketable limit prices.

Order Type
Behavior

GTC

Good-Til-Cancelled. Rests on the book until filled or cancelled

FOK

Fill-Or-Kill. Must fill entirely and immediately, or cancel

GTD

Good-Til-Date. Expires at a specified timestamp

See Order Types for details on each.

Margin and Collateral

Prediction markets on Polymarket do not use leverage. All positions are fully collateralized.

When you place an order:

  1. Your available USDC.e balance is checked

  2. The order amount is reserved against your balance

  3. You cannot place additional orders exceeding your remaining balance

Example: With 500 USDC.e, you can place one order to buy 1,000 Yes shares at $0.50. Any additional orders in that market will be rejected until the first order fills or is cancelled.

Price Display

Prices shown on Polymarket represent the midpoint of the bid-ask spread, unless the spread exceeds $0.10. In wide-spread markets, the last traded price is displayed instead.

The orderbook displays:

  • Bid: Highest price someone will pay

  • Ask: Lowest price someone will sell

  • Spread: Difference between bid and ask

  • Depth: Total volume at each price level

Fees

Polymarket charges a taker fee on certain markets. These fees fund Polymarket's Maker Rebates Program, which redistributes fees daily to market makers to incentivize deeper liquidity and tighter spreads.

Makers are never charged fees. Only takers pay fees. Geopolitical markets are fee-free.

There are no Polymarket fees to deposit, withdraw, or redeem USDC

Fee Formula

Where C = number of shares traded and p = price of the shares. The effective rate peaks at 50% probability and decreases symmetrically toward $0.00 and $1.00.

Fee Structure by Category

Category
Taker Fee Rate
Maker Fee Rate
Maker Rebate

Crypto

0.072

0

20%

Sports

0.03

0

25%

Finance

0.04

0

25%

Politics

0.04

0

25%

Economics

0.05

0

25%

Culture

0.05

0

25%

Weather

0.05

0

25%

Other / General

0.05

0

25%

Mentions

0.04

0

25%

Tech

0.04

0

25%

Geopolitics

0

0

—

See Polymarket's Fees Documentation for the latest information.

Conditional Tokens

Outcome shares are ERC-1155 tokens built on the Gnosis Conditional Token Framework (CTF). Each market has:

  • A condition ID identifying the market

  • Two position IDs for Yes and No outcomes

  • Collateral backing the tokens (USDC.e)

Full details in Positions and Settlement.

Multi-Outcome Markets

Some markets have more than two outcomes (e.g., "Who will win the election?" with multiple candidates).

These use the NegRiskAdapter contract:

  • Each candidate gets their own Yes/No binary market

  • Exactly one candidate's Yes resolves to $1.00

  • All other candidates' Yes tokens resolve to $0.00

  • No tokens can be converted across markets for capital efficiency

Sports Markets

Sports markets have special rules:

  • All outstanding limit orders are automatically cancelled when the game begins

  • The orderbook is cleared at the official start time

  • Only positions held at game start remain active

Key Polymarket Resources

For deeper technical details:

Last updated