curl --request GET \
--url https://staging.apimonaco.xyz/api/v1/margin/accounts/{marginAccountId} \
--header 'X-Monaco-Signature: <api-key>'import requests
url = "https://staging.apimonaco.xyz/api/v1/margin/accounts/{marginAccountId}"
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/margin/accounts/{marginAccountId}', 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/margin/accounts/{marginAccountId}",
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/margin/accounts/{marginAccountId}"
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/margin/accounts/{marginAccountId}")
.header("X-Monaco-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/margin/accounts/{marginAccountId}")
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{
"marginAccountId": "<string>",
"accountState": "<string>",
"equity": "<string>",
"initialMarginRequired": "<string>",
"maintenanceMarginRequired": "<string>",
"freeCollateral": "<string>",
"withdrawableCollateral": "<string>",
"totalPositionNotional": "<string>",
"unrealizedPnl": "<string>",
"realizedPnl": "<string>",
"updatedAt": "<string>",
"label": "<string>",
"tradingPairId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategyKey": "<string>",
"riskBucketId": "<string>",
"marginMode": "<string>",
"selectedTradingPairIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"availableOrderCollateral": "<string>"
}Get apiv1marginaccounts
curl --request GET \
--url https://staging.apimonaco.xyz/api/v1/margin/accounts/{marginAccountId} \
--header 'X-Monaco-Signature: <api-key>'import requests
url = "https://staging.apimonaco.xyz/api/v1/margin/accounts/{marginAccountId}"
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/margin/accounts/{marginAccountId}', 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/margin/accounts/{marginAccountId}",
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/margin/accounts/{marginAccountId}"
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/margin/accounts/{marginAccountId}")
.header("X-Monaco-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/margin/accounts/{marginAccountId}")
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{
"marginAccountId": "<string>",
"accountState": "<string>",
"equity": "<string>",
"initialMarginRequired": "<string>",
"maintenanceMarginRequired": "<string>",
"freeCollateral": "<string>",
"withdrawableCollateral": "<string>",
"totalPositionNotional": "<string>",
"unrealizedPnl": "<string>",
"realizedPnl": "<string>",
"updatedAt": "<string>",
"label": "<string>",
"tradingPairId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategyKey": "<string>",
"riskBucketId": "<string>",
"marginMode": "<string>",
"selectedTradingPairIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"availableOrderCollateral": "<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
Margin account UUID for the current isolated bucket.
Query Parameters
Trading pair identifier (UUID)
1Response
OK
The largest amount a transfer-out of this scope will actually accept.
NOT a clamped free_collateral. Free collateral is equity headroom, and
equity includes realized PnL, accrued funding and mark-to-market gains
that are not principal a transfer can move — so the two can differ
without limit. An unrealized gain never counts toward this figure.
For a risk bucket this is capped by the bucket's allocated collateral; for a parent margin account, by deposited collateral that no risk bucket has earmarked.
This is the largest accepted transfer-out, NOT a promise that every smaller one is accepted. Acceptance is not monotone in the amount: a risk bucket whose realized loss exceeds its remaining value accepts the full close-out reported here — which settles that loss to the parent margin account — while refusing a partial withdrawal that would leave the bucket holding less collateral than the loss it has already taken. For such a bucket the accepted amounts are everything up to its equity, plus this figure itself, with a gap in between. Size a transfer directly from this field rather than shaving a margin off it.
1See MarginAccountSummary.available_order_collateral: the collateral
still available to open NEW orders in this risk bucket, the risk engine
admission gate's own bound with parent auto top-up included. Present only
on risk-bucket rows served from a live engine snapshot; absent on parent
rows and persisted-fallback reads.
Was this page helpful?

