The API is currently not open for third-party API-key registration. Endpoints accept either:
x-mobile-api-key: <MOBILE_API_KEY> together withAuthorization: Bearer <supabase_access_token> for the official mobile client.All write endpoints require an authenticated user; read endpoints may still rate-limit unauthenticated traffic by IP.
/api/v1/amm/quoteReturns the expected shares received for a given USD-denominated input on the CPMM AMM. Read-only. Rate-limited to 120 requests/minute.
curl -X GET "https://www.ravioli.live/api/v1/amm/quote?market_id=MARKET_ID&side=yes&amount=10&outcome_id=OUTCOME_ID"
/api/v1/amm/pricesReturns current implied prices per outcome from the AMM pool reserves for a market.
curl -X GET "https://www.ravioli.live/api/v1/amm/prices?market_id=MARKET_ID"
/api/v1/amm/swapBuys outcome shares against the AMM pool. Atomic credit-debit + share-mint via Postgres function. Rate-limited to 30 requests/minute.
curl -X POST "https://www.ravioli.live/api/v1/amm/swap" \
-H "Content-Type: application/json" \
-d '{
"market_id": "MARKET_ID",
"outcome_id": "OUTCOME_ID",
"side": "yes",
"amount": 10
}'/api/v1/amm/sellReturns USD credits for shares sold against the AMM pool. Includes per-market and hourly rate caps in addition to the standard write limit.
curl -X POST "https://www.ravioli.live/api/v1/amm/sell" \
-H "Content-Type: application/json" \
-d '{
"market_id": "MARKET_ID",
"outcome_id": "OUTCOME_ID",
"side": "yes",
"shares": 25
}'/api/v1/amm/smart-quoteCompares AMM and order-book pricing for a buy and returns the cheaper route plus the resulting fill plan.
curl -X POST "https://www.ravioli.live/api/v1/amm/smart-quote" \
-H "Content-Type: application/json" \
-d '{
"market_id": "MARKET_ID",
"outcome_id": "OUTCOME_ID",
"side": "yes",
"amount": 10
}'/api/v1/orderbook/bookReturns the bid/ask book for a market and position side ('yes' or 'no'). Read-limited to 120 requests/minute.
curl -X GET "https://www.ravioli.live/api/v1/orderbook/book?market_id=MARKET_ID&position_side=yes"
/api/v1/orderbook/placePlaces a limit order on the CLOB. Matched via Postgres triggers; partial fills supported. Rate-limited to 30 requests/minute.
curl -X POST "https://www.ravioli.live/api/v1/orderbook/place" \
-H "Content-Type: application/json" \
-d '{
"market_id": "MARKET_ID",
"outcome_id": "OUTCOME_ID",
"side": "buy",
"position_side": "yes",
"price": 0.65,
"quantity": 100
}'/api/v1/orderbook/cancelCancels an open limit order owned by the authenticated user. Refunds the unfilled portion to credits or shares.
curl -X POST "https://www.ravioli.live/api/v1/orderbook/cancel" \
-H "Content-Type: application/json" \
-d '{ "order_id": "ORDER_ID" }'/api/v1/outcomes/orderbookReturns the order book for a specific outcome inside a multi-outcome market.
curl -X GET "https://www.ravioli.live/api/v1/outcomes/orderbook?market_id=MARKET_ID&outcome_id=OUTCOME_ID"
/api/v1/outcomes/placePlaces a limit order against a single outcome of a multi-outcome market.
curl -X POST "https://www.ravioli.live/api/v1/outcomes/place" \
-H "Content-Type: application/json" \
-d '{
"market_id": "MARKET_ID",
"outcome_id": "OUTCOME_ID",
"side": "buy",
"price": 0.32,
"quantity": 50
}'/api/v1/tradesReturns the most recent fills for the given market across the AMM and CLOB.
curl -X GET "https://www.ravioli.live/api/v1/trades?market_id=MARKET_ID"
Supabase RealtimeLive market and debate updates are delivered via Supabase Realtime channels (Postgres logical replication), not a custom WebSocket. Subscribe with the Supabase JS client:
import { createClient } from '@supabase/supabase-js'
const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY)
supabase
.channel('market-MARKET_ID')
.on('postgres_changes', {
event: '*',
schema: 'public',
table: 'trades',
filter: 'market_id=eq.MARKET_ID',
}, (payload) => {
console.log('New trade:', payload.new)
})
.subscribe()amm/sell additionally caps total sells per hour and per market to prevent rapid pool drains.