GET /v2/trade/perps/positions: Positions and TP/SL
curl --request GET \
--url https://partner-api.bravadotrade.com/v2/trade/perps/positions \
--header 'Content-Type: application/json' \
--data '
{
"take_profit": {
"trigger_price": "<string>"
},
"stop_loss": {
"trigger_price": "<string>"
}
}
'import requests
url = "https://partner-api.bravadotrade.com/v2/trade/perps/positions"
payload = {
"take_profit": { "trigger_price": "<string>" },
"stop_loss": { "trigger_price": "<string>" }
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
take_profit: {trigger_price: '<string>'},
stop_loss: {trigger_price: '<string>'}
})
};
fetch('https://partner-api.bravadotrade.com/v2/trade/perps/positions', 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://partner-api.bravadotrade.com/v2/trade/perps/positions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'take_profit' => [
'trigger_price' => '<string>'
],
'stop_loss' => [
'trigger_price' => '<string>'
]
]),
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://partner-api.bravadotrade.com/v2/trade/perps/positions"
payload := strings.NewReader("{\n \"take_profit\": {\n \"trigger_price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://partner-api.bravadotrade.com/v2/trade/perps/positions")
.header("Content-Type", "application/json")
.body("{\n \"take_profit\": {\n \"trigger_price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partner-api.bravadotrade.com/v2/trade/perps/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"take_profit\": {\n \"trigger_price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodyPerps
GET /v2/trade/perps/positions: Positions and TP/SL
The user’s open Polymarket Perps positions with their take-profit and stop-loss, and the route that sets them. Scopes perps.read and trade.perps.
GET
/
v2
/
trade
/
perps
/
positions
GET /v2/trade/perps/positions: Positions and TP/SL
curl --request GET \
--url https://partner-api.bravadotrade.com/v2/trade/perps/positions \
--header 'Content-Type: application/json' \
--data '
{
"take_profit": {
"trigger_price": "<string>"
},
"stop_loss": {
"trigger_price": "<string>"
}
}
'import requests
url = "https://partner-api.bravadotrade.com/v2/trade/perps/positions"
payload = {
"take_profit": { "trigger_price": "<string>" },
"stop_loss": { "trigger_price": "<string>" }
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
take_profit: {trigger_price: '<string>'},
stop_loss: {trigger_price: '<string>'}
})
};
fetch('https://partner-api.bravadotrade.com/v2/trade/perps/positions', 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://partner-api.bravadotrade.com/v2/trade/perps/positions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'take_profit' => [
'trigger_price' => '<string>'
],
'stop_loss' => [
'trigger_price' => '<string>'
]
]),
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://partner-api.bravadotrade.com/v2/trade/perps/positions"
payload := strings.NewReader("{\n \"take_profit\": {\n \"trigger_price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("GET", 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.get("https://partner-api.bravadotrade.com/v2/trade/perps/positions")
.header("Content-Type", "application/json")
.body("{\n \"take_profit\": {\n \"trigger_price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partner-api.bravadotrade.com/v2/trade/perps/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"take_profit\": {\n \"trigger_price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_bodySign each request with a fresh HMAC signature. The cURL and HTTP header values below are placeholders, not reusable credentials. For runnable signing code, use request signing examples.
List positions
Open positions, with their take-profit and stop-loss. Scopeperps.read.
GET https://partner-api.bravadotrade.com/v2/trade/perps/positions
Query Parameters
integer
Only the position on this instrument.
Example
curl -G https://partner-api.bravadotrade.com/v2/trade/perps/positions \
-H "X-BRAVADO-API-KEY: $BRAVADO_API_KEY" \
-H "X-BRAVADO-TIMESTAMP: <unix-ms>" \
-H "X-BRAVADO-SIGNATURE: <signature-for-this-request>" \
-d instrument_id=1
Set take-profit and stop-loss
Sets the position’s take-profit and stop-loss, replacing what was armed. Scopetrade.perps; Idempotency-Key is required.
POST https://partner-api.bravadotrade.com/v2/trade/perps/positions/{instrument_id}/tpsl
order_id with DELETE /v2/trade/perps/orders/{id} or replace it here. DELETE /v2/trade/perps/orders does not cancel it.
Path Parameters
string
required
The venue instrument id of the position.
Body
At least one of the two.Errors
| Status | When |
|---|---|
409 Conflict | POSITION_OR_ORDERS_EXIST with reason: "no_position": TP/SL needs an open position on the instrument |
Example
curl -X POST https://partner-api.bravadotrade.com/v2/trade/perps/positions/1/tpsl \
-H "X-BRAVADO-API-KEY: $BRAVADO_API_KEY" \
-H "X-BRAVADO-TIMESTAMP: <unix-ms>" \
-H "X-BRAVADO-SIGNATURE: <signature-for-this-request>" \
-H "Idempotency-Key: 5f3b8c2a-perps-tpsl-0001" \
-H "Content-Type: application/json" \
-d '{ "take_profit": { "trigger_price": "90000" }, "stop_loss": { "trigger_price": "76000" } }'
Related
POST /v2/trade/perps/ordersto attach TP/SL when placing an order, or to close a position.