BETAThe Prediction Market API is currently in beta and subject to breaking changes as we continue to improve the product. If you have any feedback, please reach out in Discord.
Prerequisite
- An API key from the Portal. All requests require the
x-api-keyheader. - A Solana wallet with funds (JupUSD or USDC) for the trading steps.
Lifecycle at a Glance
A trade moves through discovery, a pre-trade check, the order itself, then tracking and settlement. The key to integrating is the data hand-off: each call produces the identifier the next call needs.Step by Step
1. Discover events
Start withGET /events (filter by category, filter, tags) or GET /events/search?query= for keyword search. Each event in the response carries a markets[] array.
See Events & Markets for parameters and the response shape.
2. Pick a market
Read themarketId you want from event.markets[]. An event holds one market per outcome (for example, one market per team), so select the specific outcome the user is trading.
3. Read current pricing
CallGET /markets/{marketId} to get fresh buyYesPriceUsd, buyNoPriceUsd, sellYesPriceUsd, and sellNoPriceUsd. Prices are in micro USD (1000000 = $1.00) and reflect implied probability.
4. Check orderbook depth
CallGET /orderbook/{marketId} to see bid/ask depth on each side. Depth tells you how much size can fill near the quoted price, which matters for larger orders.
See Orderbook for the array format.
5. Confirm the exchange is open
CallGET /trading-status and confirm trading_active is true before attempting an order. Also confirm the market itself is tradeable (market.status === 'open').
6. Place the order
CallPOST /orders with the marketId, side (isYes), isBuy: true, and a deposit. It returns an unsigned transaction. Deserialize it, have the user sign, and submit it to Solana.
Full request parameters, the $5 minimum, and the sign-and-submit code are on Open Positions.
7. Track the fill
After submitting, pollGET /orders/status/{orderPubkey} for the fill status (created, partiallyfilled, filled, failed) and read the resulting holding from GET /positions.
See Position Data & History and Manage Positions.
8. Settle or claim
When the market resolves, a winning position becomes claimable. CallPOST /positions/{positionPubkey}/claim to build the payout transaction, then sign and submit it. Some markets settle automatically and need no claim.
See Claim Payouts.
Related
Build a Prediction Market App
Full hands-on guide with runnable code, a video walkthrough, and demo app source.
Events & Markets
Discover events, read pricing, and inspect orderbook depth.
Open Positions
Create, sign, and submit a buy order.
Manage Positions
Sell contracts and close positions.
Claim Payouts
Claim winnings after a market resolves.
API Reference
Full endpoint specifications.
