PMX
Loading…

PMX • Public Market Data API

Build On Top Of PMX Prediction Markets

A dedicated, rate-limited API surface that exposes market metadata, trading activity, and liquidity snapshots for bots, dashboards, and analytics teams. No authentication tokens required—just hit the endpoints.

Base URL

https://api.pmx.trade/v1

Response Envelope

All endpoints respond with `success: boolean, data: any, meta?: object`. Errors include `success: false, error, details?`.

Rate Limits & Hosting

  • • Default limit: 120 requests / minute / IP (configurable per deployment).
  • • Built-in Express rate limiter + Helmet + CORS (`*` by default).
  • • Deploy separately (e.g. Railway) so public usage cannot impact the trading backend.
  • • All responses follow { success, data, meta } and return HTTP JSON errors.

Markets

Discover and inspect prediction market metadata and metrics.

GET/markets

List markets with search, filtering, and sorting.

Query Parameters

  • `q` – full-text search across name, description, slug.
  • `status` – filter by status (e.g. `active`, `resolved`).
  • `tag` – filter by tag (e.g. `sports`, `crypto`).
  • `published` / `resolved` – boolean flags.
  • `limit` / `offset` – pagination (limit ≤ 200).
  • `sort` – `created_at`, `volume_24h_usd`, `total_volume_usd`, prefix with `-` for desc.

Example

GET https://api.pmx.trade/v1/markets?status=active&sort=-volume_24h_usd&limit=25
GET/markets/{slug}

Detailed market payload with option metadata and aggregate metrics.

Query Parameters

  • `include` – comma list for extra data (`trades`, `liquidity`).

Example

GET https://api.pmx.trade/v1/markets/nba-lakers-vs-grizzlies-20251030?include=liquidity,trades

Trades

Recent executions and market-specific trade feeds.

GET/trades

Global trade feed (most recent first).

Query Parameters

  • `market` – optional slug filter.
  • `since` / `before` – ISO timestamp fence posts.
  • `limit` / `offset` – pagination (limit ≤ 500).

Example

GET https://api.pmx.trade/v1/trades?market=will-btc-reach-100k&limit=100
GET/markets/{slug}/trades

Shortcut alias for a single market's recent trades.

Query Parameters

  • Same options as `GET /trades`.

Example

GET https://api.pmx.trade/v1/markets/will-cpi-print-under-3-202512/trades?limit=50

Liquidity

LP composition and contributions per market.

GET/liquidity/{slug}

Aggregated liquidity stats plus top providers.

Query Parameters

  • `limit` – number of provider rows (default 100, max 500).

Example

GET https://api.pmx.trade/v1/liquidity/nba-lakers-vs-grizzlies-20251030

Stats

High-level platform metrics useful for dashboards.

GET/stats/summary

Totals for markets, volume, unique traders, and liquidity.

Example

GET https://api.pmx.trade/v1/stats/summary

Sample Payload

`GET /v1/markets/:slug` responds with a detailed market object, option breakdown, and optional trades/liquidity arrays when requested via the `include` parameter.

{
  "success": true,
  "data": {
    "market": {
      "slug": "nba-lakers-vs-grizzlies-20251030",
      "name": "NBA - Lakers vs Grizzlies (Oct 30)",
      "status": "active",
      "endDate": "2025-10-30T23:59:00Z",
      "tags": ["sports", "sports-nba"],
      "metrics": {
        "totalVolumeUsd": 182430.14,
        "volume24hUsd": 24892.02,
        "uniqueTraders": 316,
        "lpCount": 42,
        "netLiquidity": 68321.77
      }
    },
    "options": [
      {
        "option": "YES",
        "tokenMint": "6cRxPNePe2MLXDpUCsPDGVsny1a4yT6Kmk62eVvDqXg6",
        "poolAddress": "7hnUmDpJ4cQguDYCG1DP82NNumdhmSN3KbXrroMrvgae",
        "label": "Yes",
        "ticker": "YES",
        "lastTradePrice": 0.00532,
        "lastOddsPercent": 53.2,
        "priceScale": 0.001,
        "lastTradeAt": "2025-11-02T09:57:40.206Z"
      },
      {
        "option": "NO",
        "tokenMint": "AGqL5amTJVH2sfSLaNESN4bSeZQnZCbR8zoQ4ue3hsMM",
        "poolAddress": "CawraC5o7XPp5oxZ2Grj8hXrKaesJwvrrHxFx8BKsx4z",
        "label": "No",
        "ticker": "NO",
        "lastTradePrice": 0.00468,
        "lastOddsPercent": 46.8,
        "priceScale": 0.001,
        "lastTradeAt": "2025-11-02T09:57:34.890Z"
      }
    ]
  }
}

Jupiter Trading Example

Need to place orders programmatically? Check the script at public-api/examples/jupiter-market-order.js for a step-by-step Jupiter quote + swap workflow. It prints the serialized transaction you can sign using your preferred Solana client.