> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/api-reference/account/fetch-trading-fees.md).

# GET /account/fees

Account fee schedule

Account fee schedule.

`operationId`: `fetchTradingFees` · CCXT method: `fetchTradingFees`

> **Declared server:** `https://api.testnet.nexus.xyz/v1`. See [Networks](/api-reference/guides/networks.md).

**Authentication:** `agentAuth`, `hmacAuth`.

## Account fee schedule

> The authenticated account's effective fee schedule — maker/taker rate (bps), fee tier, rolling 30-day traded volume, and active discounts — for parity with Hyperliquid \`userFees\`. This is the forward-looking \*schedule\* rate, not a realized average: the venue charges a per-fill fee but does not emit a realized per-fill rate. The reported rate's scope is given by \`schedule\` (see the schema); the account id is taken from the authenticated credentials, not a parameter. Pass \`market\_id\` to request the exact current mirrored schedule for one intended market before the account has traded there. A selected market never falls back to a venue-modal or unrelated market rate: an unavailable or stale target returns \`schedule: unknown\`, zero sentinels, and an empty \`markets\` array.

````json
{"openapi":"3.1.0","info":{"title":"Nexus Exchange API","version":"0.9.101"},"tags":[{"name":"Account","description":"Balance and order management"}],"servers":[{"url":"https://api.testnet.nexus.xyz/v1","description":"Public testnet (play funds) — the default server and /v1 transport base for unversioned paths."},{"url":"https://api.nexus.xyz/v1","description":"Mainnet — **REAL FUNDS**. Collateral is USDX bridged from Ethereum Mainnet; orders placed here move real money, and there is no faucet. The durable per-network base. Listed after testnet on purpose, so nothing that reaches for \"the first https server\" lands on the real-funds target. Not resolvable yet: DNS/TLS is a separate infra change."},{"url":"http://localhost:9090","description":"Local development — the indexer served directly. Not a public network; whatever your local instance holds."}],"security":[{"hmacAuth":[]},{"agentAuth":[]}],"components":{"securitySchemes":{"hmacAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"HMAC API key authentication. Send three headers:\n- `X-API-Key`: your key ID (e.g. `nx_a1b2c3...`)\n- `X-Timestamp`: current time in unix milliseconds\n- `X-Signature`: `hex(hmac_sha256(secret, timestamp + \"\\n\" + METHOD + \"\\n\" + path + \"\\n\" + query + \"\\n\" + sha256_hex(body)))`\n\nTimestamp must be within 30 seconds of server time.\n\n**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."},"agentAuth":{"type":"apiKey","in":"header","name":"x-agent","description":"Agent-key request signing. An agent is a secp256k1 keypair the wallet delegates trading to with `POST /agents/register`; the agent then signs each request itself, so the wallet key is never exposed. Send four headers:\n\n- `x-agent`: the agent's 20-byte address, hex, `0x` prefix optional — derived from its public key exactly like a wallet address (`keccak256(uncompressed_pubkey[1..])[12..]`). It must be registered on this host and not expired.\n- `x-timestamp`: the current time in unix milliseconds, as a base-10 integer.\n- `x-nonce`: an unsigned 64-bit integer, base 10. Required on every request; see “Nonces” for when it is enforced.\n- `x-signature`: `0x` followed by the hex of the 65-byte signature described under “Signature”.\n\n**Canonical string.** Six fields joined by LF (`\\n`), with no trailing newline:\n\n```\n{METHOD}\\n{path}\\n{query}\\n{sha256_hex(body)}\\n{x-timestamp}\\n{x-nonce}\n```\n\n- `METHOD` is upper-cased. The field order differs from `hmacAuth`: the method comes first and the timestamp comes after the body hash, so an HMAC canonical-string builder cannot be reused.\n- `path` is the logical path the server authenticates, with no host and no query string — the same rule as `hmacAuth`; see “Base paths and the signed path” in the API description.\n- `query` is the raw query string exactly as sent, without the leading `?`. With no query it is the empty string, and its line stays in the string as an empty line; it is never dropped.\n- `sha256_hex(body)` is the lower-case hex SHA-256 of the exact body bytes sent. A request with no body hashes the empty byte string (`e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`).\n- `x-timestamp` and `x-nonce` are the same decimal strings sent in those headers.\n\n**Digest.** `keccak256(utf8(canonical_string))`: raw Keccak-256 of the canonical string, **with no EIP-191 prefix and no EIP-712 structure**. A wallet library's `signMessage` / `personal_sign` adds the `\\x19Ethereum Signed Message:\\n` prefix, which produces a different digest and a signature that recovers to some other address. Sign the 32-byte hash directly (for example `eth_account`'s `unsafe_sign_hash`, or `@noble/curves` `secp256k1.sign(digest, key)`).\n\n**Signature.** Recoverable secp256k1 ECDSA over the digest, sent as 65 bytes `r (32) ‖ s (32) ‖ v (1)` with `v ∈ {27, 28}`. `s` must be low (at most half the curve order, per EIP-2). A high-S signature is refused even though it recovers the same signer, because accepting it would let one authorization be presented as two. The server recovers the signer from the digest and requires it to equal `x-agent`.\n\n**Freshness.** `x-timestamp` must be within ±30 seconds of the server's clock, on reads and writes alike. That window is the only bound on how long a captured read signature can be replayed.\n\n**Nonces.** The nonce is parsed on every request but enforced only on writes:\n\n- On a mutating method (anything but `GET`, `HEAD`, `OPTIONS` and `TRACE`), `x-nonce` must be strictly greater than the highest nonce this host has already accepted on a write from the same agent. The accepted value is persisted before the response is sent. Each agent address has its own nonce space, separate from the wallet-signed nonces of `POST /agents/register` and `POST /withdrawals`.\n- On a read, the nonce is neither checked nor consumed, so the same signed read verifies more than once inside its ±30 s window.\n\nA counter of `max(last + 1, now_ms)` is a simple nonce source: it is unique per signer and stays increasing across restarts.\n\n**Concurrent writes from one agent can be refused as replays.** The rule is about arrival order, not issue order. When two writes from the same agent are in flight together and the one with the higher nonce arrives first, the other is refused, and the refusal is the same opaque `401` as a bad signature. The fix is still being decided (ENG-17010). Until then, keep one write in flight per agent key, or register a separate agent key for each concurrent writer.\n\n**Failures are opaque.** Any failure returns the same `401` body with no reason (see the `Unauthorized` response): an unknown or expired agent, a stale timestamp, a malformed header, a wrong digest, a high-S signature or a replayed nonce all look alike. This contract does not say which check failed or in what order the checks run, and a client must not infer either. If a signer is rejected, check it against the test vector below before anything else.\n\n**What an agent key cannot do.** Agent keys are trade-only. **An agent key cannot withdraw**, and it cannot move funds off the account by any route:\n\n- `POST /api/v1/bridge/withdrawals` refuses an agent-signed request with `403` (code `AGENT_CANNOT_WITHDRAW`). The engine's withdrawal route is refused the same way.\n- `POST /withdrawals` requires the wallet's own EIP-712 signature in the body, which an agent key cannot produce.\n- The ordinary-transfer operations (`ownerSignature`) refuse any request that carries `x-agent`.\n\nAgent keys also cannot manage agent credentials: `GET /agents`, `PATCH /agents/{address}` and `DELETE /agents/{address}` refuse them with `403` (code `AGENT_KEY_FORBIDDEN`). A client that holds only an agent key manages them with the wallet's own signature instead (`walletSignature`). And they cannot mint the legacy `POST /ws-tokens` token, which is HMAC-only; use `POST /ws/token`. None of these operations lists `agentAuth`. Every operation that does list it accepts it.\n\n**Test vector.** The key below is a public test key: never fund it or register it. The `x-nexus-test-vectors` extension on this scheme carries this vector and two more (an empty-body `GET`, and a `DELETE` with a query). Together they cover both values of `v`.\n\n- private key: `0x4c0883a69102937d6231471b5dbb6204fe5129617082792ae468d01a3f362318` → `x-agent: 0x2c7536e3605d9c16a7a3d7b1898e529396a65c23`\n- request: `post /orders` (the method is lower-case on purpose; the canonical string upper-cases it), no query, body `{\"market_id\":\"BTC-USDX-PERP\",\"side\":\"Buy\",\"order_type\":\"Limit\",\"quantity\":\"0.1\",\"price\":\"50000\"}`, `x-timestamp: 1776033900123`, `x-nonce: 42`\n- canonical string (LF shown as `⏎`): `POST⏎/orders⏎⏎59ddf9017ca0eb5f8802afd1a2d1584b2d93b0260a0fcd62a1b94b3ff92b332c⏎1776033900123⏎42`\n- digest: `0xe27ade6101c417d2c393abfce8f35b6e1551cf0ce5c50dfbe12f8d6f399ffc35`\n- `x-signature: 0xeef09105834062da10d208be38311995d04cbc5e05043b89e7cbe6d4497d11b51f61729639551a8cfb6ea3e4fe0765afeba7bf3b5f5e09f63bc095c89005b61d1c`\n\n**Network scope.** Like every credential here, an agent registration belongs to the host it was registered on. The canonical string has no network component, so the refusal elsewhere comes from the agent being unknown to that host."}},"schemas":{"AccountFees":{"type":"object","description":"The authenticated account's most recently mirrored fee schedule, mirroring Hyperliquid `userFees`. Reports the forward-looking schedule rate, not a realized per-fill average. There are no per-account fee tiers or discounts today, so `tier` is `base` and `discounts` is empty. Without a selector, `markets` is the per-market breakdown available from the current mirror for currently listed markets represented in the currently retained fill buffer and the top-level bps pair is only its modal summary. With `market_id`, `markets` contains only that exact target when currently listed and available, and the headline is its pair. Absence from an unfiltered `markets` list is not evidence that the account never traded a market; absence for a selected target means the exact target is unavailable, delisted, or the mirror is stale and the response fails closed as `unknown`. This response carries no source timestamp; consumers must not infer freshness from a successful read.","required":["maker_fee_bps","taker_fee_bps","tier","schedule","markets","volume_30d","volume_30d_estimated","discounts"],"properties":{"maker_fee_bps":{"type":"integer","description":"Headline maker fee in basis points. Negative means the maker is *paid* a rebate. When `schedule` is `per_market`, inspect `markets` for each available per-market rate; when it is `unknown`, zero is a sentinel rather than a known fee."},"taker_fee_bps":{"type":"integer","description":"Headline taker fee in basis points. When `schedule` is `per_market`, inspect `markets` for each available per-market rate; when it is `unknown`, zero is a sentinel rather than a known fee."},"tier":{"type":"string","minLength":1,"pattern":"\\S","description":"Fee tier for the account. Currently always `base`: there are no per-account fee tiers yet (distinct from rate-limit tiers). New values may appear when the fee model lands, so treat this as an open string."},"schedule":{"type":"string","minLength":1,"pattern":"\\S","description":"Scope of the top-level bps pair. With `market_id`, `per_market` means the exact target is currently listed and mirrored: `markets` contains its sole row and the headline is that row's pair; `unknown` means that target is unavailable, delisted, or the mirror is stale, so zero headline values are sentinels and `markets` is empty. Without a selector, `per_market` means the currently retained account-fill buffer represents at least one currently listed market with mirrored fee parameters: `markets` contains those rows and the headline is their deterministic modal pair. `reference` is unfiltered-only: the retained buffer contains no currently listed market with a mirrored schedule, so the headline is the deterministic modal pair across all available currently listed venue markets and `markets` is empty; it does not prove the account never traded a market. For both unfiltered modal calculations, the pair with the highest occurrence count wins and a tie chooses the lexicographically smallest `(maker_fee_bps, taker_fee_bps)` pair. Unfiltered `unknown` means no currently listed market fee parameters are available yet. Treat this as an open string because new scopes may appear."},"markets":{"type":"array","description":"Without `market_id`, the most recently mirrored schedule for each distinct currently listed market represented in the account's currently retained fill buffer whose fee parameters are available, sorted by `market_id`. With `market_id`, exactly one row for that target when it is currently listed and its current schedule is available. A delisted market is omitted even while its historical fills and last mirrored parameters remain retained. Returned rows are authoritative for the response's schedule scope, but the response carries no source timestamp; the unfiltered, capped in-memory fill buffer can reset or evict old markets, so neither freshness nor lifetime trading may be inferred from that mode. Empty for `reference` and `unknown`.","items":{"$ref":"#/components/schemas/AccountMarketFee"}},"volume_30d":{"allOf":[{"$ref":"#/components/schemas/Decimal"}],"description":"Rolling 30-day traded notional for the account, as a decimal string.\n\nServed from one of two sources, and `volume_30d_estimated` says what guarantee applies. Where the durable fee projection is available and caught up, this is an aggregate over a per-fill ledger sourced from the Cold Data fills tape — uncapped and durable across restarts. Otherwise it is summed from a bounded in-memory fill buffer that resets on restart, which is the only source in deployments where cold-data capture is off.\n\nParse this string; do not compare it. The scale is not part of the contract, and the two sources spell the same figure differently."},"volume_30d_estimated":{"type":"boolean","description":"`false` means `volume_30d` is not known to undercount. What that is worth depends on which source answered, and this field deliberately does not say which — a client needing a completeness guarantee should assume the weaker of the two readings below.\n\n**Durable projection:** `false` is a statement about backfill coverage, not a real-time guarantee — it means the ingest has caught up to within a few minutes of now, which implies the 30-day window is covered back to its start. It does **not** promise the most recent few minutes are included: the ingest advances in ticks, so a `false` figure can still exclude fills from just before the request. A client polling for a value to change the instant a trade lands should expect a short delay on this path.\n\n**In-memory fallback:** `true` when the source fill buffer was at capacity, so older in-window fills were evicted. `false` means no eviction was detected — it is **not** a guarantee that the full 30-day window is covered. A buffer that started empty or partial (a service instance with no history to hydrate from) undercounts too, and from the server's side that is indistinguishable from an account that simply traded little. Read the flag as a floor on the doubt, not a completeness certificate — the same semantics `total_realized_pnl_30d_estimated` carries on `GET /account/summary`."},"discounts":{"type":"array","description":"Active fee discounts applied to the account. Currently always empty — no discount program exists yet.","items":{"$ref":"#/components/schemas/FeeDiscount"}}}},"AccountMarketFee":{"type":"object","description":"The most recently mirrored maker/taker schedule for one market. In an unfiltered response the account's retained fill buffer selected the market; with `market_id` the caller selected it directly. The parent response carries no source timestamp, so consumers must not infer freshness from this row alone.","required":["symbol","maker_fee_bps","taker_fee_bps"],"properties":{"symbol":{"type":"string","pattern":"^[A-Z0-9]+(-[A-Z0-9]+)*$","maxLength":64,"description":"Market identifier, using uppercase ASCII alphanumeric segments joined by single hyphens. Named `market_id` until ENG-13528 renamed it to CCXT's `symbol`. `/account/fees` spans markets, so a row has to say which one it belongs to — the same reason `Trade.symbol` is native."},"maker_fee_bps":{"type":"integer","description":"Maker fee in basis points for this market. Negative means the maker is paid a rebate."},"taker_fee_bps":{"type":"integer","description":"Taker fee in basis points for this market."}}},"Decimal":{"type":"string","description":"Arbitrary-precision decimal serialized as a string (lossless). Parse with a decimal type, never a float."},"FeeDiscount":{"type":"object","description":"An active fee discount applied to the account. No discount program exists today, so `discounts` is always empty and no properties are guaranteed yet. Additional properties may be added additively if a discount program is introduced.","additionalProperties":true},"RateLimitError":{"type":"object","description":"The body of a 429. Branch on `code` (always `RATE_LIMIT_EXCEEDED`) and on `bucket` to learn WHICH budget bottlenecked. Schematised rather than left to `examples` because `bucket` is meant to be read by machines: an example gives a generated client no field and a validator nothing to check `\"bucket\": \"ownr\"` against. `bucket` here and the `X-RateLimit-Bucket` header carry the same value and the same enum.","required":["code","message","bucket"],"properties":{"code":{"type":"string","enum":["RATE_LIMIT_EXCEEDED"],"description":"Always `RATE_LIMIT_EXCEEDED` on this response. The other 429s this API can return carry different codes (`too_many_agents`, `rate_limited`, `cap_exceeded`, `daily_limit_exceeded`) and are not this shape."},"message":{"type":"string","description":"A diagnostic whose wording is NOT stable. Do not parse it; branch on `bucket`."},"bucket":{"type":"string","enum":["key","owner","order","cancel","ip","login"],"description":"Which budget refused this request. `key` — the per-API-key bucket; `owner` — the per-account request bucket; `order` — the trading-action bucket, order submission and amend only; `cancel` — the separate cancellation bucket, `DELETE` on the order surface only; `ip` — the public per-IP bucket for unauthenticated and gateway traffic; `login` — the dedicated per-IP bucket for `POST /auth/login`, tighter than `ip` and drawn from its own pool, so a login refusal leaves the read budget untouched and vice versa. The buckets are independent, so a caller at its read ceiling can still submit orders, and a caller at its submission ceiling can still cancel — do not back off the whole client on any one of them."},"tier":{"type":"string","description":"The rate-limit tier the refused request was charged against — `public` for the per-IP bucket, otherwise the authenticated key's tier. Absent on responses from paths that refuse before a tier is resolved."}}}},"responses":{"InvalidMarketId":{"description":"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.","content":{"application/json":{}}},"Unauthorized":{"description":"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.","content":{"application/json":{}}},"RateLimited":{"description":"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.","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Budget of request weight per second for your tier — not a count of requests. Sent on successful responses too."},"X-RateLimit-Remaining":{"schema":{"type":"integer"},"description":"Tokens left, in unit-cost requests: 10 means ten weight-1 requests or two weighing 5. Sent on successful responses too. Always `0` on this response."},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix timestamp (seconds) when the budget is whole again. Sent only on a `429`, never on a success."},"Retry-After":{"schema":{"type":"integer"},"description":"Seconds to wait before retrying, never below 1. Derived from the **weighted** cost of the refused request, so it is not in the same unit as `X-RateLimit-Remaining`. Sent only on a `429`."},"X-RateLimit-Bucket":{"schema":{"type":"string","enum":["key","owner","order","cancel","ip","login"]},"description":"Which budget refused this request, mirroring the body's `bucket`. `key` — the per-API-key bucket; `owner` — the per-account request bucket; `order` — the trading-action bucket, order submission and amend only; `cancel` — the separate cancellation bucket, `DELETE` on the order surface only; `ip` — the public per-IP bucket for unauthenticated and gateway traffic; `login` — the dedicated per-IP bucket for `POST /auth/login`, tighter than `ip` and drawn from its own pool, so a login refusal leaves the read budget untouched and vice versa. The read, trading and cancellation budgets are counted separately, so a `429` on one does not mean the others are exhausted — in particular a `429` naming `order` never means your cancels are refused. Sent only on a `429`."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}}}}}},"paths":{"/account/fees":{"get":{"tags":["Account"],"summary":"Account fee schedule","description":"The authenticated account's effective fee schedule — maker/taker rate (bps), fee tier, rolling 30-day traded volume, and active discounts — for parity with Hyperliquid `userFees`. This is the forward-looking *schedule* rate, not a realized average: the venue charges a per-fill fee but does not emit a realized per-fill rate. The reported rate's scope is given by `schedule` (see the schema); the account id is taken from the authenticated credentials, not a parameter. Pass `market_id` to request the exact current mirrored schedule for one intended market before the account has traded there. A selected market never falls back to a venue-modal or unrelated market rate: an unavailable or stale target returns `schedule: unknown`, zero sentinels, and an empty `markets` array.","operationId":"fetchTradingFees","parameters":[{"name":"market_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z0-9]+(-[A-Z0-9]+)*$","maxLength":64},"description":"Optional exact target for an account fee preflight. When present and currently mirrored, the response contains exactly this market in `markets` and uses its maker/taker pair as the headline. A well-formed target whose fee parameters are unavailable or stale returns HTTP 200 with `schedule: unknown`, zero headline sentinels, and no rows; it never falls back to an unrelated venue reference. A malformed value, including supplying the scalar parameter more than once, is rejected with `400` (`INVALID_MARKET_ID`). The raw query string is part of the HMAC canonical request and must be signed exactly as sent."}],"responses":{"200":{"description":"Account fee schedule. With `market_id`, a known target is the sole `markets` row and supplies the headline pair; an unavailable or stale target fails closed as `unknown` rather than substituting another market's rate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountFees"}}}},"400":{"$ref":"#/components/responses/InvalidMarketId"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}
````

**Test it** cannot sign this request. `X-Signature` is an HMAC computed per call: see [Authentication](/api-reference/guides/authentication.md), or use an SDK.

***

<sub>API version</sub> <sub></sub><sub>`0.9.131`</sub>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nexus.xyz/api-reference/account/fetch-trading-fees.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
