Set Trading Stop
curl --request POST \
--url https://api.cnt.ekiden.fi/api/v1/position/trading-stop \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sub_account_address": "<string>",
"symbol": "BTC-USDCx",
"active_price": "<string>",
"sl_size": "<string>",
"tp_size": "<string>",
"tpsl": {
"stop_loss": {
"market": {
"trigger_price": "<string>"
}
},
"take_profit": {
"market": {
"trigger_price": "<string>"
}
}
},
"trailing_stop": "<string>"
}
'import requests
url = "https://api.cnt.ekiden.fi/api/v1/position/trading-stop"
payload = {
"sub_account_address": "<string>",
"symbol": "BTC-USDCx",
"active_price": "<string>",
"sl_size": "<string>",
"tp_size": "<string>",
"tpsl": {
"stop_loss": { "market": { "trigger_price": "<string>" } },
"take_profit": { "market": { "trigger_price": "<string>" } }
},
"trailing_stop": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sub_account_address: '<string>',
symbol: 'BTC-USDCx',
active_price: '<string>',
sl_size: '<string>',
tp_size: '<string>',
tpsl: {
stop_loss: {market: {trigger_price: '<string>'}},
take_profit: {market: {trigger_price: '<string>'}}
},
trailing_stop: '<string>'
})
};
fetch('https://api.cnt.ekiden.fi/api/v1/position/trading-stop', 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.cnt.ekiden.fi/api/v1/position/trading-stop",
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([
'sub_account_address' => '<string>',
'symbol' => 'BTC-USDCx',
'active_price' => '<string>',
'sl_size' => '<string>',
'tp_size' => '<string>',
'tpsl' => [
'stop_loss' => [
'market' => [
'trigger_price' => '<string>'
]
],
'take_profit' => [
'market' => [
'trigger_price' => '<string>'
]
]
],
'trailing_stop' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.cnt.ekiden.fi/api/v1/position/trading-stop"
payload := strings.NewReader("{\n \"sub_account_address\": \"<string>\",\n \"symbol\": \"BTC-USDCx\",\n \"active_price\": \"<string>\",\n \"sl_size\": \"<string>\",\n \"tp_size\": \"<string>\",\n \"tpsl\": {\n \"stop_loss\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n },\n \"take_profit\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n }\n },\n \"trailing_stop\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.cnt.ekiden.fi/api/v1/position/trading-stop")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sub_account_address\": \"<string>\",\n \"symbol\": \"BTC-USDCx\",\n \"active_price\": \"<string>\",\n \"sl_size\": \"<string>\",\n \"tp_size\": \"<string>\",\n \"tpsl\": {\n \"stop_loss\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n },\n \"take_profit\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n }\n },\n \"trailing_stop\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cnt.ekiden.fi/api/v1/position/trading-stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sub_account_address\": \"<string>\",\n \"symbol\": \"BTC-USDCx\",\n \"active_price\": \"<string>\",\n \"sl_size\": \"<string>\",\n \"tp_size\": \"<string>\",\n \"tpsl\": {\n \"stop_loss\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n },\n \"take_profit\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n }\n },\n \"trailing_stop\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"time": "1672531200000"
}Position
Set Trading Stop
Set the take profit, stop loss or trailing stop for the position.
POST
/
api
/
v1
/
position
/
trading-stop
Set Trading Stop
curl --request POST \
--url https://api.cnt.ekiden.fi/api/v1/position/trading-stop \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sub_account_address": "<string>",
"symbol": "BTC-USDCx",
"active_price": "<string>",
"sl_size": "<string>",
"tp_size": "<string>",
"tpsl": {
"stop_loss": {
"market": {
"trigger_price": "<string>"
}
},
"take_profit": {
"market": {
"trigger_price": "<string>"
}
}
},
"trailing_stop": "<string>"
}
'import requests
url = "https://api.cnt.ekiden.fi/api/v1/position/trading-stop"
payload = {
"sub_account_address": "<string>",
"symbol": "BTC-USDCx",
"active_price": "<string>",
"sl_size": "<string>",
"tp_size": "<string>",
"tpsl": {
"stop_loss": { "market": { "trigger_price": "<string>" } },
"take_profit": { "market": { "trigger_price": "<string>" } }
},
"trailing_stop": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sub_account_address: '<string>',
symbol: 'BTC-USDCx',
active_price: '<string>',
sl_size: '<string>',
tp_size: '<string>',
tpsl: {
stop_loss: {market: {trigger_price: '<string>'}},
take_profit: {market: {trigger_price: '<string>'}}
},
trailing_stop: '<string>'
})
};
fetch('https://api.cnt.ekiden.fi/api/v1/position/trading-stop', 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.cnt.ekiden.fi/api/v1/position/trading-stop",
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([
'sub_account_address' => '<string>',
'symbol' => 'BTC-USDCx',
'active_price' => '<string>',
'sl_size' => '<string>',
'tp_size' => '<string>',
'tpsl' => [
'stop_loss' => [
'market' => [
'trigger_price' => '<string>'
]
],
'take_profit' => [
'market' => [
'trigger_price' => '<string>'
]
]
],
'trailing_stop' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.cnt.ekiden.fi/api/v1/position/trading-stop"
payload := strings.NewReader("{\n \"sub_account_address\": \"<string>\",\n \"symbol\": \"BTC-USDCx\",\n \"active_price\": \"<string>\",\n \"sl_size\": \"<string>\",\n \"tp_size\": \"<string>\",\n \"tpsl\": {\n \"stop_loss\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n },\n \"take_profit\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n }\n },\n \"trailing_stop\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.cnt.ekiden.fi/api/v1/position/trading-stop")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sub_account_address\": \"<string>\",\n \"symbol\": \"BTC-USDCx\",\n \"active_price\": \"<string>\",\n \"sl_size\": \"<string>\",\n \"tp_size\": \"<string>\",\n \"tpsl\": {\n \"stop_loss\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n },\n \"take_profit\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n }\n },\n \"trailing_stop\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cnt.ekiden.fi/api/v1/position/trading-stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sub_account_address\": \"<string>\",\n \"symbol\": \"BTC-USDCx\",\n \"active_price\": \"<string>\",\n \"sl_size\": \"<string>\",\n \"tp_size\": \"<string>\",\n \"tpsl\": {\n \"stop_loss\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n },\n \"take_profit\": {\n \"market\": {\n \"trigger_price\": \"<string>\"\n }\n }\n },\n \"trailing_stop\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"time": "1672531200000"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Set the take profit, stop loss or trailing stop for the position.
Example:
"BTC-USDCx"
Stop loss size valid for TP/SL partial mode, note: the value of tpSize and slSize must equal
Take profit size valid for TP/SL partial mode, note: the value of tpSize and slSize must equal
Show child attributes
Show child attributes
⌘I