Positions
Set a perpetual's margin mode and/or leverage.
Returns a command acceptance; the change is applied by the account’s
engine instance. Requires x-idempotency-key.
POST
/
trade
/
perp
/
margin
Set a perpetual's margin mode and/or leverage.
curl --request POST \
--url https://api.hyperprop.com/trade/perp/margin \
--header 'Content-Type: application/json'import requests
url = "https://api.hyperprop.com/trade/perp/margin"
headers = {"Content-Type": "application/json"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Content-Type': 'application/json'}};
fetch('https://api.hyperprop.com/trade/perp/margin', 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.hyperprop.com/trade/perp/margin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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"
"net/http"
"io"
)
func main() {
url := "https://api.hyperprop.com/trade/perp/margin"
req, _ := http.NewRequest("POST", url, nil)
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.hyperprop.com/trade/perp/margin")
.header("Content-Type", "application/json")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/perp/margin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
response = http.request(request)
puts response.read_body{
"accepted": true,
"command_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"command_type": "<string>",
"status": "<string>"
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}⌘I
Set a perpetual's margin mode and/or leverage.
curl --request POST \
--url https://api.hyperprop.com/trade/perp/margin \
--header 'Content-Type: application/json'import requests
url = "https://api.hyperprop.com/trade/perp/margin"
headers = {"Content-Type": "application/json"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Content-Type': 'application/json'}};
fetch('https://api.hyperprop.com/trade/perp/margin', 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.hyperprop.com/trade/perp/margin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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"
"net/http"
"io"
)
func main() {
url := "https://api.hyperprop.com/trade/perp/margin"
req, _ := http.NewRequest("POST", url, nil)
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.hyperprop.com/trade/perp/margin")
.header("Content-Type", "application/json")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/perp/margin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
response = http.request(request)
puts response.read_body{
"accepted": true,
"command_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"command_type": "<string>",
"status": "<string>"
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}