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
To query position data, you need:- An API key from the Jupiter Portal
Querying Positions
UseGET /positions to retrieve position data with comprehensive P&L information.
| Parameter | Type | Description |
|---|---|---|
ownerPubkey | string | Wallet public key (required) |
marketPubkey | string | Filter by market account pubkey |
marketId | string | Filter by market ID |
isYes | boolean | Filter by position side |
start | number | Pagination start index |
end | number | Pagination end index |
PNL Fields
Each position includes detailed P&L metrics:| Field | Description |
|---|---|
totalCostUsd | Total cost basis (entry cost) |
avgPriceUsd | Average price per contract |
valueUsd | Current mark-to-market value |
markPriceUsd | Current market price per contract |
pnlUsd | Unrealized profit/loss |
pnlUsdPercent | Unrealized P&L as percentage |
pnlUsdAfterFees | P&L after estimated fees |
pnlUsdAfterFeesPercent | P&L after fees as percentage |
realizedPnlUsd | Realized P&L from closed portions |
feesPaidUsd | Total fees paid |
Get All Positions
Aggregating Portfolio P&L
Aggregating Portfolio P&L
Get a Specific Position
Querying Orders
UseGET /orders to retrieve order history and fill details.
| Parameter | Type | Description |
|---|---|---|
ownerPubkey | string | Wallet public key |
start | number | Pagination start (or timestamp) |
end | number | Pagination end (or timestamp) |
Order Fill Details
| Field | Description |
|---|---|
status | pending, filled, or failed |
filledContracts | Number of contracts executed |
avgFillPriceUsd | Average execution price |
totalCostUsd | Total cost of filled portion |
feesPaidUsd | Fees charged |
createdAt | Unix timestamp of order creation |
filledAt | Unix timestamp of fill completion |
Get All Orders
Get Order Status
UseGET /orders/status/{orderPubkey} for detailed status and event history.
Transaction History
UseGET /history to retrieve a complete audit trail of all prediction market activity.
| Parameter | Type | Description |
|---|---|---|
ownerPubkey | string | Wallet public key |
positionPubkey | string | Filter by specific position |
start | number | Start timestamp or index |
end | number | End timestamp or index |
id | string | Filter by specific event ID |
Event Types
| Event Type | Description |
|---|---|
order_created | New order placed on-chain |
order_filled | Order matched and executed |
order_failed | Order could not be filled |
position_updated | Position modified by order fill |
position_lost | Market resolved against position |
payout_claimed | Winnings withdrawn |
