GET /markets/{market_id}/adl-events
Get ADL settlement history for a market (v0.21)
Get ADL settlement history for a market (v0.21).
operationId: fetchAdlEvents
Declared server:
https://api.testnet.nexus.xyz/v1. See Networks.
Not reachable through CCXT. ADL (auto-deleveraging) is a Nexus risk mechanism with no CCXT vocabulary.
Authentication: agentAuth, hmacAuth.
Returns up to limit ADL settlement events for the market, most recent first. Populated when the insurance fund is depleted and auto-deleveraging closes opposite-side positions to absorb bad debt. Authenticated only; the same records are not published on the public /stream socket (ENG-17189).
HMAC API key authentication. Send three headers:
X-API-Key: your key ID (e.g.nx_a1b2c3...)X-Timestamp: current time in unix millisecondsX-Signature:hex(hmac_sha256(secret, timestamp + "\n" + METHOD + "\n" + path + "\n" + query + "\n" + sha256_hex(body)))
Timestamp must be within 30 seconds of server time.
The key is network-scoped; the signature is not. The canonical string above has no network component, so the same signed request is byte-identical on every host. What stops a testnet key from authenticating against mainnet is that the key does not exist in that host's key store — sign only for the host that minted the key, and never replay a signed payload against another network. Presented to the wrong host, a key is refused with the same opaque 401 as an unknown key and must not be retried there. See “API keys are bound to one network” in the API description.
Market identifier (e.g. BTC-USDX-PERP, ETH-USDX-PERP). Uppercase ASCII alphanumeric segments joined by single hyphens, at most 64 characters. A value outside that set is rejected with 400 (INVALID_MARKET_ID) before any store is read — it cannot name a market, so an empty result would assert that nothing traded rather than that the question was malformed. A well-formed identifier that names no listed market is a 404, not a 400.
BTC-USDX-PERPPattern: ^[A-Z0-9]+(-[A-Z0-9]+)*$100ADL settlement history for the market.
Single ADL settlement (insurance fund depleted → counterparty closures). v0.21.
0x-prefixed bankrupt account
Arbitrary-precision decimal serialized as a string (lossless). Parse with a decimal type, never a float.
Arbitrary-precision decimal serialized as a string (lossless). Parse with a decimal type, never a float.
Engine event sequence number
Unix ms
The supplied market_id path or query value is not a well-formed market identifier: it must match ^[A-Z0-9]+(-[A-Z0-9]+)*$ and be at most 64 characters. Branch on the body's code, which is always INVALID_MARKET_ID; message restates the rule and is a diagnostic whose wording is not stable. The result for a well-formed identifier that is not currently available is operation-specific and documented by that operation.
Authentication failed. All 401 responses return the same opaque body to prevent information leakage. A credential minted on a different network is one of the causes it hides — by design, so that a key id cannot be probed for existence on another network. Do not retry it against another host.
Rate limit exceeded. Retryable — honour retry-after and back off; this is what separates a 429 from the permanent 403 jurisdiction refusals. Branch on the body's code, which is always RATE_LIMIT_EXCEEDED, and on bucket to learn WHICH budget bottlenecked — the buckets are independent, so a caller at its read ceiling can still submit orders and should not back off the whole client. Do not parse message: it is a diagnostic whose wording is not stable. Requests are charged by weight, so exhausting a budget takes fewer heavy calls than x-ratelimit-limit suggests. See “Rate limits” in the API description.
GET /v1/markets/{market_id}/adl-events HTTP/1.1
Host: api.testnet.nexus.xyz
X-API-Key: YOUR_API_KEY
Accept: */*
[
{
"market_id": "text",
"target_account": "text",
"bankruptcy_price": "text",
"bad_debt_absorbed_by_fund": "text",
"counterparty_closures": [
{
"account_id": "text",
"position_closed": "text",
"settlement_amount": "text"
}
],
"sequence": 1,
"timestamp": 1
}
]Test it cannot sign this request. X-Signature is an HMAC computed per call: see Authentication, or use an SDK.
API version 0.9.122
Last updated

