Skip to main content

Get Active Positions

Retrieve a user’s currently active positions across all markets.
user
string
required
The user’s wallet address (normalized to lowercase)
limit
string
default:"50"
Number of positions to return (max 100)
offset
string
default:"0"
Number of records to skip for pagination
sortDirection
string
default:"DESC"
Sort direction: ASC or DESC
sizeThreshold
string
default:"0.01"
Minimum position size to include
market
string
Optional condition ID to filter positions for a specific market

Response

proxyWallet
string
The user’s proxy wallet address
asset
string
The asset token address
conditionId
string
The condition ID of the market
size
number
Number of shares held
avgPrice
number
Average purchase price per share
initialValue
number
Initial investment value in USD
currentValue
number
Current position value in USD
cashPnl
number
Cash profit/loss in USD
totalBought
number
Total amount spent on this position in USD
realizedPnl
number
Realized profit/loss in USD
percentPnl
number
Percentage profit/loss
percentRealizedPnl
number
Percentage realized profit/loss
curPrice
number
Current market price per share
redeemable
boolean
Whether the position can be redeemed
mergeable
boolean
Whether the position can be merged
title
string
Market title
slug
string
Market slug identifier
icon
string
URL to market icon
eventSlug
string
Event slug identifier
outcome
string
Outcome name
outcomeIndex
number
Outcome index (0 or 1)
oppositeOutcome
string
Name of the opposite outcome
oppositeAsset
string
Asset address of the opposite outcome
timestamp
number
Unix timestamp of last activity
orderCount
number
Number of orders in this position

Example Request

cURL
curl -X GET "https://api.kuest.com/v1/positions?user=0x1234...&limit=50&offset=0&sortDirection=DESC&sizeThreshold=0.01" \
  -H "Content-Type: application/json"
```bash

### Example Response

```json
[
  {
    "proxyWallet": "0x1234567890abcdef",
    "asset": "0xasset123...",
    "conditionId": "0xcondition456...",
    "size": 150.75,
    "avgPrice": 0.55,
    "initialValue": 82.91,
    "currentValue": 105.52,
    "cashPnl": 22.61,
    "totalBought": 82.91,
    "curPrice": 0.70,
    "percentPnl": 27.27,
    "redeemable": false,
    "mergeable": true,
    "title": "Will Bitcoin reach $100k in 2024?",
    "slug": "bitcoin-100k-2024",
    "icon": "https://cdn.kuest.com/icons/bitcoin.png",
    "eventSlug": "crypto-predictions",
    "outcome": "Yes",
    "outcomeIndex": 0,
    "oppositeOutcome": "No",
    "oppositeAsset": "0xasset789...",
    "timestamp": 1709500800,
    "orderCount": 3
  }
]
```bash

## Get Closed Positions

Retrieve a user's historical closed positions.

<ParamField query="user" type="string" required>
  The user's wallet address (normalized to lowercase)
</ParamField>

<ParamField query="limit" type="string" default="50">
  Number of positions to return (max 100)
</ParamField>

<ParamField query="offset" type="string" default="0">
  Number of records to skip for pagination
</ParamField>

<ParamField query="sortBy" type="string" default="TIMESTAMP">
  Sort field (typically `TIMESTAMP`)
</ParamField>

<ParamField query="sortDirection" type="string" default="DESC">
  Sort direction: `ASC` or `DESC`
</ParamField>

<ParamField query="sizeThreshold" type="string" default="0.01">
  Minimum position size to include
</ParamField>

<ParamField query="market" type="string">
  Optional condition ID to filter for a specific market
</ParamField>

### Example Request

```bash cURL
curl -X GET "https://api.kuest.com/v1/closed-positions?user=0x1234...&limit=50&offset=0&sortBy=TIMESTAMP&sortDirection=DESC" \
  -H "Content-Type: application/json"
```bash

## Get Portfolio Value

Retrieve the current total value of a user's portfolio.

<ParamField query="user" type="string" required>
  The user's wallet address
</ParamField>

### Response

Returns a number or object representing the total portfolio value in USD.

### Example Request

```bash cURL
curl -X GET "https://api.kuest.com/v1/value?user=0x1234..." \
  -H "Content-Type: application/json"
```bash

### Example Response

```json
{
  "value": 1234.56
}
```bash

## Get Trading Volume

Retrieve a user's total trading volume.

<ParamField query="user" type="string" required>
  The user's wallet address
</ParamField>

### Response

Returns the total trading volume in USD.

### Example Request

```bash cURL
curl -X GET "https://api.kuest.com/v1/volume?user=0x1234..." \
  -H "Content-Type: application/json"
```bash

### Example Response

```json
{
  "volume": 5678.90,
  "total_volume": 5678.90
}
```bash

## Get Markets Traded

Retrieve the number of unique markets a user has traded in.

<ParamField query="user" type="string" required>
  The user's wallet address
</ParamField>

### Response

Returns the number of markets the user has participated in.

### Example Request

```bash cURL
curl -X GET "https://api.kuest.com/v1/traded?user=0x1234..." \
  -H "Content-Type: application/json"
```bash

### Example Response

```json
{
  "traded": 42
}
```bash

<Note>
  All user addresses are normalized to lowercase. Position values are returned in USD. Use pagination for large result sets.
</Note>

Build docs developers (and LLMs) love