API Reference v1

Build on Unhedged.

A REST API for prediction markets and Continuous Trading Markets (CTM). Public endpoints for market data; authenticated endpoints for placing bets, submitting predictions, and managing your balance.

Authentication

Pass your API key as a Bearer token in the Authorization header. Public endpoints (most market reads) work without a key.

Base URL
https://api.unhedged.gg
Key Prefix
ak_*
Authorization: Bearer ak_your_key_here

Quickstart

Place your first bet in three steps.

  1. 1 Create an API key

    Sign in and visit Account → API Keys. Default scopes cover reading and betting; opt-in for balance:withdraw only if you need it.

  2. 2 Find an active market
    curl https://api.unhedged.gg/api/v1/markets?status=ACTIVE&limit=5
  3. 3 Place a bet
    curl -X POST https://api.unhedged.gg/api/v1/bets \
      -H "Authorization: Bearer ak_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{"marketId":"clx...","outcomeIndex":0,"amount":50}'

Scopes

Each API key has a fixed set of scopes. Endpoints that require a scope are marked below the endpoint title. Withdrawals are gated behind an explicit opt-in scope.

market:read Read market and CTM round data (most market endpoints are public regardless).
balance:read Read your platform balance and transaction history.
balance:withdraw Initiate withdrawals from your platform balance. NOT enabled by default.
bet:place Place bets on markets and submit CTM predictions.
bet:read Read your bets, predictions, and positions.
portfolio:read Read your portfolio, equity, and performance records.
order:place Place orders on the matching engine (CLOB).
order:cancel Cancel your open matching-engine orders.
order:read Read your matching-engine order history.

Rate Limits

Limits are applied per IP. Endpoint-specific limits are listed on each endpoint card. When exceeded you'll receive 429 Too Many Requests — back off and retry.

Global default600 req/min
Bets / authenticated reads60 req/min
Bets per market per IP15 req/min
CTM predict80 req/min
Order book (place / cancel / read)60 req/min
Price history300 req/min
Withdrawals5 req/min
API key creation10 req/hour

Markets

GET /api/v1/markets PUBLIC
List Markets Browse active prediction markets. Public endpoint — no API key required.
Rate limit: 600 req/min
Query Parameters
status string — ACTIVE | ENDED | RESOLVED | VOIDED
category string — Filter by category
search string — Search query (max 200 chars)
limit number — Results per page (1–100, default 20)
offset number — Pagination offset (default 0)
orderBy string — createdAt | endTime | totalPool | betCount
orderDirection string — asc | desc
Example
curl https://api.unhedged.gg/api/v1/markets
Response
{
  "markets": [
    {
      "id": "clx...",
      "question": "Will BTC hit $100k by June?",
      "status": "ACTIVE",
      "category": "Crypto",
      "outcomes": [
        { "index": 0, "label": "Yes" },
        { "index": 1, "label": "No" }
      ],
      "totalPool": "1500.0000000000",
      "endTime": "2026-06-01T00:00:00.000Z",
      ...
    }
  ],
  "total": 42,
  "activeCount": 12,
  "endedCount": 8,
  "resolvedCount": 22
}
GET /api/v1/markets/:id PUBLIC
Get Market Details Get full details for a single market including outcomes, pool sizes, and odds. Public endpoint.
Rate limit: 600 req/min
Example
curl https://api.unhedged.gg/api/v1/markets/<id>
Response
{
  "market": {
    "id": "clx...",
    "question": "Will BTC hit $100k by June?",
    "description": "Resolves Yes if...",
    "status": "ACTIVE",
    "category": "Crypto",
    "outcomes": [
      { "index": 0, "label": "Yes" },
      { "index": 1, "label": "No" }
    ],
    "totalPool": "1500.0000000000",
    "endTime": "2026-06-01T00:00:00.000Z",
    "createdAt": "2026-01-15T...",
    ...
  }
}
GET /api/v1/balance AUTH
Get Balance Check your current platform balance, including available, locked, and total amounts.
Scope: balance:read Rate limit: 60 req/min
Example
curl https://api.unhedged.gg/api/v1/balance \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "balance": {
    "available": "500.0000000000",
    "lockedWithdraws": "0.0000000000",
    "lockedBets": "150.0000000000",
    "lockedEngine": "0.0000000000",
    "total": "650.0000000000",
    "totalDeposited": "1000.0000000000",
    "totalWithdrawn": "200.0000000000"
  },
  "withdrawalFee": "1.0000000000",
  "bettingFee": "0.0000000000",
  "ccPriceUsd": 0.015
}
POST /api/v1/bets AUTH
Place a Bet Place a bet on a market outcome. Instantly deducts from your platform balance.
Scope: bet:place Rate limit: 60 req/min globally · 15 req/min per market per IP
Request Body
marketId string * — Market ID to bet on
outcomeIndex number * — Index of the outcome (0-based)
amount number * — Amount in CC (min 0.0001)
idempotencyKey string — Optional dedup key to prevent double bets
Example
curl -X POST https://api.unhedged.gg/api/v1/bets \
  -H "Authorization: Bearer ak_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "marketId": "clx...",
  "outcomeIndex": 0,
  "amount": 50
}'
Response
{
  "bet": {
    "id": "clx...",
    "marketId": "clx...",
    "outcomeIndex": 0,
    "amount": "50.0000000000",
    "status": "CONFIRMED",
    "timeWeight": "1.0000"
  },
  "balanceAfter": "450.0000000000",
  "fee": "0.0000000000"
}
GET /api/v1/bets AUTH
List Your Bets Retrieve your bet history with optional filters.
Scope: bet:read Rate limit: 60 req/min
Query Parameters
status string — PENDING | CONFIRMED | WON | LOST | REFUNDED
marketId string — Filter by market
limit number — Results per page (1–100, default 20)
offset number — Pagination offset
Example
curl https://api.unhedged.gg/api/v1/bets \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "bets": [
    {
      "id": "clx...",
      "marketId": "clx...",
      "market": {
        "question": "Will BTC hit $100k?",
        "status": "ACTIVE",
        "outcomes": [...]
      },
      "outcomeIndex": 0,
      "amount": "50.0000000000",
      "status": "CONFIRMED",
      "createdAt": "2026-02-20T..."
    }
  ],
  "total": 5
}

CTM – Continuous Trading Markets

GET /api/v1/ctm/rounds PUBLIC
List CTM Rounds Browse CTM rounds. Supports filtering by status, asset, and round type. Public endpoint.
Rate limit: 600 req/min
Query Parameters
status string — OPEN | HEATMAP | LOCKED | RESOLVED | VOIDED (comma-separated)
asset string — Filter by asset (e.g. BTC, ETH)
roundType string — FLASH | BLITZ | SPRINT | DAILY | WEEKLY | EVENT
limit number — Results per page (1–100, default 20)
offset number — Pagination offset (default 0)
sort string — asc | desc
Example
curl https://api.unhedged.gg/api/v1/ctm/rounds
Response
{
  "rounds": [
    {
      "id": "clx...",
      "asset": "BTC",
      "roundType": "BLITZ",
      "status": "OPEN",
      "question": "Where will BTC be in 5 min?",
      "entryFeeBlind": "10.0000000000",
      "totalPool": "500.0000000000",
      "predictionCount": 12,
      "openStartsAt": "2026-04-05T12:00:00.000Z",
      "heatmapStartsAt": "2026-04-05T12:03:00.000Z",
      "lockedStartsAt": "2026-04-05T12:04:00.000Z",
      "resolvesAt": "2026-04-05T12:05:00.000Z",
      ...
    }
  ],
  "total": 58
}
GET /api/v1/ctm/rounds/:id PUBLIC
Get Round Details Get full details for a single CTM round. Public endpoint.
Rate limit: 600 req/min
Example
curl https://api.unhedged.gg/api/v1/ctm/rounds/<id>
Response
{
  "round": {
    "id": "clx...",
    "asset": "BTC",
    "roundType": "BLITZ",
    "status": "OPEN",
    "question": "Where will BTC be in 5 min?",
    "description": "...",
    "entryFeeBlind": "10.0000000000",
    "heatmapFeeMultiplier": "2.0000000000",
    "platformFeeRate": "0.0500000000",
    "totalPool": "500.0000000000",
    "predictionCount": 12,
    "openStartsAt": "2026-04-05T12:00:00.000Z",
    "heatmapStartsAt": "2026-04-05T12:03:00.000Z",
    "lockedStartsAt": "2026-04-05T12:04:00.000Z",
    "resolvesAt": "2026-04-05T12:05:00.000Z",
    "settlementPrice": null,
    "resolvedAt": null,
    ...
  }
}
GET /api/v1/ctm/rounds/:id/heatmap PUBLIC
Get Heatmap Get the prediction heatmap distribution for a round. Public endpoint.
Rate limit: 600 req/min
Query Parameters
bucketCount number — Number of buckets (5–50, default 20)
Example
curl https://api.unhedged.gg/api/v1/ctm/rounds/<id>/heatmap
Response
{
  "heatmap": [
    { "min": 83000, "max": 83500, "count": 3 },
    { "min": 83500, "max": 84000, "count": 7 },
    ...
  ]
}
GET /api/v1/ctm/rounds/:id/results PUBLIC
Get Round Results Get settlement results and top predictions for a resolved round. Public endpoint.
Rate limit: 600 req/min
Example
curl https://api.unhedged.gg/api/v1/ctm/rounds/<id>/results
Response
{
  "round": { ... },
  "result": {
    "settlementPrice": "84250.5000000000",
    "totalPool": "2000.0000000000",
    "platformFee": "100.0000000000",
    "payoutPool": "1900.0000000000",
    "totalPredictions": 45,
    "uniquePlayers": 32,
    "resolvedAt": "2026-04-05T12:05:00.000Z"
  },
  "topPredictions": [...]
}
GET /api/v1/ctm/rounds/:id/price-history PUBLIC
Get Price History Get historical price data for a round's asset. Auto-downsampled to max 600 points. Public endpoint.
Rate limit: 300 req/min
Example
curl https://api.unhedged.gg/api/v1/ctm/rounds/<id>/price-history
Response
{
  "prices": [
    { "price": 84100.5, "bid": 84099.0, "ask": 84102.0, "timestamp": 1712318400000 },
    { "price": 84110.2, "bid": 84109.0, "ask": 84111.5, "timestamp": 1712318410000 },
    ...
  ],
  "asset": "BTC"
}
POST /api/v1/ctm/rounds/:id/predict AUTH
Place a Prediction Submit a price prediction for an open CTM round. Entry fee is deducted from your platform balance.
Scope: bet:place Rate limit: 80 req/min
Request Body
predictedPrice number * — Your predicted settlement price (min 0)
idempotencyKey string — Optional dedup key to prevent double entries
Example
curl -X POST https://api.unhedged.gg/api/v1/ctm/rounds/<id>/predict \
  -H "Authorization: Bearer ak_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "predictedPrice": 84250.50
}'
Response
{
  "prediction": {
    "id": "clx...",
    "roundId": "clx...",
    "phase": "BLIND",
    "predictedPrice": "84250.5000000000",
    "amount": "10.0000000000",
    "status": "CONFIRMED"
  },
  "balanceAfter": "490.0000000000",
  "fee": "10.0000000000",
  "phase": "BLIND"
}
GET /api/v1/ctm/my-predictions AUTH
List Your Predictions Retrieve your CTM prediction history with optional round filter.
Scope: bet:read Rate limit: 60 req/min
Query Parameters
roundId string — Filter by specific round
Example
curl https://api.unhedged.gg/api/v1/ctm/my-predictions \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "predictions": [
    {
      "id": "clx...",
      "roundId": "clx...",
      "phase": "BLIND",
      "predictedPrice": "84250.5000000000",
      "amount": "10.0000000000",
      "status": "CONFIRMED",
      "distance": "50.5000000000",
      "rank": 3,
      "payoutAmount": "25.0000000000",
      "submittedAt": "2026-04-05T12:01:00.000Z",
      "round": {
        "question": "Where will BTC be in 5 min?",
        "asset": "BTC",
        "status": "RESOLVED"
      }
    }
  ]
}
GET /api/v1/ctm/my-stats AUTH
Get Your CTM Stats Get your personal CTM statistics including win rate, streaks, and total payouts.
Scope: bet:read Rate limit: 60 req/min
Example
curl https://api.unhedged.gg/api/v1/ctm/my-stats \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "stats": {
    "totalRounds": 85,
    "totalPredictions": 102,
    "totalWins": 28,
    "totalPayouts": "5600.0000000000",
    "bestRank": 1,
    "currentStreak": 3,
    "bestStreak": 7,
    "avgDistance": "125.3400000000"
  }
}

Order Book Markets

Order book markets use a CLOB (central limit order book) instead of pool betting. You quote prices for binary outcomes (e.g. YES / NO) on a continuous market between 0 and 1, where the price represents the implied probability.

Market discovery

Filter /api/v1/markets by type=ORDER_BOOK to find CLOB markets. Pool markets continue to use the /api/v1/bets endpoints.

Sides

bid = buy this outcome. ask = sell this outcome. Selling YES at p is economically equivalent to buying NO at 1 − p.

Prices

Strict (0, 1) with max 2 decimal places. 0 and 1 are reserved for resolution.

Fees

Symmetric maker/taker fee per market (typically 2%). Returned per fill on the order's cum_fees field.

Settlement & balance lock

When you place an order, the maximum cost is moved from balance.available to balance.lockedEngine — visible immediately on GET /balance. On a fill, the matched portion is debited from lockedEngine and a position contract is created on the Canton ledger. On cancel, any unfilled portion returns to available. Trade matching is real-time off-chain; settlement is atomic on-chain in batches.

No server-side idempotency

POST /orders does not deduplicate retries. If a request times out, query GET /orders before resubmitting. Maintain a client-side dedup key per logical order.

POST /api/v1/orders AUTH
Place Order Place a Limit, Market, StopLoss, or TakeProfit order on an ORDER_BOOK market. Cost is moved from your available balance to lockedEngine immediately on acceptance.
Scope: order:place Rate limit: 60 req/min
Request Body
marketId string * — Market ID. Must be type ORDER_BOOK and status ACTIVE.
outcome string * — Outcome label (e.g. "YES" / "NO" or any market-defined label).
side string * — "bid" (buy outcome) or "ask" (sell outcome).
type string * — Limit | Market | StopLoss | TakeProfit
price number — Limit price ∈ (0,1), max 2 decimals. Required for Limit orders, omitted for Market/Stop/TP.
triggerPrice number — Trigger price ∈ (0,1), max 2 decimals. Required for StopLoss/TakeProfit.
quantity number — Number of contracts (positive integer). Mutually exclusive with quoteQuantity.
quoteQuantity number — Cost cap in CC (≥0.0001, max 2 decimals). Mutually exclusive with quantity.
Example
curl -X POST https://api.unhedged.gg/api/v1/orders \
  -H "Authorization: Bearer ak_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "marketId": "clx...",
  "outcome": "YES",
  "side": "bid",
  "type": "Limit",
  "price": 0.62,
  "quantity": 100
}'
Response
{
  "order": {
    "id": "clx...",
    "market_id": "clx...",
    "outcome": "YES",
    "side": "bid",
    "type": "Limit",
    "price": 0.62,
    "quantity": 100,
    "cum_quantity": 0,
    "cum_quote_quantity": 0,
    "cum_fees": 0,
    "last_exec_price": null,
    "status": "Placed"
  }
}
DELETE /api/v1/orders AUTH
Cancel Orders Cancel one or more open orders in a single market. Pass an empty orderIds array to cancel ALL of your open orders in that market.
Scope: order:cancel Rate limit: 60 req/min
Request Body
marketId string * — Market ID
orderIds string[] * — IDs to cancel. Empty array = cancel all in this market.
Example
curl -X POST https://api.unhedged.gg/api/v1/orders \
  -H "Authorization: Bearer ak_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "marketId": "clx...",
  "orderIds": ["clx_order_1", "clx_order_2"]
}'
Response
{
  "result": {
    "dropped": ["clx_order_1", "clx_order_2"]
  }
}
GET /api/v1/orders AUTH
List Open Orders Return your currently open (resting or armed) orders in a market.
Scope: order:read Rate limit: 60 req/min
Query Parameters
marketId string — Required. Market to query.
outcome string — Optional filter to a single outcome.
Example
curl https://api.unhedged.gg/api/v1/orders \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "orders": [
    {
      "id": "clx...",
      "market_id": "clx...",
      "outcome": "YES",
      "side": "bid",
      "type": "Limit",
      "price": 0.62,
      "quantity": 100,
      "cum_quantity": 25,
      "cum_fees": "0.5000000000",
      "status": "Placed"
    }
  ]
}
GET /api/v1/orders/history AUTH
Trade History Return your fills (executed legs) on a market, newest first.
Scope: order:read Rate limit: 60 req/min
Query Parameters
marketId string — Required. Market to query.
limit number — Max fills to return (positive integer).
Example
curl https://api.unhedged.gg/api/v1/orders/history \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "trades": [
    {
      "tradeId": 184221,
      "orderId": "clx...",
      "outcome": "YES",
      "side": "bid",
      "type": "Limit",
      "price": 0.62,
      "quantity": 25,
      "createdAt": "2026-04-12T15:33:21.000Z"
    }
  ]
}
Order Types
Limit Rests on the book at price. Requires price ∈ (0,1) with 2-decimal precision.
Market Consumes liquidity immediately. No price; bounded only by available balance / book depth.
StopLoss Conditional. Triggers a market-style execution when last trade price falls to triggerPrice.
TakeProfit Conditional. Triggers a market-style execution when last trade price rises to triggerPrice.
Order Statuses
New Accepted by API; not yet on the book.
Placed Resting on the book (Limit) or armed (StopLoss/TakeProfit).
Filled Fully executed. cum_quantity == requested quantity.
Cancelled Cancelled by user (or auto-cancelled at market close).
InternalCancel Engine could not place the resting remainder (e.g. insufficient balance after partial fill). Includes a reason string.

Errors

Errors return a JSON body of the shape { "error": "ErrorType", "message": "..." }. Some 4xx responses include an additional code field for machine-readable handling.

400 Bad request — invalid params, malformed body, or insufficient balance
401 Unauthorized — missing or invalid API key
403 Forbidden — key lacks required scope, account suspended, or email not verified
404 Not found — market, round, or bet doesn't exist
409 Conflict — idempotency key reused with different payload
429 Rate limited — slow down. Backoff and retry after a few seconds
503 Service unavailable — betting/CTM temporarily disabled by admin