Close a Hedge
curl --request POST \
--url https://api.marks.finance/api/v2/partners/hedges/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"market": "USDTNGN",
"side": "sell"
}
'import requests
url = "https://api.marks.finance/api/v2/partners/hedges/close"
payload = {
"market": "USDTNGN",
"side": "sell"
}
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({market: 'USDTNGN', side: 'sell'})
};
fetch('https://api.marks.finance/api/v2/partners/hedges/close', 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.marks.finance/api/v2/partners/hedges/close",
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([
'market' => 'USDTNGN',
'side' => 'sell'
]),
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.marks.finance/api/v2/partners/hedges/close"
payload := strings.NewReader("{\n \"market\": \"USDTNGN\",\n \"side\": \"sell\"\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.marks.finance/api/v2/partners/hedges/close")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"market\": \"USDTNGN\",\n \"side\": \"sell\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.marks.finance/api/v2/partners/hedges/close")
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 \"market\": \"USDTNGN\",\n \"side\": \"sell\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"status": "submitted",
"order_tx_hash": "0x9c1e4f2a7b8d3e6c5a0f1b2d4e6a8c0f2b4d6e8a1c3f5b7d9e0a2c4f6b8d0e2a",
"market": "USDTNGN",
"side": "sell"
},
"error": null,
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}Hedges
Close a Hedge
Fully closes your open position on a market and side. Returns submitted with an order_tx_hash; it’s filled shortly after, and GET /positions returns to flat once it drains. Pass an Idempotency-Key to make retries safe.
POST
/
hedges
/
close
Close a Hedge
curl --request POST \
--url https://api.marks.finance/api/v2/partners/hedges/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"market": "USDTNGN",
"side": "sell"
}
'import requests
url = "https://api.marks.finance/api/v2/partners/hedges/close"
payload = {
"market": "USDTNGN",
"side": "sell"
}
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({market: 'USDTNGN', side: 'sell'})
};
fetch('https://api.marks.finance/api/v2/partners/hedges/close', 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.marks.finance/api/v2/partners/hedges/close",
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([
'market' => 'USDTNGN',
'side' => 'sell'
]),
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.marks.finance/api/v2/partners/hedges/close"
payload := strings.NewReader("{\n \"market\": \"USDTNGN\",\n \"side\": \"sell\"\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.marks.finance/api/v2/partners/hedges/close")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"market\": \"USDTNGN\",\n \"side\": \"sell\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.marks.finance/api/v2/partners/hedges/close")
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 \"market\": \"USDTNGN\",\n \"side\": \"sell\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"status": "submitted",
"order_tx_hash": "0x9c1e4f2a7b8d3e6c5a0f1b2d4e6a8c0f2b4d6e8a1c3f5b7d9e0a2c4f6b8d0e2a",
"market": "USDTNGN",
"side": "sell"
},
"error": null,
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}{
"data": null,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {}
}Authorizations
Partner API key: mk_live_... (production) or mk_test_... (sandbox).
Body
application/json
⌘I

