This quickstart assumes familiarity with Solana’s token accounts and RPC
connections. If unfamiliar, please refer to the Solana
Cookbook.
Overview
To retrieve a user’s prediction market positions, you’ll need to:- Fetch all token accounts owned by the user
- Filter for outcome tokens
- Map outcome token mints to market details using the Metadata API
- Calculate position values
1
Fetch User's Token Accounts
Use Solana’s
getTokenAccountsByOwner RPC method to retrieve all token accounts for a given user wallet.Fetch Token Accounts
Fetch Token Accounts
2
Identify Prediction Market Tokens
Use the
/api/v1/filter_outcome_mints endpoint to filter the user’s token addresses and return only those that are prediction market outcome mints.Filter Prediction Market Tokens
Filter Prediction Market Tokens
3
Fetch Market Details
Use the
/api/v1/markets/batch endpoint to retrieve detailed market information for all outcome tokens in a single request, including event details, pricing, volume, and settlement status.Get Market Details
Get Market Details
API Response Structure
The/api/v1/markets/batch endpoint returns comprehensive market data including:
- Market Information: Title, subtitle, event ticker, category
- Accounts: Token mint addresses (yesMint, noMint, marketLedger)
- Timing: Open time, close time, expiration time
- Market Data: Volume, open interest, status
- Settlement: Result (if market is resolved)
- Rules: Primary and secondary market rules