Endpoints for accessing user portfolio data including positions, trades, history, and rewards.
Official SDKs: Use
PortfolioFetcherfrom the Python SDK or TypeScript SDK for authenticated portfolio access.
All portfolio endpoints require authentication via X-API-Key header (recommended) or session cookie (deprecated).
Get all active positions with profit/loss data.
Authentication: Required (X-API-Key header or session cookie)
Response (200):
{
"rewards": {
"totalPoints": 1500,
"epochs": [
{
"epoch": 1,
"points": 500,
"tradingVolume": "10000000000"
}
]
},
"amm": [
{
"market": {
"slug": "btc-50k",
"title": "Will BTC hit $50k?"
},
"positions": {...},
"tokensBalance": {...}
}
],
"clob": [
{
"market": {
"address": "0x...",
"slug": "btc-100k",
"title": "Will BTC hit $100k?"
},
"positions": {
"yes": {
"cost": "75000000",
"fillPrice": "750000",
"realisedPnl": "0",
"unrealizedPnl": "25000000",
"marketValue": "100000000"
},
"no": {
"cost": "25000000",
"fillPrice": "250000",
"realisedPnl": "0",
"unrealizedPnl": "-5000000",
"marketValue": "20000000"
}
},
"tokensBalance": {
"yes": "100000000",
"no": "0"
},
"orders": {...},
"rewards": {...}
}
]
}Position Data Fields:
| Field | Type | Description |
|---|---|---|
cost |
string | Cost basis in USDC (6 decimals) |
fillPrice |
string | Average entry price (6 decimals) |
realisedPnl |
string | Realized P&L from closed positions |
unrealizedPnl |
string | Unrealized P&L at current price |
marketValue |
string | Current market value |
Usage:
response = requests.get(
"https://api.limitless.exchange/portfolio/positions",
cookies={"limitless_session": session_cookie}
)
positions = response.json()
for position in positions['clob']:
print(f"Market: {position['market']['title']}")
print(f" YES tokens: {int(position['tokensBalance']['yes']) / 1e6}")
print(f" Unrealized P&L: ${int(position['positions']['yes']['unrealizedPnl']) / 1e6}")Get all trades for the authenticated user.
Authentication: Required (X-API-Key header or session cookie)
Response (200):
{
"trades": [
{
"market": {
"slug": "btc-100k",
"title": "Will BTC hit $100k?"
},
"side": "BUY",
"outcome": "YES",
"price": 0.65,
"size": "100000000",
"total": "65000000",
"timestamp": "2024-01-15T10:30:00Z",
"txHash": "0x..."
}
]
}Get paginated transaction history.
Authentication: Required (X-API-Key header or session cookie)
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
page |
number | No | Page number |
limit |
number | No | Items per page |
Response (200):
{
"data": [
{
"blockTimestamp": 1744115608,
"collateralAmount": "65000000",
"market": {
"id": 980,
"slug": "btc-100k",
"title": "Will BTC hit $100k?",
"deadline": "2024-12-31T23:59:59Z",
"closed": false,
"collateral": {
"symbol": "USDC",
"id": 7,
"decimals": 6
},
"group": null
},
"outcomeTokenAmount": "100000000",
"outcomeTokenAmounts": ["100000000", "0"],
"outcomeIndex": 0,
"outcomeTokenPrice": 0.65,
"strategy": "Limit Buy",
"transactionHash": "0x..."
}
],
"totalCount": 50
}Strategy Types:
| Strategy | Description |
|---|---|
Buy |
AMM buy |
Sell |
AMM sell |
Limit Buy |
CLOB limit buy order filled |
Limit Sell |
CLOB limit sell order filled |
Market Buy |
Market order buy |
Market Sell |
Market order sell |
Split |
Split collateral into YES/NO tokens |
Merge |
Merge YES/NO tokens into collateral |
Convert |
Convert positions (NegRisk) |
Get points breakdown and rewards data.
Authentication: Required (X-API-Key header or session cookie)
Response (200):
{
"totalPoints": 15000,
"epochs": [
{
"epoch": 1,
"points": 5000,
"tradingVolume": "50000000000",
"liquidityProvided": "10000000000"
},
{
"epoch": 2,
"points": 10000,
"tradingVolume": "100000000000",
"liquidityProvided": "25000000000"
}
]
}Check USDC spending allowance for the CTF Exchange contract.
Authentication: Required (X-API-Key header or session cookie)
Response (200):
{
"allowance": "1000000000000",
"isApproved": true
}Notes:
allowanceis in USDC (6 decimals)isApprovedindicates if allowance is sufficient for trading
These endpoints allow viewing other users' public portfolio data.
Get total traded volume for a user.
Authentication: None required
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
account |
string | Ethereum address |
Response (200):
{
"totalVolume": "500000000000",
"volumeByMarket": [
{
"marketSlug": "btc-100k",
"volume": "100000000000"
}
]
}Get all positions for a specific user (public data only).
Authentication: None required
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
account |
string | Ethereum address |
Response (200):
{
"positions": [
{
"market": {
"slug": "btc-100k",
"title": "Will BTC hit $100k?"
},
"outcome": "YES",
"balance": "100000000"
}
]
}The total amount spent to acquire tokens, including fees.
Average price per token across all fills:
fillPrice = cost / tokensAcquired
Profit/loss if you sold at current market price:
unrealizedPnl = (currentPrice - fillPrice) * tokensBalance
Actual profit/loss from closed positions:
realisedPnl = sellAmount - costBasisOfSoldTokens
Current value of position at market prices:
marketValue = currentPrice * tokensBalance
response = requests.get(
"https://api.limitless.exchange/portfolio/positions",
cookies={"limitless_session": session_cookie}
)
positions = response.json()
total_value = 0
total_unrealized_pnl = 0
for pos in positions['clob']:
for outcome in ['yes', 'no']:
data = pos['positions'][outcome]
total_value += int(data['marketValue'])
total_unrealized_pnl += int(data['unrealizedPnl'])
print(f"Total Portfolio Value: ${total_value / 1e6:.2f}")
print(f"Total Unrealized P&L: ${total_unrealized_pnl / 1e6:.2f}")