live on BSC

Consensus API

Trading & market data API

Programmatic access to Consensus Markets. Use these endpoints to place orders, retrieve live market data, track account activity, and integrate loyalty or incentive programs.

Fee model (rounded up to the next cent)

Taker: 2% · P · (1 − P) · C. Maker: 1% · P · (1 − P) · C. P = price in dollars, C = contracts filled.

Base URL

https://prediction-market-production.up.railway.app
Explore live marketsJump to endpoints

Collection

Execution desk

Submit limit or market orders using the same execution layer as the web interface. Responses include the accepted order, fills, and maker/taker metadata.

  • POST

    /order

    Provide `marketAddress`, `side`, `direction`, `type`, `amount`, and `wallet`. Optional flags include `timeInForce`, `minFill`, `peg`, or `cancelBeforeClose` for advanced tactics.

    {
      "marketAddress": "0x123...",
      "side": "YES",
      "direction": "buy",
      "type": "limit",
      "price": 0.32,
      "amount": 100,
      "wallet": "0xabc..."
    }
    {
      "success": true,
      "order": {...},
      "trades": [...],
      "takerFee": 0.66,
      "makerFee": 0.22,
      "feeRates": { "taker": 0.02, "maker": 0.01 }
    }

Collection

Books & discovery

Retrieve live liquidity, full orderbook depth, and cached market summaries used across Consensus discovery surfaces.

  • GET

    /live_markets?limit=12

    Cached summaries for the newest books. Use `limit` to cap results, inspect `fairValue`, `totalDepth`, and jump straight into markets by address.

    {
      "success": true,
      "markets": [{ "address": "...", "question": "...", "closeDate": 173657... }],
      "total": 24,
      "limit": 12
    }
  • GET

    /orderbook?marketAddress=0x...&side=YES

    Returns the best bids/asks plus aggregated `bidLevels` and `askLevels`. Refresh every ~1.5s when streaming raw orderbooks.

  • GET

    /market_metrics?marketAddress=0x...

    Delivers fair value, `vig`, 1h/24h deltas, `volume24h`, last trade, and a sparkline array (polled every ~30s).

    {
      "fairValue": 0.47,
      "midDelta1h": 0.01,
      "midDelta24h": -0.02,
      "volume24h": 132.5,
      "sparkline": [0.45, 0.47, 0.46]
    }

Collection

Loyalty & engagement

Retrieve points balances, record engagement events, and integrate referral or incentive systems.

  • GET

    /points?wallet=0x...

    Returns summary + last 6 history entries with totals broken out by volume, liquidity, early, daily, and referral.

  • POST

    /points/login

    Call this after a wallet sign-in to record the daily login bonus (idempotent per 24h window).

    {"wallet": "0xabc..."}
  • POST

    /points/referral

    Grant referral points once per referee. Pass both `referrer` and `referee` to award both sides.

    {"referrer":"0xabc","referee":"0xdef"}

Collection

Utilities & monitoring

Support tooling, monitoring, and front-end widgets with these lightweight helpers.

  • GET

    /transfers?type=deposit|withdraw&limit=50

    Authenticated. Returns on-chain transfers for the logged-in wallet (deposits and withdrawals) ordered by most recent. Use `type` to filter and `limit` (max 100).

  • GET

    /leaderboard/profits

    Sorted taker-profit leaderboard. Use `?limit=N` to tune the payload size.

  • GET

    /fees/taker

    Inspect outstanding fee balances. Use `type=taker|maker|all` plus `limit` to control results and reconciliation.

  • GET

    /settlement_info

    Provides the settlement wallet and USDC token address so you can audit payouts programmatically.

  • GET

    /health

    Returns Redis connectivity, optional ping errors, and overall health for uptime SLAs.

  • GET

    /suggest_markets

    Get curated prompts for suggestions, ideal for bots or exploring new ideas.

Collection

Programs & incentives

Track liquidity programs and the reward pools that fuel them.

  • GET

    /liquidity_programs/active

    Returns active liquidity programs plus your score, snapshots, reward pools, and discount factors so the wallet page can render incentive cards.

Best practices

Cache `live_markets` responses for 30s and re-use the `address` to drive market previews or discovery flows.

Stream `orderbook` snapshots directly into UI widgets. Combine `bidLevels`/`askLevels` for horizontal scrolling orderbooks.

Use `/points/history` (via `/points`) plus the referral endpoint to gamify engagement and track conversions.

Poll `/liquidity_programs/active` to display reward pools and your score, matching the cards on the wallet page.

Link `/leaderboard/profits` into loyalty pages to spotlight top takers and encourage healthy competition.

Need more?

Visit Points for loyalty flows, or hook live markets for UI inspiration.

Documentation standards

Consensus API documentation standards

  • Use directive language: submit, retrieve, authenticate.
  • Avoid promotional tone and internal implementation references.
  • Prefer nouns over verbs in headings and keep descriptions outcome-oriented.

Examples: “Programmatic access to trading endpoints,” “Reference markets by address,” “Get started.”