For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Get ADL settlement history for a market (v0.21)

get
/markets/{market_id}/adl-events

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).

Authorizations
X-API-KeystringRequired

HMAC API key authentication. Send three headers:

  • X-API-Key: your key ID (e.g. nx_a1b2c3...)
  • X-Timestamp: current time in unix milliseconds
  • X-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.

Path parameters
market_idstring · max: 64Required

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.

Example: BTC-USDX-PERPPattern: ^[A-Z0-9]+(-[A-Z0-9]+)*$
Query parameters
limitinteger · max: 1000OptionalDefault: 100
Responses
200

ADL settlement history for the market.

application/json

Single ADL settlement (insurance fund depleted → counterparty closures). v0.21.

market_idstringOptional
target_accountstringOptional

0x-prefixed bankrupt account

bankruptcy_pricestringOptional

Arbitrary-precision decimal serialized as a string (lossless). Parse with a decimal type, never a float.

bad_debt_absorbed_by_fundstringOptional

Arbitrary-precision decimal serialized as a string (lossless). Parse with a decimal type, never a float.

sequenceintegerOptional

Engine event sequence number

timestampinteger · int64Optional

Unix ms

get/markets/{market_id}/adl-events
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