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

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

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
}

Portfolio

GET /api/v1/portfolio/me AUTH
Get Portfolio Return your portfolio summary, active positions, and recent payouts.
Scope: portfolio:read Rate limit: 1,000,000 req/min
Example
curl https://api.unhedged.gg/api/v1/portfolio/me \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "portfolio": {
    "summary": {
      "totalBets": 12,
      "totalWagered": "850.0000000000",
      "totalWins": 7,
      "totalLosses": 5,
      "pendingBets": 2,
      "pendingOrderBookPositions": 3,
      "pendingOrderBookCostBasis": "124.5000000000",
      "totalPayouts": "1200.0000000000",
      "totalProfit": "350.0000000000",
      "winRate": 58.33,
      "roi": 41.18
    },
    "positions": [...],
    "recentPayouts": [...]
  }
}
GET /api/v1/portfolio/me/positions AUTH
Get Active Positions Return your active "My Positions" rows for unresolved markets, including order-book positions.
Scope: portfolio:read Rate limit: 1,000,000 req/min
Example
curl https://api.unhedged.gg/api/v1/portfolio/me/positions \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "positions": [
    {
      "marketId": "clx...",
      "marketType": "ORDER_BOOK",
      "outcomeIndex": 0,
      "outcomeName": "YES",
      "totalBetAmount": "64.5000000000",
      "betCount": 2,
      "currentValue": "71.2000000000",
      "unrealizedPnl": "6.7000000000",
      "unrealizedPnlPercent": 10.39,
      "createdAt": "2026-04-12T15:33:21.000Z",
      "market": {
        "question": "Will BTC be up at 12:00 UTC?",
        "status": "ACTIVE",
        "outcomes": [
          { "index": 0, "label": "YES", "engineId": "out_0" },
          { "index": 1, "label": "NO", "engineId": "out_1" }
        ]
      }
    }
  ]
}
GET /api/v1/portfolio/me/shares AUTH
Get Order-Book Shares Return your order-book share inventory. Use marketId for the order-ticket view after a fill event.
Scope: portfolio:read Rate limit: 1,000,000 req/min
Query Parameters
marketId string — Optional market filter.
Example
curl https://api.unhedged.gg/api/v1/portfolio/me/shares \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "shares": [
    {
      "marketId": "clx...",
      "outcome": "YES",
      "available": 12,
      "locked": 3,
      "total": 15,
      "updatedAt": "2026-04-12T15:34:01.000Z",
      "market": {
        "question": "Will BTC be up at 12:00 UTC?",
        "status": "ACTIVE",
        "outcomes": [
          { "index": 0, "label": "YES", "engineId": "out_0" },
          { "index": 1, "label": "NO", "engineId": "out_1" }
        ]
      }
    }
  ]
}
GET /api/v1/portfolio/me/equity AUTH
Get Equity Snapshot Return available cash, locked balances, open CLOB mark-to-market value, and rolling P/L.
Scope: portfolio:read Rate limit: 1,000,000 req/min
Example
curl https://api.unhedged.gg/api/v1/portfolio/me/equity \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "equity": {
    "total": "1320.4500000000",
    "available": "1100.0000000000",
    "lockedWithdraws": "0.0000000000",
    "lockedBets": "95.9500000000",
    "lockedEngine": "60.0000000000",
    "unrealizedClob": "64.5000000000",
    "dayChange": "18.2500000000",
    "dayChangePercent": 1.40,
    "sevenDayChange": "84.0000000000",
    "sevenDayChangePercent": 6.80,
    "dayPnl": "18.2500000000",
    "sevenDayPnl": "84.0000000000",
    "updatedAt": "2026-04-12T15:35:00.000Z",
    "asOf": "2026-04-12T15:35:00.000Z"
  }
}
GET /api/v1/portfolio/me/history AUTH
Get Position History Return your resolved and voided market positions.
Scope: portfolio:read Rate limit: 1,000,000 req/min
Example
curl https://api.unhedged.gg/api/v1/portfolio/me/history \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "positions": [
    {
      "marketId": "clx...",
      "marketType": "PARIMUTUEL",
      "outcomeIndex": 1,
      "outcomeName": "NO",
      "totalBetAmount": "50.0000000000",
      "actualPayout": "92.0000000000",
      "isWinner": true,
      "createdAt": "2026-04-10T12:00:00.000Z",
      "market": {
        "question": "Will BTC close above $100k?",
        "status": "RESOLVED",
        "winningOutcome": 1
      }
    }
  ]
}

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

REST order decimal fields use strings, e.g. "0.59". Prices are strict (0, 1) with max 2 decimal places. Invalid decimals return code, field, and received.

Fees

ORDER_BOOK markets do not use platformFeeRate or per-market maker/taker fields. Set engineMarketType on create (default default; also sports_vip). The API returns feeSchedule (tiers from market_fee_type). Per fill, orders expose cum_fees and last_trade_fee. locked_fees is derived as maker_fee_per_contract × (quantity − cum_quantity).

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.

Market Gateway WebSocket

Order-book market data is served by the Rust market gateway, a separate WebSocket process from the REST API. Use REST /api/v1/orders for authenticated order placement and cancellation. Use the gateway for public CLOB discovery, snapshots, live book updates, public trade ticks, and execution quotes.

WebSocket URL
wss://spliceswap.cc/market-gateway/ws
Protocol

JSON-RPC over standard WebSocket text frames. Requests include id, method, and optional params. Responses echo id with either result or error.

State Source

The gateway mirrors the matching engine's market-data stream in memory. It does not query PostgreSQL for live catalog or book state.

Connection Example
const ws = new WebSocket("wss://spliceswap.cc/market-gateway/ws");

ws.onopen = () => {
  ws.send(JSON.stringify({
    id: 1,
    method: "subscribe",
    params: {
      market_id: "clx...",
      best_bid_ask: true,
      snapshot_update: true,
      trade: true
    }
  }));
};

ws.onmessage = (event) => {
  const message = JSON.parse(event.data);
  if (message.id) {
    // JSON-RPC response
    console.log(message.result ?? message.error);
    return;
  }

  // Unsolicited gateway event: best_bid_ask, snapshot_update, trade, etc.
  console.log(message);
};
Gateway Methods
list_markets List active matching-engine markets from the gateway catalog.
snapshot Return the current mirrored order book for one market.
subscribe Subscribe to best bid/ask, book diff, and trade streams for a market.
unsubscribe Remove one or more active subscriptions for a market.
query_trade Fetch historical public trade ticks for a market, capped at 500 trade IDs.
quote_execution Estimate immediate fill size and notional against the mirrored L2 book.
Gateway Errors
-32601 Method not found.
-32602 Invalid params.
-32004 Market or outcome does not exist in the active gateway catalog.
-32005 Gateway message rate limit exceeded.
Gateway Events
new_market

Lifecycle event when a market is added to the gateway catalog.

finish_market

Lifecycle event when a market leaves the gateway catalog.

best_bid_ask

Top-of-book update for one outcome.

snapshot_update

Incremental L2 book diff for one or more price levels.

trade

Unified public trade tick. Direct and cross-outcome fills use the same msg value.

Gateway trade_id is a JSON number on the wire. REST and private /ws order/trade IDs are strings.

Snapshot Request
{
  "id": 2,
  "method": "snapshot",
  "params": { "market_id": "clx..." }
}
Quote Request
{
  "id": 3,
  "method": "quote_execution",
  "params": {
    "market_id": "clx...",
    "outcome": "out_0",
    "side": "bid",
    "type": "Limit",
    "price": 0.50,
    "quantity": 10
  }
}
Quote Limitations

quote_execution is an immediate-fill estimate from the gateway mirror. It uses aggregated L2 depth, does not model your balance or self-trade prevention, and can briefly lag the matching engine during normal network or processing delay. Place and cancel real orders through the authenticated REST endpoints.

User Fill Stream

Bots use /ws for private order events. Authenticate with an API key that has order:read. Place, cancel, and list orders through REST.

WebSocket URL
wss://api.unhedged.gg/ws
Scope
order:read
Auth Message
{
  "type": "auth",
  "token": "Bearer ak_your_key_here"
}
Auth Responses
// success
{ "type": "authenticated", "userId": "clx...", "role": "USER" }

// missing order:read
{
  "type": "error",
  "error": "forbidden",
  "code": "MISSING_SCOPE",
  "scope": "order:read"
}
trade

Your executed order leg. Direct and cross-outcome fills share this event type.

conditional_order

Final order snapshot for a triggered stop-loss or take-profit step.

cancelled_order

Final order snapshot for a cancelled resting order.

Trade Event Shape
{
  "type": "trade",
  "room": "me:clx...",
  "timestamp": 1770000000000,
  "data": {
    "exec_id": "42",
    "trade_id": "184221",
    "qty": 25,
    "transact_ts": 1770000000000000,
    "market_id": "clx...",
    "trade_type": "direct",
    "role": "aggressive",
    "price": "0.62",
    "order": {
      "id": "123",
      "market_id": "clx...",
      "outcome": "out_0",
      "outcome_label": "YES",
      "side": "bid",
      "type": "Limit",
      "user": "clx_balance...",
      "price": "0.62",
      "quantity": 100,
      "cum_quantity": 25,
      "cum_quote_quantity": "15.5",
      "cum_fees": "0.25",
      "last_trade_fee": "0.25",
      "last_exec_price": "0.62",
      "status": "Placed"
    }
  }
}
Bot Connection Example
const apiKey = process.env.UNHEDGED_API_KEY;
const marketId = "clx...";
const ws = new WebSocket("wss://api.unhedged.gg/ws");

ws.onopen = () => {
  ws.send(JSON.stringify({
    type: "auth",
    token: `Bearer ${apiKey}`
  }));
};

ws.onmessage = async (event) => {
  const message = JSON.parse(event.data);
  if (message.type === "authenticated") {
    await backfillFills(marketId);
    return;
  }
  if (message.type === "trade") {
    handleFill(message.data);
  }
};
Reconnect Recovery

The stream has no replay cursor. After connect or reconnect, call GET /api/v1/orders/history?limit=500 and dedupe fills by marketId, tradeId, and orderId. After each trade event, refresh positions with GET /api/v1/portfolio/me/shares?marketId=clx....

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 or engine ID. Ambiguous label/engine ID collisions return 400.
side string * — "bid" (buy outcome) or "ask" (sell outcome).
type string * — Limit | Market | StopLoss | TakeProfit
price string — Limit price decimal string in (0,1), max 2 decimals. Required for Limit orders, omitted for Market/Stop/TP.
triggerPrice string — Trigger price decimal string in (0,1), max 2 decimals. Required for StopLoss/TakeProfit.
quantity number — Number of contracts (positive integer). Mutually exclusive with quoteQuantity.
quoteQuantity string — Cost cap decimal string in CC (> 0, 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": "213",
    "market_id": "clx...",
    "outcome": "YES",
    "side": "bid",
    "type": "Limit",
    "price": "0.62",
    "quantity": 100,
    "exec_id": "42",
    "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 DELETE https://api.unhedged.gg/api/v1/orders \
  -H "Authorization: Bearer ak_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "marketId": "clx...",
  "orderIds": ["213", "214"]
}'
Response
{
  "result": {
    "dropped": ["213", "214"]
  }
}
GET /api/v1/orders AUTH
List Open Orders Return your open orders. Use marketId to restrict the page to one market.
Scope: order:read Rate limit: 60 req/min
Query Parameters
marketId string — Optional market filter.
outcome string — Optional label or engine ID filter. Requires marketId. Ambiguous label/engine ID collisions return 400.
limit number — Page size, 1-500. Default 100.
cursor string — Cursor returned by the previous page.
Example
curl https://api.unhedged.gg/api/v1/orders \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "orders": [
    {
      "id": "213",
      "market_id": "clx...",
      "outcome": "YES",
      "side": "bid",
      "type": "Limit",
      "price": "0.62",
      "quantity": 100,
      "exec_id": "42",
      "cum_quantity": 25,
      "cum_fees": "0.5000000000",
      "status": "Placed"
    }
  ],
  "nextCursor": "eyJtYXJrZXRJZCI6ImNseC4uLiIsIm9yZGVySWQiOiIyMTMifQ"
}
GET /api/v1/orders/history AUTH
Trade History Return your fills, newest first. Use marketId to restrict the page to one market.
Scope: order:read Rate limit: 60 req/min
Query Parameters
marketId string — Optional market filter.
limit number — Page size, 1-500. Default 100.
cursor string — Cursor returned by the previous page.
Example
curl https://api.unhedged.gg/api/v1/orders/history \
  -H "Authorization: Bearer ak_your_key_here"
Response
{
  "trades": [
    {
      "marketId": "clx...",
      "tradeId": "184221",
      "orderId": "213",
      "outcome": "YES",
      "side": "bid",
      "type": "trade",
      "price": "0.62",
      "quantity": 25,
      "createdAt": "2026-04-12T15:33:21.000Z"
    }
  ],
  "nextCursor": "eyJ0cmFuc2FjdFRpbWUiOiIxNzcwMDAwMDAwMDAwMDAwMDAwIiwibWFya2V0SWQiOiJjbHguLi4iLCJ0cmFkZUlkIjoiMTg0MjIxIiwib3JkZXJJZCI6IjIxMyJ9"
}
Order Types
Limit Rests on the book at price. Requires price as a decimal string in (0,1), max 2 decimals.
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.