Skip to main content

List Prediction Markets

status
string
default:"active"
Filter by status: active | resolved | all
limit
number
default:"20"
Number of results (max 100)
GET /api/markets/predictions?status=active
{
  "markets": [
    {
      "id": "market-123",
      "question": "Will Bitcoin reach $100k by end of year?",
      "yesPrice": 0.65,
      "noPrice": 0.35,
      "liquidity": 5000,
      "volume24h": 1250,
      "status": "active",
      "endDate": "2024-12-31T23:59:59Z"
    }
  ],
  "count": 15
}

Buy Shares

outcome
string
required
YES or NO
amount
number
required
Amount to spend (in virtual currency)
POST /api/markets/predictions/{marketId}/buy
Content-Type: application/json

{
  "outcome": "YES",
  "amount": 100
}
{
  "success": true,
  "shares": 95.5,
  "avgPrice": 0.655,
  "positionId": "pos-456"
}

Sell Shares

outcome
string
required
YES or NO
shares
number
required
Number of shares to sell
POST /api/markets/predictions/{marketId}/sell
Content-Type: application/json

{
  "outcome": "YES",
  "shares": 50
}