Skip to main content

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

page
number
required
Page number (1-indexed).
pageSize
number
required
Items per page.
uid
string
User ID. Defaults to the authenticated user if omitted.
marketAddress
string
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
number
Total positions matching the query.
positions
array

Get Trade History

GET /api/v1/market/get-user-trades
Auth required: Yes Returns paginated trade history for the authenticated user.

Query Parameters

page
number
required
Page number (1-indexed).
pageSize
number
required
Items per page.
marketAddress
string
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

uid
string
required
User ID.
baseTokenAddress
string
required
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
  }
}
value
string
Total account value (balance + positions) in base token units.
balance
string
Available (uninvested) balance.
portfolio
string
Total value of open positions.
pnl
string
Total profit/loss.
decimal
number
Token decimal precision (e.g., 6 for USDC).
volume
string
Total trading volume.
pnlRank
number
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

uid
string
required
User ID.
timeInterval
string
required
Time range: 1d, 1w, 1m, 3m, all.
baseTokenAddress
string
required
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..."