Get Open Positions
curl --request POST \
--url https://gateway.varchev.com/crypto/getOpenPositions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'tenantId: <tenantid>' \
--data '
{
"nonce": "-94796627",
"txid": "nostrud amet ut",
"docalcs": false,
"consolidation": "market"
}
'import requests
url = "https://gateway.varchev.com/crypto/getOpenPositions"
payload = {
"nonce": "-94796627",
"txid": "nostrud amet ut",
"docalcs": False,
"consolidation": "market"
}
headers = {
"tenantId": "<tenantid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
tenantId: '<tenantid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
nonce: '-94796627',
txid: 'nostrud amet ut',
docalcs: false,
consolidation: 'market'
})
};
fetch('https://gateway.varchev.com/crypto/getOpenPositions', 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://gateway.varchev.com/crypto/getOpenPositions",
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([
'nonce' => '-94796627',
'txid' => 'nostrud amet ut',
'docalcs' => false,
'consolidation' => 'market'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"tenantId: <tenantid>"
],
]);
$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://gateway.varchev.com/crypto/getOpenPositions"
payload := strings.NewReader("{\n \"nonce\": \"-94796627\",\n \"txid\": \"nostrud amet ut\",\n \"docalcs\": false,\n \"consolidation\": \"market\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("tenantId", "<tenantid>")
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://gateway.varchev.com/crypto/getOpenPositions")
.header("tenantId", "<tenantid>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"nonce\": \"-94796627\",\n \"txid\": \"nostrud amet ut\",\n \"docalcs\": false,\n \"consolidation\": \"market\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.varchev.com/crypto/getOpenPositions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["tenantId"] = '<tenantid>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"nonce\": \"-94796627\",\n \"txid\": \"nostrud amet ut\",\n \"docalcs\": false,\n \"consolidation\": \"market\"\n}"
response = http.request(request)
puts response.read_body{
"error": [],
"result": {
"TF5GVO-T7ZZ2-6NBKBI": {
"ordertxid": "OLWNFG-LLH4R-D6SFFP",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1605280097.8294,
"type": "buy",
"ordertype": "limit",
"cost": "104610.52842",
"fee": "289.06565",
"vol": "8.82412861",
"vol_closed": "0.20200000",
"margin": "20922.10568",
"value": "258797.5",
"net": "+154186.9728",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
},
"T24DOR-TAFLM-ID3NYP": {
"ordertxid": "OIVYGZ-M5EHU-ZRUQXX",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1607943827.3172,
"type": "buy",
"ordertype": "limit",
"cost": "145756.76856",
"fee": "335.24057",
"vol": "8.00000000",
"vol_closed": "0.00000000",
"margin": "29151.35371",
"value": "240124.0",
"net": "+94367.2314",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
},
"TYMRFG-URRG5-2ZTQSD": {
"ordertxid": "OF5WFH-V57DP-QANDAC",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1610448039.8374,
"type": "buy",
"ordertype": "limit",
"cost": "0.00240",
"fee": "0.00000",
"vol": "0.00000010",
"vol_closed": "0.00000000",
"margin": "0.00048",
"value": "0",
"net": "+0.0006",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
},
"TAFGBN-TZNFC-7CCYIM": {
"ordertxid": "OF5WFH-V57DP-QANDAC",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1610448039.8448,
"type": "buy",
"ordertype": "limit",
"cost": "2.40000",
"fee": "0.00264",
"vol": "0.00010000",
"vol_closed": "0.00000000",
"margin": "0.48000",
"value": "3.0",
"net": "+0.6015",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
},
"T4O5L3-4VGS4-IRU2UL": {
"ordertxid": "OF5WFH-V57DP-QANDAC",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1610448040.7722,
"type": "buy",
"ordertype": "limit",
"cost": "21.59760",
"fee": "0.02376",
"vol": "0.00089990",
"vol_closed": "0.00000000",
"margin": "4.31952",
"value": "27.0",
"net": "+5.4133",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
}
}
}Private
Get Open Positions
Get information about open margin positions.
POST
/
getOpenPositions
Get Open Positions
curl --request POST \
--url https://gateway.varchev.com/crypto/getOpenPositions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'tenantId: <tenantid>' \
--data '
{
"nonce": "-94796627",
"txid": "nostrud amet ut",
"docalcs": false,
"consolidation": "market"
}
'import requests
url = "https://gateway.varchev.com/crypto/getOpenPositions"
payload = {
"nonce": "-94796627",
"txid": "nostrud amet ut",
"docalcs": False,
"consolidation": "market"
}
headers = {
"tenantId": "<tenantid>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
tenantId: '<tenantid>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
nonce: '-94796627',
txid: 'nostrud amet ut',
docalcs: false,
consolidation: 'market'
})
};
fetch('https://gateway.varchev.com/crypto/getOpenPositions', 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://gateway.varchev.com/crypto/getOpenPositions",
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([
'nonce' => '-94796627',
'txid' => 'nostrud amet ut',
'docalcs' => false,
'consolidation' => 'market'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"tenantId: <tenantid>"
],
]);
$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://gateway.varchev.com/crypto/getOpenPositions"
payload := strings.NewReader("{\n \"nonce\": \"-94796627\",\n \"txid\": \"nostrud amet ut\",\n \"docalcs\": false,\n \"consolidation\": \"market\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("tenantId", "<tenantid>")
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://gateway.varchev.com/crypto/getOpenPositions")
.header("tenantId", "<tenantid>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"nonce\": \"-94796627\",\n \"txid\": \"nostrud amet ut\",\n \"docalcs\": false,\n \"consolidation\": \"market\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.varchev.com/crypto/getOpenPositions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["tenantId"] = '<tenantid>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"nonce\": \"-94796627\",\n \"txid\": \"nostrud amet ut\",\n \"docalcs\": false,\n \"consolidation\": \"market\"\n}"
response = http.request(request)
puts response.read_body{
"error": [],
"result": {
"TF5GVO-T7ZZ2-6NBKBI": {
"ordertxid": "OLWNFG-LLH4R-D6SFFP",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1605280097.8294,
"type": "buy",
"ordertype": "limit",
"cost": "104610.52842",
"fee": "289.06565",
"vol": "8.82412861",
"vol_closed": "0.20200000",
"margin": "20922.10568",
"value": "258797.5",
"net": "+154186.9728",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
},
"T24DOR-TAFLM-ID3NYP": {
"ordertxid": "OIVYGZ-M5EHU-ZRUQXX",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1607943827.3172,
"type": "buy",
"ordertype": "limit",
"cost": "145756.76856",
"fee": "335.24057",
"vol": "8.00000000",
"vol_closed": "0.00000000",
"margin": "29151.35371",
"value": "240124.0",
"net": "+94367.2314",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
},
"TYMRFG-URRG5-2ZTQSD": {
"ordertxid": "OF5WFH-V57DP-QANDAC",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1610448039.8374,
"type": "buy",
"ordertype": "limit",
"cost": "0.00240",
"fee": "0.00000",
"vol": "0.00000010",
"vol_closed": "0.00000000",
"margin": "0.00048",
"value": "0",
"net": "+0.0006",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
},
"TAFGBN-TZNFC-7CCYIM": {
"ordertxid": "OF5WFH-V57DP-QANDAC",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1610448039.8448,
"type": "buy",
"ordertype": "limit",
"cost": "2.40000",
"fee": "0.00264",
"vol": "0.00010000",
"vol_closed": "0.00000000",
"margin": "0.48000",
"value": "3.0",
"net": "+0.6015",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
},
"T4O5L3-4VGS4-IRU2UL": {
"ordertxid": "OF5WFH-V57DP-QANDAC",
"posstatus": "open",
"pair": "XXBTZUSD",
"time": 1610448040.7722,
"type": "buy",
"ordertype": "limit",
"cost": "21.59760",
"fee": "0.02376",
"vol": "0.00089990",
"vol_closed": "0.00000000",
"margin": "4.31952",
"value": "27.0",
"net": "+5.4133",
"terms": "0.0100% per 4 hours",
"rollovertm": "1616672637",
"misc": "",
"oflags": ""
}
}
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Response
200 - application/json
OK
The response is of type object.
⌘I

