curl --request POST \
--url https://api.datadash.xyz/api/v1/positions/active \
--header 'Content-Type: application/json' \
--data '
{
"orderBy": [
{
"direction": "desc",
"field": "value"
}
],
"page": {
"limit": 50,
"offset": 0
},
"userId": {
"operator": "in",
"value": [
"0x1234567890abcdef1234567890abcdef12345678"
]
}
}
'import requests
url = "https://api.datadash.xyz/api/v1/positions/active"
payload = {
"orderBy": [
{
"direction": "desc",
"field": "value"
}
],
"page": {
"limit": 50,
"offset": 0
},
"userId": {
"operator": "in",
"value": ["0x1234567890abcdef1234567890abcdef12345678"]
}
}
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({
orderBy: [{direction: 'desc', field: 'value'}],
page: {limit: 50, offset: 0},
userId: {operator: 'in', value: ['0x1234567890abcdef1234567890abcdef12345678']}
})
};
fetch('https://api.datadash.xyz/api/v1/positions/active', 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/positions/active",
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([
'orderBy' => [
[
'direction' => 'desc',
'field' => 'value'
]
],
'page' => [
'limit' => 50,
'offset' => 0
],
'userId' => [
'operator' => 'in',
'value' => [
'0x1234567890abcdef1234567890abcdef12345678'
]
]
]),
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/positions/active"
payload := strings.NewReader("{\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"value\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n },\n \"userId\": {\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\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/positions/active")
.header("Content-Type", "application/json")
.body("{\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"value\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n },\n \"userId\": {\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datadash.xyz/api/v1/positions/active")
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 \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"value\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n },\n \"userId\": {\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body[
{
"avgBuyPrice": 123,
"invested": 123,
"roi": 123,
"shares": 123,
"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
},
"tokenId": "<string>",
"unrealizedCurrentPrice": 123,
"unrealizedPnl": 123,
"value": 123
}
]{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Active Position
Currently held (open) positions with unrealized PnL for a wallet or cohort. One row per position token; open (unresolved) markets only.
curl --request POST \
--url https://api.datadash.xyz/api/v1/positions/active \
--header 'Content-Type: application/json' \
--data '
{
"orderBy": [
{
"direction": "desc",
"field": "value"
}
],
"page": {
"limit": 50,
"offset": 0
},
"userId": {
"operator": "in",
"value": [
"0x1234567890abcdef1234567890abcdef12345678"
]
}
}
'import requests
url = "https://api.datadash.xyz/api/v1/positions/active"
payload = {
"orderBy": [
{
"direction": "desc",
"field": "value"
}
],
"page": {
"limit": 50,
"offset": 0
},
"userId": {
"operator": "in",
"value": ["0x1234567890abcdef1234567890abcdef12345678"]
}
}
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({
orderBy: [{direction: 'desc', field: 'value'}],
page: {limit: 50, offset: 0},
userId: {operator: 'in', value: ['0x1234567890abcdef1234567890abcdef12345678']}
})
};
fetch('https://api.datadash.xyz/api/v1/positions/active', 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/positions/active",
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([
'orderBy' => [
[
'direction' => 'desc',
'field' => 'value'
]
],
'page' => [
'limit' => 50,
'offset' => 0
],
'userId' => [
'operator' => 'in',
'value' => [
'0x1234567890abcdef1234567890abcdef12345678'
]
]
]),
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/positions/active"
payload := strings.NewReader("{\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"value\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n },\n \"userId\": {\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\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/positions/active")
.header("Content-Type", "application/json")
.body("{\n \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"value\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n },\n \"userId\": {\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datadash.xyz/api/v1/positions/active")
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 \"orderBy\": [\n {\n \"direction\": \"desc\",\n \"field\": \"value\"\n }\n ],\n \"page\": {\n \"limit\": 50,\n \"offset\": 0\n },\n \"userId\": {\n \"operator\": \"in\",\n \"value\": [\n \"0x1234567890abcdef1234567890abcdef12345678\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body[
{
"avgBuyPrice": 123,
"invested": 123,
"roi": 123,
"shares": 123,
"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
},
"tokenId": "<string>",
"unrealizedCurrentPrice": 123,
"unrealizedPnl": 123,
"value": 123
}
]{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Body
Show child attributes
Show child attributes
User wallet address
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
- 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: Market (embedding + full-text relevance).
Response
List of Active Position rows
Average buying price of open shares
Total amount invested in the position
Return on investment percentage
Currently held shares
Resolved Token row.
Show child attributes
Show child attributes
The CLOB token ID representing the position.
Current price of the position
Unrealized profit and loss
Current market value of held shares