Skip to main content
POST
/
market
/
{marketId}
/
bet
curl -X POST http://localhost:3001/market/m1a2b3c4-d5e6-7890-abcd-ef1234567890/bet \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "alice",
    "valuation": 8.5,
    "amount": 100
  }'
{
  "success": true,
  "data": {
    "id": "m1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "status": "open",
    "bets": [
      {
        "userId": "ai-agent",
        "valuation": 15.2,
        "amount": 80,
        "timestamp": "2026-03-14T10:01:00.000Z"
      },
      {
        "userId": "alice",
        "valuation": 8.5,
        "amount": 100,
        "timestamp": "2026-03-14T10:05:00.000Z"
      }
    ],
    "consensusValuation": 11.5,
    "openedAt": "2026-03-14T10:01:00.000Z",
    "closedAt": null
  }
}

Path Parameters

marketId
string
required
Market ID.

Request Body

userId
string
required
Identifier for the bettor.
valuation
number
required
Estimated valuation in millions USD. Must be positive. For example, 8.5 means $8.5M.
amount
number
required
Bet size in USD. Must be positive. Higher amounts have more weight in the consensus calculation.

Response

Returns the updated market with the new bet included and recalculated consensus.
curl -X POST http://localhost:3001/market/m1a2b3c4-d5e6-7890-abcd-ef1234567890/bet \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "alice",
    "valuation": 8.5,
    "amount": 100
  }'
{
  "success": true,
  "data": {
    "id": "m1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "status": "open",
    "bets": [
      {
        "userId": "ai-agent",
        "valuation": 15.2,
        "amount": 80,
        "timestamp": "2026-03-14T10:01:00.000Z"
      },
      {
        "userId": "alice",
        "valuation": 8.5,
        "amount": 100,
        "timestamp": "2026-03-14T10:05:00.000Z"
      }
    ],
    "consensusValuation": 11.5,
    "openedAt": "2026-03-14T10:01:00.000Z",
    "closedAt": null
  }
}

Consensus Calculation

The consensus valuation is a volume-weighted average:
consensus = Σ(valuation_i * amount_i) / Σ(amount_i)
Larger bets carry more weight. This incentivizes putting money behind conviction.