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

GET /account/funding-snapshot

Authoritative account funding snapshot

Authoritative account funding snapshot.

operationId: fetchAccountFundingSnapshot

Declared server: https://api.testnet.nexus.xyz/v1. See Networks.

Not reachable through CCXT. CCXT has no unified pending funding obligation / cumulative settlement snapshot method. Native implicit privateGetAccountFundingSnapshot preserves this richer data; fetchFundingHistory denotes settled payment records and is not equivalent.

Authentication: agentAuth, hmacAuth.

Authoritative account funding snapshot

get
/account/funding-snapshot

Read the risk-owned open and closed-pending funding obligations and actual settlement cash for one authenticated account and market. The response is one atomic engine read, not an indexer-history reconstruction. Unsampled or unavailable sources return explicit status and nullable values. A missing old-engine route, malformed body, mismatched identity, stale observation or failed backend returns 502. Existing /funding remains settled history. The raw query is part of the HMAC signature.

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.

Query parameters
market_idstring · min: 1 · max: 128RequiredExample: SOL-USDX-PERP
Responses
200

Coherent snapshot with explicit completeness and sample boundary.

application/json

One coherent engine-owned account/market observation, including closed pending obligations. All nullable fields must be present. A complete status requires complete=true and all three monetary fields to be non-null. Unsampled or unavailable status requires complete=false and open_integral, closed_pending_integral, and settled_cash all null, including when the source would otherwise report a zero string. Contradictory source responses are rejected with FUNDING_SOURCE_INVALID (502). Monetary values are decimal strings or null; absent support is never a zero-cost response. For same-generation baselines B0/U0 and current settled cash B / sum of integrals U, interval cost is -(B-B0)+(U-U0). Actual settled cost is -(B-B0), final only once attributable pending obligations have settled.

ownerstringRequired

Owner resolved from authentication; account selection is not accepted.

Pattern: ^0x[0-9a-f]{40}$
market_idstringRequired
settlement_assetstring · enumRequiredPossible values:
generationstring · min: 1Required

Cash-counter generation. Restart, restoration or market reinitialization may replace this token; do not difference counters across generations.

cursorstringRequired

Monotonic observation sequence within a generation, encoded as a string for lossless clients. Not a WAL offset.

Pattern: ^[0-9]+$
observed_at_msinteger · int64 · min: 1Required

UTC Unix milliseconds when the authoritative actor read the coherent state. Edge refuses observations older than 5000 ms or over 1000 ms in the future.

accrued_through_msinteger · nullableRequired

Last committed funding tick or settlement covered by the integrals, UTC Unix milliseconds. This is not the HTTP time or funding-rate sampling cadence; consumers must apply their own funding freshness budget. Null means unsampled. A complete response requires a nonzero time no later than observation and scheduled window end. After early forced settlement, the actual boundary may precede the next scheduled window start.

completebooleanRequired

True only with complete risk state through accrued_through_ms. It does not assert that no accrual exists after that boundary.

statusstring · enumRequiredPossible values:
open_integralstring · nullableRequired

Signed USDX integral for the open position; positive is owed. Null is unknown.

Pattern: ^-?[0-9]+(\.[0-9]+)?$
closed_pending_integralstring · nullableRequired

Signed USDX integral retained after positions close; positive is owed. Flat accounts can have a nonzero value. Null is unknown.

Pattern: ^-?[0-9]+(\.[0-9]+)?$
settled_cashstring · nullableRequired

Cumulative actual USDX collateral cash from all committed funding settlement contributions within this generation. Positive is received, negative paid; payer caps are already reflected. Null is unknown.

Pattern: ^-?[0-9]+(\.[0-9]+)?$
get/account/funding-snapshot
GET /v1/account/funding-snapshot?market_id=text HTTP/1.1
Host: api.testnet.nexus.xyz
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "owner": "text",
  "market_id": "text",
  "settlement_asset": "USDX",
  "generation": "text",
  "cursor": "text",
  "observed_at_ms": 1,
  "accrued_through_ms": null,
  "funding_window": {
    "id": "text",
    "start_ms": 1,
    "end_ms": 1
  },
  "complete": true,
  "status": "complete",
  "open_integral": null,
  "closed_pending_integral": null,
  "settled_cash": null
}

Test it cannot sign this request. X-Signature is an HMAC computed per call: see Authentication, or use an SDK.


API version 0.9.131

Last updated