curl --request GET \
--url https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk \
--header 'X-Monaco-Signature: <api-key>'import requests
url = "https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk"
headers = {"X-Monaco-Signature": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Monaco-Signature': '<api-key>'}};
fetch('https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk', 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://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Monaco-Signature: <api-key>"
],
]);
$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://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Monaco-Signature", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk")
.header("X-Monaco-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Monaco-Signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"positionId": "<string>",
"markPrice": "<string>",
"indexPrice": "<string>",
"unrealizedPnl": "<string>",
"liquidationPrice": "<string>",
"marginRatio": "<string>",
"maintenanceMarginRequired": "<string>",
"initialMarginRequired": "<string>",
"updatedAt": "<string>"
}Get apiv1positions risk
curl --request GET \
--url https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk \
--header 'X-Monaco-Signature: <api-key>'import requests
url = "https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk"
headers = {"X-Monaco-Signature": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Monaco-Signature': '<api-key>'}};
fetch('https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk', 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://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Monaco-Signature: <api-key>"
],
]);
$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://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Monaco-Signature", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk")
.header("X-Monaco-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/positions/{positionId}/risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Monaco-Signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"positionId": "<string>",
"markPrice": "<string>",
"indexPrice": "<string>",
"unrealizedPnl": "<string>",
"liquidationPrice": "<string>",
"marginRatio": "<string>",
"maintenanceMarginRequired": "<string>",
"initialMarginRequired": "<string>",
"updatedAt": "<string>"
}Authorizations
Ed25519 session-key request signing. Every authenticated request carries three headers: X-Monaco-PublicKey (64-char lowercase-hex session public key), X-Monaco-Timestamp (Unix milliseconds, within 30s of server time), and X-Monaco-Signature (hex ed25519 signature). The signature is over METHOD\npath?query\ntimestamp_ms\nSHA256_hex(body), where the body hash is the SHA-256 of the empty byte string when there is no body. Obtain the session keypair from POST /api/v1/auth/challenge followed by POST /api/v1/auth/verify.
Path Parameters
Response
OK
Liquidation mark-price threshold. In ISOLATED mode, this is the position/risk-bucket threshold. In CROSS mode, it is conditional: it varies only this position's mark while all other marks in the cross risk bucket remain unchanged. Other position marks, funding, realized PnL, fees/reserves, and collateral can change it. Treat an absent or blank value as unavailable, never as zero.
Account distress ratio: maintenance margin required divided by equity (higher is closer to liquidation). Equity that is zero or negative has no meaningful quotient, so an account that still owes a maintenance requirement reports the maximum-decimal sentinel (79228162514264337593543950335, maximal distress) rather than zero or a negative value, and an account with no open maintenance requirement reports zero. Clamp the sentinel before display.
Maintenance margin required by this position at mark_price using the market maintenance-margin rate. Zero when the position has no open exposure.
Initial margin required by this position at mark_price, honoring both its effective leverage and the market initial-margin floor. Zero when the position has no open exposure.
RFC 3339 instant at which this position was last MUTATED — a fill, collateral transfer, funding settlement or close — as the producer that owns the position recorded it. It is NOT the instant the response was built: polling an unchanged position returns the same value, and an oracle reprice does not move it. For an OPEN position every surface reports the same instant — the list, the detail read, the risk read, the WebSocket positions snapshot, and the live position_update frames.
Two cases come from the persistence clock instead and differ from the matching engine's by the persistence lag: a TERMINAL row (the live position_update frame carries the engine's close instant, this field carries the stored one), and any position read after a matching-engine restart. Accurate to that lag, not to the microsecond.
A third case is not lag-bounded: an OPEN row read while the matching engine is unreachable falls back to the row's own lifecycle columns (close, then last funding, then open), so a position filled repeatedly since it opened reports its opening instant until funding settles. The live position_update frame is unaffected.
Display metadata. version is the reconciliation key; ordering position
state by this field is never correct.
Was this page helpful?

