curl --request POST \
--url https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk \
--header 'Content-Type: application/json' \
--header 'X-Monaco-Signature: <api-key>' \
--data '
{
"tradingPairId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategyKey": "<string>",
"side": "<string>",
"positionSide": "<string>",
"orderType": "<string>",
"price": "<string>",
"quantity": "<string>",
"leverage": "<string>",
"reduceOnly": true,
"marginMode": "<string>",
"selectedTradingPairIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slippageToleranceBps": 123
}
'import requests
url = "https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk"
payload = {
"tradingPairId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategyKey": "<string>",
"side": "<string>",
"positionSide": "<string>",
"orderType": "<string>",
"price": "<string>",
"quantity": "<string>",
"leverage": "<string>",
"reduceOnly": True,
"marginMode": "<string>",
"selectedTradingPairIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"slippageToleranceBps": 123
}
headers = {
"X-Monaco-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Monaco-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tradingPairId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
strategyKey: '<string>',
side: '<string>',
positionSide: '<string>',
orderType: '<string>',
price: '<string>',
quantity: '<string>',
leverage: '<string>',
reduceOnly: true,
marginMode: '<string>',
selectedTradingPairIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slippageToleranceBps: 123
})
};
fetch('https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-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/margin/risk-buckets/simulate-order-risk",
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([
'tradingPairId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'strategyKey' => '<string>',
'side' => '<string>',
'positionSide' => '<string>',
'orderType' => '<string>',
'price' => '<string>',
'quantity' => '<string>',
'leverage' => '<string>',
'reduceOnly' => true,
'marginMode' => '<string>',
'selectedTradingPairIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'slippageToleranceBps' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk"
payload := strings.NewReader("{\n \"tradingPairId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"strategyKey\": \"<string>\",\n \"side\": \"<string>\",\n \"positionSide\": \"<string>\",\n \"orderType\": \"<string>\",\n \"price\": \"<string>\",\n \"quantity\": \"<string>\",\n \"leverage\": \"<string>\",\n \"reduceOnly\": true,\n \"marginMode\": \"<string>\",\n \"selectedTradingPairIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"slippageToleranceBps\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Monaco-Signature", "<api-key>")
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://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk")
.header("X-Monaco-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tradingPairId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"strategyKey\": \"<string>\",\n \"side\": \"<string>\",\n \"positionSide\": \"<string>\",\n \"orderType\": \"<string>\",\n \"price\": \"<string>\",\n \"quantity\": \"<string>\",\n \"leverage\": \"<string>\",\n \"reduceOnly\": true,\n \"marginMode\": \"<string>\",\n \"selectedTradingPairIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"slippageToleranceBps\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Monaco-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tradingPairId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"strategyKey\": \"<string>\",\n \"side\": \"<string>\",\n \"positionSide\": \"<string>\",\n \"orderType\": \"<string>\",\n \"price\": \"<string>\",\n \"quantity\": \"<string>\",\n \"leverage\": \"<string>\",\n \"reduceOnly\": true,\n \"marginMode\": \"<string>\",\n \"selectedTradingPairIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"slippageToleranceBps\": 123\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"rejectReason": "<string>",
"equityAfter": "<string>",
"initialMarginRequiredAfter": "<string>",
"maintenanceMarginRequiredAfter": "<string>",
"freeCollateralAfter": "<string>",
"estimatedFee": "<string>",
"estimatedLiquidationPrice": "<string>",
"marginAccountId": "<string>",
"strategyKey": "<string>",
"riskBucketId": "<string>",
"marginMode": "<string>",
"selectedTradingPairIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expectedMatchResult": {
"tradesCount": 2,
"totalFilled": "0.2",
"remainingQuantity": "0.3",
"averageFillPrice": "35100.00",
"status": "PARTIALLY_FILLED",
"actualSlippageBps": 15,
"maxSlippageBps": 50,
"executionPriceRange": {
"bestPrice": "2045.00",
"worstPrice": "2052.00"
}
},
"referencePrice": "100.25"
}Post apiv1marginrisk bucketssimulate order risk
curl --request POST \
--url https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk \
--header 'Content-Type: application/json' \
--header 'X-Monaco-Signature: <api-key>' \
--data '
{
"tradingPairId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategyKey": "<string>",
"side": "<string>",
"positionSide": "<string>",
"orderType": "<string>",
"price": "<string>",
"quantity": "<string>",
"leverage": "<string>",
"reduceOnly": true,
"marginMode": "<string>",
"selectedTradingPairIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"slippageToleranceBps": 123
}
'import requests
url = "https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk"
payload = {
"tradingPairId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"strategyKey": "<string>",
"side": "<string>",
"positionSide": "<string>",
"orderType": "<string>",
"price": "<string>",
"quantity": "<string>",
"leverage": "<string>",
"reduceOnly": True,
"marginMode": "<string>",
"selectedTradingPairIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"slippageToleranceBps": 123
}
headers = {
"X-Monaco-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Monaco-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tradingPairId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
strategyKey: '<string>',
side: '<string>',
positionSide: '<string>',
orderType: '<string>',
price: '<string>',
quantity: '<string>',
leverage: '<string>',
reduceOnly: true,
marginMode: '<string>',
selectedTradingPairIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
slippageToleranceBps: 123
})
};
fetch('https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-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/margin/risk-buckets/simulate-order-risk",
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([
'tradingPairId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'strategyKey' => '<string>',
'side' => '<string>',
'positionSide' => '<string>',
'orderType' => '<string>',
'price' => '<string>',
'quantity' => '<string>',
'leverage' => '<string>',
'reduceOnly' => true,
'marginMode' => '<string>',
'selectedTradingPairIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'slippageToleranceBps' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk"
payload := strings.NewReader("{\n \"tradingPairId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"strategyKey\": \"<string>\",\n \"side\": \"<string>\",\n \"positionSide\": \"<string>\",\n \"orderType\": \"<string>\",\n \"price\": \"<string>\",\n \"quantity\": \"<string>\",\n \"leverage\": \"<string>\",\n \"reduceOnly\": true,\n \"marginMode\": \"<string>\",\n \"selectedTradingPairIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"slippageToleranceBps\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Monaco-Signature", "<api-key>")
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://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk")
.header("X-Monaco-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"tradingPairId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"strategyKey\": \"<string>\",\n \"side\": \"<string>\",\n \"positionSide\": \"<string>\",\n \"orderType\": \"<string>\",\n \"price\": \"<string>\",\n \"quantity\": \"<string>\",\n \"leverage\": \"<string>\",\n \"reduceOnly\": true,\n \"marginMode\": \"<string>\",\n \"selectedTradingPairIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"slippageToleranceBps\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/margin/risk-buckets/simulate-order-risk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Monaco-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tradingPairId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"strategyKey\": \"<string>\",\n \"side\": \"<string>\",\n \"positionSide\": \"<string>\",\n \"orderType\": \"<string>\",\n \"price\": \"<string>\",\n \"quantity\": \"<string>\",\n \"leverage\": \"<string>\",\n \"reduceOnly\": true,\n \"marginMode\": \"<string>\",\n \"selectedTradingPairIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"slippageToleranceBps\": 123\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"rejectReason": "<string>",
"equityAfter": "<string>",
"initialMarginRequiredAfter": "<string>",
"maintenanceMarginRequiredAfter": "<string>",
"freeCollateralAfter": "<string>",
"estimatedFee": "<string>",
"estimatedLiquidationPrice": "<string>",
"marginAccountId": "<string>",
"strategyKey": "<string>",
"riskBucketId": "<string>",
"marginMode": "<string>",
"selectedTradingPairIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"expectedMatchResult": {
"tradesCount": 2,
"totalFilled": "0.2",
"remainingQuantity": "0.3",
"averageFillPrice": "35100.00",
"status": "PARTIALLY_FILLED",
"actualSlippageBps": 15,
"maxSlippageBps": 50,
"executionPriceRange": {
"bestPrice": "2045.00",
"worstPrice": "2052.00"
}
},
"referencePrice": "100.25"
}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.
Body
Deprecated compatibility value; side is authoritative.
Required for normal orders; optional and ignored for reduce-only.
Risk bucket mode. Defaults to ISOLATED. Values: ISOLATED, CROSS.
Deprecated: accepted and ignored. Cross scope is derived from trading (a pair joins the cross bucket when a cross order on it succeeds; after its positions close it stays listed until a later successful cross order on another pair reconciles the bucket), so a cross preview has nothing to declare: it runs against the account's active cross bucket — or the deterministic bucket a first cross order would create — and the previewed pair is in scope by construction. Rejected for ISOLATED, as before. The response's selectedTradingPairIds reports the derived scope (recorded pairs, pairs with open positions in the bucket, and the previewed pair), never this list.
1MARKET only: client slippage tolerance in basis points, 0..1000, the same rule placement enforces — a LIMIT or IOC preview carrying it is rejected. Tightens the previewed walk to the band the real order will run under and never widens it; omit for the placement default.
x <= 1000Response
OK
What this order pays in fees once its WHOLE size has executed, priced by the role each part of it plays against the book right now: the taker rate (plus the application's additional taker fee) on the quantity that would cross immediately, and the maker rate on the quantity that would rest and be filled later. Both rates are the caller's own tier-resolved rates. One figure covers both cases — an order that crosses entirely, one that rests entirely, and every split in between.
Signed: NEGATIVE means a net rebate, which is the honest answer for a
resting order on a pair whose maker fee is negative. Populated even when
accepted is false, and populated for reduce-only orders — closing a
position pays fees like any other fill.
It assumes the resting part eventually fills, so it states what the order costs if it runs to completion, not a probability-weighted figure: cancel before the remainder fills and only the crossing part was ever charged.
ABSENT — never zero — when the engine could not price the order: it was refused before it could be matched, or its resolved maker tier exceeds the pair's cap. Absence means unknown, so do not render it as a free order.
Estimated liquidation mark-price. In ISOLATED mode, this is the position/risk-bucket threshold. In CROSS mode, it is conditional: it varies only the target 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.
The margin account the simulation was resolved against. Always populated; useful for auto-resolved buckets where the caller didn't supply the id.
Populated when the simulated account is an auto-resolved bucket.
Present when the simulation resolved against a risk bucket.
Present when the simulation resolved against a risk bucket. Values: ISOLATED, CROSS.
The cross scope the preview ran against; absent for isolated previews and
never a request's deprecated list. SimulateRiskBucketOrderRisk in CROSS
mode reports the DERIVED scope: the active cross bucket's recorded pairs
(a pair whose positions have closed stays recorded until a later cross
order on another pair reconciles the bucket), every pair with an open
position in that bucket, and the previewed pair — the previewed pair alone
before the first cross order. SimulateOrderRisk and
SimulateParentMarginOrderRisk report the recorded pairs plus the
previewed pair.
1The simulated match the engine ran to admit this order (0XM-2746): the
same MatchResult shape CreateOrderResponse.match_result carries for a
real placement, produced by the same simulate_match_with_stp walk over
the live book at the moment of the preview — under the caller's
slippage_tolerance_bps merged tighter-wins with the mandatory 1,000 bps
protective band, the caller's own self-trade-prevention default (the
preview runs under the caller's wallet, as placement does) and
reduce-only sizing. Not a handler-side re-walk of an orderbook snapshot,
so a preflight and the placement it precedes read the same numbers — the
reason this rides the risk simulation rather than a separate quote
endpoint. What a preview cannot carry: a post-only flag, TP/SL legs and a
per-order self-trade-prevention override, so a post-only placement that
would cross is refused by placement, not by this preview.
Fields: total_filled is what the walk fills; remaining_quantity what
it could NOT fill inside the merged band — the partial-fill / band-cut
indicator (0 means the whole size executes; a MARKET preview with a
non-zero remainder comes back partially filled when placed);
average_fill_price is the quantity-weighted fill price and
execution_price_range.worst_price the worst level reached (highest ask a
BUY takes, lowest bid a SELL hits), both absent when nothing crosses;
status is the status placement would end in: FILLED for a full fill,
CANCELLED for a MARKET order the band or the depth cuts short (a MARKET
remainder cannot rest, so the fills execute and the rest is cancelled —
read remaining_quantity for the partial fill), SUBMITTED for a LIMIT
that rests, PARTIALLY_FILLED for a LIMIT that crosses partly and rests
the remainder; actual_slippage_bps the realized
slippage against reference_price as the engine computes it for a
placement, absent when nothing crosses; max_slippage_bps echoes the
caller's tolerance, not the merged band. A LIMIT preview that would rest
reports 0 filled, the full size remaining and no prices.
For a LIMIT or IOC preview the engine measures slippage against the LIMIT
price and reports none when every fill improved on it, exactly as the
placement's match_result does; reference_price below is therefore
published for MARKET previews only.
Priced against the book RIGHT NOW. For a take-profit / stop-loss the close
runs later, on a different book, under the wider 1,200 bps band the engine
stamps on a triggered market leg and anchored at trigger time — so for a
TP/SL estimate apply actual_slippage_bps to the TRIGGER price as an
impact figure rather than displaying this call's absolute average price.
Fees for this walk are estimated_fee above, at the caller's own tier,
which can lag the engine's copy by one refresh interval.
PRESENT ONLY when accepted is true. Absent — never zeros — on every
refused preview (accepted: false with a reject_reason): validation, an
unknown market or account, insufficient margin, a maker-risk constraint, a
MARKET order with nothing fillable inside the band, and the post-match
maker-risk revalidation, whose match the engine discards. Such previews
may still carry estimated_fee, which is priced independently of risk
state. Treat absence as unknown, not as "fills at zero".
Show child attributes
Show child attributes
The touch on the taking side when a MARKET preview ran (best ask for a BUY, best bid for a SELL) — what expectedMatchResult's walk and its actualSlippageBps are measured from. Present only when accepted is true and the preview is a MARKET order; a LIMIT or IOC preview is measured against its own limit price and publishes nothing here.
"100.25"
Was this page helpful?

