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

GET /account/margin-mode

Read the account default and effective margin mode

Read the account default and effective margin mode.

operationId: getMarginMode · CCXT method: fetchMarginMode

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

Authentication: hmacAuth.

Read the account default and effective margin mode

get
/account/margin-mode

Returns the account-level default and the mode that governs the selected market. source states whether the effective result comes from the account default, an open position, or forced market policy. Only account_default is mutable through this route.

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_idstringRequired
Responses
200

The account default and effective margin mode with its source.

application/json
market_idstringRequired
account_defaultstring · enumRequiredPossible values:
effective_modestring · enumRequiredPossible values:
sourcestring · enumRequiredPossible values:
mutablebooleanRequired

True only when POST can change the effective result through the account default.

get/account/margin-mode
GET /v1/account/margin-mode?market_id=text HTTP/1.1
Host: api.testnet.nexus.xyz
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "market_id": "text",
  "account_default": "cross",
  "effective_mode": "cross",
  "source": "account_default",
  "mutable": true
}

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