Place Bets
Place a bet on a prediction market with a POST request. Send the market id, the side (yes or no), and the amount in $PREDICT.
Base URL
All API requests use this base:
https://nqyocjuqubsdrguazcjz.supabase.co
HTTP request
Send a POST request to the place-bet endpoint with the required headers and a JSON body containing the market id, side, and amount.
Endpoint
POST https://nqyocjuqubsdrguazcjz.supabase.co/rest/v1/rpc/place_bet
Required headers
Content-Type: application/json apikey: <your-api-key> Accept: application/json
Include the apikey header with your API key and set Content-Type: application/json for the request body.
Request body
JSON object with the following fields:
- market_id (string, required) — The unique ID of the market (e.g. from Get market by id or the markets list).
- side (string, required) — The outcome to bet on: "yes" or "no".
- amount (number, required) — The amount to bet in $PREDICT (pre-fee). Must be greater than 0.
Example body:
{
"market_id": "550e8400-e29b-41d4-a716-446655440000",
"side": "yes",
"amount": 100
}Response
On success, the API returns 200 with a JSON object indicating the bet was placed:
{
"success": true,
"data": {
"trade_id": "uuid",
"market_id": "string",
"side": "yes",
"amount": number,
"fee_amount": number,
"created_at": "ISO8601 string"
}
}On error, the API returns an appropriate HTTP status (e.g. 400 for invalid parameters, 401 for missing or invalid API key, 404 if the market does not exist):
{
"error": "Error message describing what went wrong"
}