Skip to main content

What is a Prediction Market?

A prediction market is a market where participants trade contracts that pay out based on the outcome of future events. Each market has two sides (typically “Yes” and “No”), and the price of each side reflects the market’s implied probability of that outcome.

Market Structure

Key Identifiers

Every market in Predexon has several identifiers:
IdentifierDescriptionExample
condition_idUnique hash for the market condition0x1a2b3c...
market_slugHuman-readable URL-safe identifierwill-donald-trump-win-the-2024-us-presidential-election
market_idInternal numeric identifier12345

Outcomes (Sides)

Each market has exactly two outcomes:
{
  "outcomes": [
    {
      "label": "Yes",
      "token_id": "21742633143463906290569050155826241533067272736897614950488156847949938836455",
      "price": 0.62
    },
    {
      "label": "No",
      "token_id": "48331043336612883890938759509493159234755048973500640148014422747788308965732",
      "price": 0.38
    }
  ]
}
Prices always sum to approximately 1.0 (there may be slight deviations due to market spread).

Token IDs

Token IDs are crucial for:
  • Fetching candlestick data
  • Getting market prices
  • Tracking wallet positions
  • Querying orderbooks

Market Lifecycle

StatusDescription
openTrading is active
closedTrading has stopped, awaiting resolution
resolvedOutcome determined, winning side pays $1

Querying Markets

Basic Filtering

import requests

BASE_URL = "https://api.predexon.com"

# Get open markets only
response = requests.get(
    f"{BASE_URL}/v1/polymarket/markets",
    params={"status": "open"}
)

# Filter by price range (unlikely outcomes)
response = requests.get(
    f"{BASE_URL}/v1/polymarket/markets",
    params={
        "min_price": 0.01,
        "max_price": 0.10
    }
)

# Filter by minimum volume
response = requests.get(
    f"{BASE_URL}/v1/polymarket/markets",
    params={"min_volume": 1000000}  # $1M+ volume
)

Sorting Options

Sort ValueDescription
volumeTotal trading volume (default)
open_interestCurrent open interest
price_descHighest price first
price_ascLowest price first

Filtering by Tags

Markets can be filtered by category tags:
response = requests.get(
    f"{BASE_URL}/v1/polymarket/markets",
    params={"tags": ["politics", "elections"]}
)
Common tags include:
  • politics
  • crypto
  • sports
  • elections
  • economy

Market Metrics

Volume

Total Volume (total_volume_usd) represents the cumulative USD value of all trades in the market’s history.
# Get top 10 markets by volume
response = requests.get(
    f"{BASE_URL}/v1/polymarket/markets",
    params={
        "sort": "volume",
        "limit": 10
    }
)

Open Interest

Open Interest (open_interest_total) is the total value of outstanding positions - tokens that have been minted but not yet redeemed.
# Get markets with high open interest
response = requests.get(
    f"{BASE_URL}/v1/polymarket/markets",
    params={
        "sort": "open_interest",
        "min_open_interest": 500000
    }
)

Liquidity

Liquidity (liquidity_usd) measures the depth of the orderbook - how much can be traded without significant price impact.

Working with Multiple Markets

Batch Lookups

Query multiple markets by ID in a single request:
response = requests.get(
    f"{BASE_URL}/v1/polymarket/markets",
    params={
        "condition_id": [
            "0x1234...",
            "0x5678...",
            "0x9abc..."
        ]
    }
)

Event-Based Grouping

Markets related to the same event share an event_slug:
# Get all markets for a specific event
response = requests.get(
    f"{BASE_URL}/v1/polymarket/markets",
    params={"event_slug": "2024-presidential-election"}
)

Next Steps