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.
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.
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.
SOL-USDX-PERPCoherent snapshot with explicit completeness and sample boundary.
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.
Owner resolved from authentication; account selection is not accepted.
^0x[0-9a-f]{40}$Cash-counter generation. Restart, restoration or market reinitialization may replace this token; do not difference counters across generations.
Monotonic observation sequence within a generation, encoded as a string for lossless clients. Not a WAL offset.
^[0-9]+$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.
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.
True only with complete risk state through accrued_through_ms. It does not assert that no accrual exists after that boundary.
Signed USDX integral for the open position; positive is owed. Null is unknown.
^-?[0-9]+(\.[0-9]+)?$Signed USDX integral retained after positions close; positive is owed. Flat accounts can have a nonzero value. Null is unknown.
^-?[0-9]+(\.[0-9]+)?$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.
^-?[0-9]+(\.[0-9]+)?$Missing, duplicate or unsupported query parameters, or invalid market_id.
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.
The authoritative engine reports MarketNotFound for the requested market. An old engine without this route returns 502 instead.
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.
FUNDING_SOURCE_UNAVAILABLE, FUNDING_SOURCE_INVALID or FUNDING_SOURCE_STALE; no trustworthy snapshot can be returned.
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

