Get Positions
GET /api/v1/market/get-user-positions
Auth required: No (but uid is needed to query another user)
Returns paginated positions for a user, including current price, PnL, and average entry price.
Query Parameters
User ID. Defaults to the authenticated user if omitted.
Filter positions to a specific market.
Example
curl "https://api-staging.promethex.market/api/v1/market/get-user-positions?page=1&pageSize=10" \
-H "Authorization: Bearer $PRIVY_JWT "
Response
{
"code" : 0 ,
"data" : {
"total" : 8 ,
"positions" : [
{
"marketAddress" : "0x1234...abcd" ,
"marketTitle" : "Will BTC hit $100k?" ,
"optionTitle" : "Yes" ,
"amount" : "15000000" ,
"avgPrice" : "0.62" ,
"currentPrice" : "0.65" ,
"pnl" : "450000" ,
"pnlPercent" : "4.8"
}
]
}
}
Total positions matching the query.
Option label (e.g., “Yes”).
Token balance in base token units.
Volume-weighted average entry price.
Current market price (0–1).
Profit/loss in base token units.
Get Trade History
GET /api/v1/market/get-user-trades
Auth required: Yes
Returns paginated trade history for the authenticated user.
Query Parameters
Filter trades to a specific market.
Example
curl "https://api-staging.promethex.market/api/v1/market/get-user-trades?page=1&pageSize=20" \
-H "Authorization: Bearer $PRIVY_JWT "
Get Portfolio Summary
GET /api/v1/market/get-user-asset-info
Auth required: Yes
Returns an aggregate portfolio summary: total value, balance, positions value, and PnL.
Query Parameters
Base token address to denominate the portfolio in.
Example
curl "https://api-staging.promethex.market/api/v1/market/get-user-asset-info?uid=12345&baseTokenAddress=0xUSDC..." \
-H "Authorization: Bearer $PRIVY_JWT "
Response
{
"code" : 0 ,
"data" : {
"value" : "125000000" ,
"balance" : "50000000" ,
"portfolio" : "75000000" ,
"pnl" : "12500000" ,
"decimal" : 6 ,
"volume" : "340000000" ,
"pnlRank" : 42
}
}
Total account value (balance + positions) in base token units.
Available (uninvested) balance.
Total value of open positions.
Token decimal precision (e.g., 6 for USDC).
User’s PnL leaderboard rank.
Get Asset History
GET /api/v1/user/get-user-asset-history
Auth required: Yes
Returns time-series data for portfolio value over time. Useful for rendering portfolio charts.
Query Parameters
Time range: 1d, 1w, 1m, 3m, all.
Base token address for denomination.
Example
curl "https://api-staging.promethex.market/api/v1/user/get-user-asset-history?uid=12345&timeInterval=1w&baseTokenAddress=0xUSDC..."