Get Position Held
curl --request GET \
--url http://localhost:8000/executors/positions/{connector_name}/{trading_pair} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://localhost:8000/executors/positions/{connector_name}/{trading_pair}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('http://localhost:8000/executors/positions/{connector_name}/{trading_pair}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/executors/positions/{connector_name}/{trading_pair}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/executors/positions/{connector_name}/{trading_pair}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/executors/positions/{connector_name}/{trading_pair}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/executors/positions/{connector_name}/{trading_pair}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"trading_pair": "<string>",
"connector_name": "<string>",
"account_name": "<string>",
"buy_amount_base": 123,
"buy_amount_quote": 123,
"sell_amount_base": 123,
"sell_amount_quote": 123,
"net_amount_base": 123,
"buy_breakeven_price": 123,
"sell_breakeven_price": 123,
"matched_amount_base": 123,
"unmatched_amount_base": 123,
"position_side": "<string>",
"realized_pnl_quote": 123,
"executor_count": 123,
"executor_ids": [
"<string>"
],
"last_updated": "<string>",
"controller_id": "main",
"cum_fees_quote": 0,
"unrealized_pnl_quote": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Executors
Get Position Held
Get held position for a specific connector/trading pair.
Returns the aggregated position from executors stopped with keep_position=True, including breakeven prices, matched/unmatched volume, realized PnL, and unrealized PnL.
Query parameters:
- controller_id: Controller ID (default “main”)
GET
/
executors
/
positions
/
{connector_name}
/
{trading_pair}
Get Position Held
curl --request GET \
--url http://localhost:8000/executors/positions/{connector_name}/{trading_pair} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "http://localhost:8000/executors/positions/{connector_name}/{trading_pair}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('http://localhost:8000/executors/positions/{connector_name}/{trading_pair}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/executors/positions/{connector_name}/{trading_pair}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/executors/positions/{connector_name}/{trading_pair}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8000/executors/positions/{connector_name}/{trading_pair}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/executors/positions/{connector_name}/{trading_pair}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"trading_pair": "<string>",
"connector_name": "<string>",
"account_name": "<string>",
"buy_amount_base": 123,
"buy_amount_quote": 123,
"sell_amount_base": 123,
"sell_amount_quote": 123,
"net_amount_base": 123,
"buy_breakeven_price": 123,
"sell_breakeven_price": 123,
"matched_amount_base": 123,
"unmatched_amount_base": 123,
"position_side": "<string>",
"realized_pnl_quote": 123,
"executor_count": 123,
"executor_ids": [
"<string>"
],
"last_updated": "<string>",
"controller_id": "main",
"cum_fees_quote": 0,
"unrealized_pnl_quote": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Response
Successful Response
API response model for PositionHold.
Controller that owns this position
Was this page helpful?

