Positions
The Positions API provides access to your active trading positions across all markets on the Xmarket platform.
Get Positions List
Retrieve a paginated list of your positions with filtering and search options.
Get list of positions (paginated, status=all, sorted by createdAt, supports partial name search via ?search=)
Page number
1Example: 1Pattern: ^\d+$Page size
20Example: 20Pattern: ^\d+$Sort by createdAt
latestTradeExample: latestTradePossible values: Filter by status
allExample: allPossible values: List of positions
Bad request
Internal server error
Position Status
Positions can have the following statuses:
open
Position is active with unrealized gains/losses
closed
Position has been closed and profits realized
settled
Market resolved and position automatically settled
Understanding Positions
A position represents your holdings in a specific market outcome. Key properties include:
Outcome ID: The specific outcome you're trading
Quantity: Number of shares held
Average Price: Your average entry price
Current Price: Latest market price
Unrealized P&L: Current profit/loss (open positions)
Realized P&L: Actual profit/loss (closed positions)
Code Examples
Fetch All Open Positions
Calculate Total Portfolio Value
Common Use Cases
Portfolio Dashboard
Fetch all open positions to display current holdings, values, and unrealized P&L in a dashboard.
Position Monitoring
Set up alerts based on unrealized P&L thresholds by regularly polling positions endpoint.
Performance Analytics
Analyze closed positions to calculate historical performance metrics and win rates.
Market Exposure
Calculate exposure across different market categories by aggregating position values.
Related Documentation
Orders API - Create and manage orders to build positions
Markets API - Get market information for your positions
Orderbook API - Check current prices for position valuation
Quick Start - Get started with the API
Last updated
Was this helpful?