curl --request POST \
--url https://api.datadash.xyz/api/v1/user-position \
--header 'Content-Type: application/json' \
--data '
{
"filter": [
{
"field": "userId",
"operator": "in",
"value": [
"0x1234567890abcdef1234567890abcdef12345678"
]
}
],
"orderBy": [
{
"direction": "desc",
"field": "realizedPnl"
}
],
"page": {
"limit": 50,
"offset": 0
}
}
'import requests
url = "https://api.datadash.xyz/api/v1/user-position"
payload = {
"filter": [
{
"field": "userId",
"operator": "in",
"value": ["0x1234567890abcdef1234567890abcdef12345678"]
}
],
"orderBy": [
{
"direction": "desc",
"field": "realizedPnl"
}
],
"page": {
"limit": 50,
"offset": 0
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
filter: [
{
field: 'userId',
operator: 'in',
value: ['0x1234567890abcdef1234567890abcdef12345678']
}
],
orderBy: [{direction: 'desc', field: 'realizedPnl'}],
page: {limit: 50, offset: 0}
})
};
fetch('https://api.datadash.xyz/api/v1/user-position', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.datadash.xyz/api/v1/user-position",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
[
'field' => 'userId',
'operator' => 'in',
'value' => [
'0x1234567890abcdef1234567890abcdef12345678'
]
]
],
'orderBy' => [
[
'direction' => 'desc',
'field' => 'realizedPnl'
]
],
'page' => [
'limit' => 50,
'offset' => 0
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.datadash.xyz/api/v1/user-position"
payload := strings.NewReader("{\n \"filter\": [\n {\n \"field\": \"userId\",\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n ],\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"realizedPnl\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.datadash.xyz/api/v1/user-position")
.header("Content-Type", "application/json")
.body("{\n \"filter\": [\n {\n \"field\": \"userId\",\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n ],\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"realizedPnl\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datadash.xyz/api/v1/user-position")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": [\n {\n \"field\": \"userId\",\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n ],\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"realizedPnl\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n }\n}"
response = http.request(request)
puts response.read_body[
{
"avgBuyingPrice": 123,
"avgSellingPrice": 123,
"currentlyHeldShares": 123,
"event": {
"active": true,
"archived": true,
"closed": true,
"description": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"icon": "<string>",
"id": 123,
"image": "<string>",
"liquidity": 123,
"openInterest": 123,
"seriesId": 123,
"slug": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"tagIds": [
123
],
"title": "<string>",
"topMarketGroupItemTitle": "<string>",
"topMarketOneDayPriceChange": 123,
"topMarketOneHourPriceChange": 123,
"topMarketOneMonthPriceChange": 123,
"topMarketOneWeekPriceChange": 123,
"topMarketOneYearPriceChange": 123,
"topMarketPrice": 123,
"topTokenName": "<string>",
"traders": 123,
"trades": 123,
"volume": 123,
"volume1mo": 123,
"volume1wk": 123,
"volume1yr": 123,
"volume24h": 123
},
"firstTradeTimestamp": "2023-11-07T05:31:56Z",
"latestTradeTimestamp": "2023-11-07T05:31:56Z",
"market": {
"active": true,
"archived": true,
"closed": true,
"description": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"eventId": 123,
"eventSlug": "<string>",
"groupItemTitle": "<string>",
"icon": "<string>",
"id": 123,
"image": "<string>",
"liquidity": 123,
"openInterest": 123,
"outcomeNames": [
"<string>"
],
"outcomePrices": [
123
],
"question": "<string>",
"slug": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"volume": 123,
"volume24h": 123
},
"positionSize": 123,
"realizedAvgBuyingPrice": 123,
"realizedPnl": 123,
"realizedPnlPercentage": 123,
"series": {
"active": true,
"archived": true,
"closed": true,
"featured": true,
"icon": "<string>",
"id": 123,
"image": "<string>",
"recurrence": "<string>",
"restricted": true,
"seriesType": "<string>",
"slug": "<string>",
"subtitle": "<string>",
"ticker": "<string>",
"title": "<string>"
},
"tags": [
{
"id": 123,
"label": "<string>",
"numEvents": 123,
"numTraders": 123,
"slug": "<string>"
}
],
"token": {
"eventId": 123,
"eventSlug": "<string>",
"isYesToken": true,
"marketClosed": true,
"marketClosedTime": "2023-11-07T05:31:56Z",
"marketEndDate": "2023-11-07T05:31:56Z",
"marketGroupItemTitle": "<string>",
"marketIcon": "<string>",
"marketId": 123,
"marketLiquidity": 123,
"marketOneDayPriceChange": 123,
"marketOpenInterest": 123,
"marketQuestion": "<string>",
"marketSlug": "<string>",
"marketStartDate": "2023-11-07T05:31:56Z",
"marketTraders": 123,
"marketTrades": 123,
"marketVolume": 123,
"marketVolume24h": 123,
"positionId": 123,
"tagIds": [
123
],
"tokenId": "<string>",
"tokenName": "<string>",
"tokenPrice": 123
},
"totalBoughtShares": 123,
"totalBoughtUsd": 123,
"totalBuyCost": 123,
"totalSoldShares": 123,
"totalSoldUsd": 123,
"totalTrades": 123,
"unrealizedUsd": 123,
"user": {
"bio": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"displayName": "<string>",
"pnl": 123,
"profileImageUrl": "<string>",
"pseudonym": "<string>",
"rank": 123,
"userId": "<string>",
"verifiedBadge": true,
"xUsername": "<string>"
}
}
]{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}User Position
Lifetime per-position trading stats for a wallet, bought/sold shares and USD, entry/exit prices, realized and unrealized PnL. One row per (wallet, position token); see positions/all for the event-grouped portfolio view.
curl --request POST \
--url https://api.datadash.xyz/api/v1/user-position \
--header 'Content-Type: application/json' \
--data '
{
"filter": [
{
"field": "userId",
"operator": "in",
"value": [
"0x1234567890abcdef1234567890abcdef12345678"
]
}
],
"orderBy": [
{
"direction": "desc",
"field": "realizedPnl"
}
],
"page": {
"limit": 50,
"offset": 0
}
}
'import requests
url = "https://api.datadash.xyz/api/v1/user-position"
payload = {
"filter": [
{
"field": "userId",
"operator": "in",
"value": ["0x1234567890abcdef1234567890abcdef12345678"]
}
],
"orderBy": [
{
"direction": "desc",
"field": "realizedPnl"
}
],
"page": {
"limit": 50,
"offset": 0
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
filter: [
{
field: 'userId',
operator: 'in',
value: ['0x1234567890abcdef1234567890abcdef12345678']
}
],
orderBy: [{direction: 'desc', field: 'realizedPnl'}],
page: {limit: 50, offset: 0}
})
};
fetch('https://api.datadash.xyz/api/v1/user-position', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.datadash.xyz/api/v1/user-position",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
[
'field' => 'userId',
'operator' => 'in',
'value' => [
'0x1234567890abcdef1234567890abcdef12345678'
]
]
],
'orderBy' => [
[
'direction' => 'desc',
'field' => 'realizedPnl'
]
],
'page' => [
'limit' => 50,
'offset' => 0
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.datadash.xyz/api/v1/user-position"
payload := strings.NewReader("{\n \"filter\": [\n {\n \"field\": \"userId\",\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n ],\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"realizedPnl\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.datadash.xyz/api/v1/user-position")
.header("Content-Type", "application/json")
.body("{\n \"filter\": [\n {\n \"field\": \"userId\",\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n ],\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"realizedPnl\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datadash.xyz/api/v1/user-position")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": [\n {\n \"field\": \"userId\",\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n ],\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"realizedPnl\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n }\n}"
response = http.request(request)
puts response.read_body[
{
"avgBuyingPrice": 123,
"avgSellingPrice": 123,
"currentlyHeldShares": 123,
"event": {
"active": true,
"archived": true,
"closed": true,
"description": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"icon": "<string>",
"id": 123,
"image": "<string>",
"liquidity": 123,
"openInterest": 123,
"seriesId": 123,
"slug": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"tagIds": [
123
],
"title": "<string>",
"topMarketGroupItemTitle": "<string>",
"topMarketOneDayPriceChange": 123,
"topMarketOneHourPriceChange": 123,
"topMarketOneMonthPriceChange": 123,
"topMarketOneWeekPriceChange": 123,
"topMarketOneYearPriceChange": 123,
"topMarketPrice": 123,
"topTokenName": "<string>",
"traders": 123,
"trades": 123,
"volume": 123,
"volume1mo": 123,
"volume1wk": 123,
"volume1yr": 123,
"volume24h": 123
},
"firstTradeTimestamp": "2023-11-07T05:31:56Z",
"latestTradeTimestamp": "2023-11-07T05:31:56Z",
"market": {
"active": true,
"archived": true,
"closed": true,
"description": "<string>",
"endDate": "2023-11-07T05:31:56Z",
"eventId": 123,
"eventSlug": "<string>",
"groupItemTitle": "<string>",
"icon": "<string>",
"id": 123,
"image": "<string>",
"liquidity": 123,
"openInterest": 123,
"outcomeNames": [
"<string>"
],
"outcomePrices": [
123
],
"question": "<string>",
"slug": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"volume": 123,
"volume24h": 123
},
"positionSize": 123,
"realizedAvgBuyingPrice": 123,
"realizedPnl": 123,
"realizedPnlPercentage": 123,
"series": {
"active": true,
"archived": true,
"closed": true,
"featured": true,
"icon": "<string>",
"id": 123,
"image": "<string>",
"recurrence": "<string>",
"restricted": true,
"seriesType": "<string>",
"slug": "<string>",
"subtitle": "<string>",
"ticker": "<string>",
"title": "<string>"
},
"tags": [
{
"id": 123,
"label": "<string>",
"numEvents": 123,
"numTraders": 123,
"slug": "<string>"
}
],
"token": {
"eventId": 123,
"eventSlug": "<string>",
"isYesToken": true,
"marketClosed": true,
"marketClosedTime": "2023-11-07T05:31:56Z",
"marketEndDate": "2023-11-07T05:31:56Z",
"marketGroupItemTitle": "<string>",
"marketIcon": "<string>",
"marketId": 123,
"marketLiquidity": 123,
"marketOneDayPriceChange": 123,
"marketOpenInterest": 123,
"marketQuestion": "<string>",
"marketSlug": "<string>",
"marketStartDate": "2023-11-07T05:31:56Z",
"marketTraders": 123,
"marketTrades": 123,
"marketVolume": 123,
"marketVolume24h": 123,
"positionId": 123,
"tagIds": [
123
],
"tokenId": "<string>",
"tokenName": "<string>",
"tokenPrice": 123
},
"totalBoughtShares": 123,
"totalBoughtUsd": 123,
"totalBuyCost": 123,
"totalSoldShares": 123,
"totalSoldUsd": 123,
"totalTrades": 123,
"unrealizedUsd": 123,
"user": {
"bio": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"displayName": "<string>",
"pnl": 123,
"profileImageUrl": "<string>",
"pseudonym": "<string>",
"rank": 123,
"userId": "<string>",
"verifiedBadge": true,
"xUsername": "<string>"
}
}
]{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Body
Show child attributes
Show child attributes
Filters to apply, combined with AND. Use a group for OR.
1A single field condition. in/notIn take an array of values; matches/notMatches take one search term.
- Numeric
- ID
- Wallet address
- Time range
- User Profile Lookup
- User Tag Profile Lookup
- Group
Show child attributes
Show child attributes
Sort keys in priority order; the first is the primary sort. Defaults to the table's configured ranking when omitted.
Show child attributes
Show child attributes
Free-text search over: User (prefix match/full-text search).
Response
List of User Position rows
Average buying price per share
Average selling price per share
Shares currently held
Resolved Event row.
Show child attributes
Show child attributes
Timestamp of the first trade
Timestamp of the latest trade
Resolved Market row.
Show child attributes
Show child attributes
Size of Position
Average buying price per share for sold shares
Realized profit and loss
Realized PnL as a percentage
Resolved Series row.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Resolved Token row.
Show child attributes
Show child attributes
Total shares bought
Total USD spent buying
Total cost basis for sold shares
Total shares sold
Total USD received from selling
Total number of trades done by the user for this position.
Unrealized USD value aka unrealized value
Resolved User row.
Show child attributes
Show child attributes