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

# Account

## Set Position Mode

> Switch the account between one-way and hedge position modes when account state allows the change.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/position-mode":{"post":{"tags":["Account"],"summary":"Set Position Mode","operationId":"setPositionMode","description":"Switch the account between one-way and hedge position modes when account state allows the change.","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WriteCommonParams"},{"type":"object","required":["position_mode"],"properties":{"position_mode":{"type":"string","enum":["one_way","hedge"]}}}]}}}},"responses":{"200":{"description":"Position mode updated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"tx_hash":{"type":"string"},"position_mode":{"type":"string"}}}}}]}}}},"422":{"description":"Rejected (e.g. `20004` open positions/orders prevent switch)"}}}}},"components":{"schemas":{"WriteCommonParams":{"type":"object","required":["address","nonce","expires_after","signature"],"properties":{"address":{"type":"string","description":"Signer's Ethereum address (`0x`-prefixed, lowercase hex). The node uses `ecrecover` to verify this matches the recovered signer.","pattern":"^0x[a-fA-F0-9]{40}$"},"nonce":{"type":"integer","format":"int64","description":"Millisecond Unix timestamp (`Date.now()`). Tracked **per signer** — each Agent Key has an independent nonce space."},"expires_after":{"type":"integer","format":"int64","description":"Expiration timestamp (ms). Recommended `Date.now() + 600_000` (10 minutes)."},"target_address":{"type":"string","description":"Optional target account address. Omit to operate on the signer's own account.\nUsed when an Agent operates on a sub-account.\n**Conditionally signed**: it does not enter `actionHash`, but when present it must be\nincluded as `Agent.targetAddress` in the EIP-712 struct (6-field Agent — see Signing\nMethod A). **Not allowed** on private-key-only endpoints.\n","pattern":"^0x[a-fA-F0-9]{40}$"},"signature":{"$ref":"#/components/schemas/Signature"}}},"Signature":{"type":"object","description":"ECDSA signature components `(r, s, v)` over the EIP-712 signing hash.","required":["r","s","v"],"properties":{"r":{"type":"string","description":"32-byte hex string with `0x` prefix."},"s":{"type":"string","description":"32-byte hex string with `0x` prefix."},"v":{"type":"integer","description":"Recovery identifier — typically 27 or 28.","enum":[27,28]}}},"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}}}}}
```

## Set Contract Leverage

> Set contract leverage for a perpetual symbol within the account’s allowed risk bracket.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/leverage":{"post":{"tags":["Account"],"summary":"Set Contract Leverage","operationId":"setContractLeverage","description":"Set contract leverage for a perpetual symbol within the account’s allowed risk bracket.","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WriteCommonParams"},{"type":"object","required":["symbol_id","margin_mode","leverage"],"properties":{"symbol_id":{"type":"integer"},"margin_mode":{"type":"string","enum":["cross","isolated"]},"position_side":{"type":"string","enum":["long","short"],"description":"Required when hedge + isolated (each side can have its own leverage)."},"leverage":{"type":"integer"}}}]}}}},"responses":{"200":{"description":"Leverage updated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"tx_hash":{"type":"string"},"symbol_id":{"type":"integer"},"margin_mode":{"type":"string"},"position_side":{"type":"string"},"leverage":{"type":"integer"}}}}}]}}}}}}}},"components":{"schemas":{"WriteCommonParams":{"type":"object","required":["address","nonce","expires_after","signature"],"properties":{"address":{"type":"string","description":"Signer's Ethereum address (`0x`-prefixed, lowercase hex). The node uses `ecrecover` to verify this matches the recovered signer.","pattern":"^0x[a-fA-F0-9]{40}$"},"nonce":{"type":"integer","format":"int64","description":"Millisecond Unix timestamp (`Date.now()`). Tracked **per signer** — each Agent Key has an independent nonce space."},"expires_after":{"type":"integer","format":"int64","description":"Expiration timestamp (ms). Recommended `Date.now() + 600_000` (10 minutes)."},"target_address":{"type":"string","description":"Optional target account address. Omit to operate on the signer's own account.\nUsed when an Agent operates on a sub-account.\n**Conditionally signed**: it does not enter `actionHash`, but when present it must be\nincluded as `Agent.targetAddress` in the EIP-712 struct (6-field Agent — see Signing\nMethod A). **Not allowed** on private-key-only endpoints.\n","pattern":"^0x[a-fA-F0-9]{40}$"},"signature":{"$ref":"#/components/schemas/Signature"}}},"Signature":{"type":"object","description":"ECDSA signature components `(r, s, v)` over the EIP-712 signing hash.","required":["r","s","v"],"properties":{"r":{"type":"string","description":"32-byte hex string with `0x` prefix."},"s":{"type":"string","description":"32-byte hex string with `0x` prefix."},"v":{"type":"integer","description":"Recovery identifier — typically 27 or 28.","enum":[27,28]}}},"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}}}}}
```

## Adjust Isolated Margin

> Add or remove isolated margin for an existing isolated position.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/isolated-margin":{"post":{"tags":["Account"],"summary":"Adjust Isolated Margin","operationId":"adjustIsolatedMargin","description":"Add or remove isolated margin for an existing isolated position.","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WriteCommonParams"},{"type":"object","required":["symbol_id","position_side","adjust_amount"],"properties":{"symbol_id":{"type":"integer"},"position_side":{"type":"string","enum":["both","long","short"],"description":"Required. One-way mode → `both`; hedge mode → `long` / `short`."},"adjust_amount":{"type":"string","description":"Positive = add, negative = remove (decimal string)."}}}]}}}},"responses":{"200":{"description":"Adjustment acknowledged","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"tx_hash":{"type":"string"},"symbol_id":{"type":"integer"},"position_side":{"type":"string"},"adjust_amount":{"type":"string"}}}}}]}}}}}}}},"components":{"schemas":{"WriteCommonParams":{"type":"object","required":["address","nonce","expires_after","signature"],"properties":{"address":{"type":"string","description":"Signer's Ethereum address (`0x`-prefixed, lowercase hex). The node uses `ecrecover` to verify this matches the recovered signer.","pattern":"^0x[a-fA-F0-9]{40}$"},"nonce":{"type":"integer","format":"int64","description":"Millisecond Unix timestamp (`Date.now()`). Tracked **per signer** — each Agent Key has an independent nonce space."},"expires_after":{"type":"integer","format":"int64","description":"Expiration timestamp (ms). Recommended `Date.now() + 600_000` (10 minutes)."},"target_address":{"type":"string","description":"Optional target account address. Omit to operate on the signer's own account.\nUsed when an Agent operates on a sub-account.\n**Conditionally signed**: it does not enter `actionHash`, but when present it must be\nincluded as `Agent.targetAddress` in the EIP-712 struct (6-field Agent — see Signing\nMethod A). **Not allowed** on private-key-only endpoints.\n","pattern":"^0x[a-fA-F0-9]{40}$"},"signature":{"$ref":"#/components/schemas/Signature"}}},"Signature":{"type":"object","description":"ECDSA signature components `(r, s, v)` over the EIP-712 signing hash.","required":["r","s","v"],"properties":{"r":{"type":"string","description":"32-byte hex string with `0x` prefix."},"s":{"type":"string","description":"32-byte hex string with `0x` prefix."},"v":{"type":"integer","description":"Recovery identifier — typically 27 or 28.","enum":[27,28]}}},"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}}}}}
```

## Get Balance

> Return wallet balances and margin-related account data for the requested address.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/balance":{"get":{"tags":["Account"],"summary":"Get Balance","operationId":"getBalance","description":"Return wallet balances and margin-related account data for the requested address.","parameters":[{"$ref":"#/components/parameters/AddressQuery"}],"responses":{"200":{"description":"Account balance","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"address":{"type":"string"},"coins":{"type":"array","items":{"$ref":"#/components/schemas/BalanceCoin"}}}}}}]}}}}}}}},"components":{"parameters":{"AddressQuery":{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Account address (`0x`-prefixed hex)."}},"schemas":{"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}},"BalanceCoin":{"type":"object","properties":{"coin_id":{"type":"integer"},"balance":{"type":"string"},"spot_order_frozen":{"type":"string"},"transfer_frozen":{"type":"string"},"isolated_balance":{"type":"string","description":"Sum of isolated margins for this coin."},"created_time":{"type":"integer","format":"int64"},"updated_time":{"type":"integer","format":"int64"}}}}}}
```

## Get Positions

> Return current open positions for an address across supported perpetual symbols.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/positions":{"get":{"tags":["Account"],"summary":"Get Positions","operationId":"getPositions","description":"Return current open positions for an address across supported perpetual symbols.","parameters":[{"$ref":"#/components/parameters/AddressQuery"}],"responses":{"200":{"description":"Open positions","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/Position"}}}}}}]}}}}}}}},"components":{"parameters":{"AddressQuery":{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Account address (`0x`-prefixed hex)."}},"schemas":{"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}},"Position":{"type":"object","description":"Open position.","properties":{"symbol_id":{"type":"integer"},"address":{"type":"string"},"position_side":{"type":"string","enum":["both","long","short"]},"margin_mode":{"type":"string","enum":["cross","isolated"]},"open_size":{"type":"string","description":"Position size. Positive = long, negative = short."},"avg_price":{"type":"string","description":"Average open price."},"leverage":{"type":"integer"},"cum_realized_pnl":{"type":"string"},"cum_close_size":{"type":"string"},"cum_close_value":{"type":"string"},"cum_fee":{"type":"string"},"cum_funding_fee":{"type":"string"},"max_size":{"type":"string"},"isolated_margin":{"type":"string","nullable":true,"description":"Isolated margin (only present when `margin_mode=isolated`)."},"adl_level":{"type":"integer","minimum":1,"maximum":5},"created_time":{"type":"integer","format":"int64"},"updated_time":{"type":"integer","format":"int64"}}}}}}
```

## Position History

> Return closed position history for an address with pagination support.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/positions/history":{"get":{"tags":["Account"],"summary":"Position History","operationId":"positionHistory","description":"Return closed position history for an address with pagination support.","parameters":[{"$ref":"#/components/parameters/AddressQuery"},{"$ref":"#/components/parameters/SymbolIdQuery"},{"$ref":"#/components/parameters/StartTimeQuery"},{"$ref":"#/components/parameters/EndTimeQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"}],"responses":{"200":{"description":"Closed positions","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/PositionHistory"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}}}}}]}}}}}}}},"components":{"parameters":{"AddressQuery":{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Account address (`0x`-prefixed hex)."},"SymbolIdQuery":{"name":"symbol_id","in":"query","required":false,"schema":{"type":"integer"},"description":"Symbol ID. Omit to match all symbols."},"StartTimeQuery":{"name":"start_time","in":"query","required":false,"schema":{"type":"integer","format":"int64"},"description":"Start time (Unix ms)."},"EndTimeQuery":{"name":"end_time","in":"query","required":false,"schema":{"type":"integer","format":"int64"},"description":"End time (Unix ms)."},"LimitQuery":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50},"description":"Page size."},"CursorQuery":{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Pagination cursor from the previous response's `next_cursor`."}},"schemas":{"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}},"PositionHistory":{"type":"object","properties":{"symbol_id":{"type":"integer"},"position_side":{"type":"string","enum":["both","long","short"]},"margin_mode":{"type":"string","enum":["cross","isolated"]},"max_size":{"type":"string"},"avg_entry_price":{"type":"string"},"avg_close_price":{"type":"string"},"leverage":{"type":"integer"},"realized_pnl":{"type":"string"},"cum_fee":{"type":"string"},"cum_funding_fee":{"type":"string"},"open_time":{"type":"integer","format":"int64"},"close_time":{"type":"integer","format":"int64"}}}}}}
```

## Get Contract Leverage

> Return the account’s current contract leverage setting for a symbol.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/leverage":{"get":{"tags":["Account"],"summary":"Get Contract Leverage","operationId":"getContractLeverage","description":"Return the account’s current contract leverage setting for a symbol.","parameters":[{"$ref":"#/components/parameters/AddressQuery"},{"name":"symbol_id","in":"query","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Current leverage","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"symbol_id":{"type":"integer"},"margin_mode":{"type":"string"},"position_side":{"type":"string"},"leverage":{"type":"integer"}}}}}]}}}}}}}},"components":{"parameters":{"AddressQuery":{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Account address (`0x`-prefixed hex)."}},"schemas":{"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}}}}}
```

## Get Leverage Brackets

> Return the leverage and risk bracket configuration available to the account for a symbol.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/leverage-bracket":{"get":{"tags":["Account"],"summary":"Get Leverage Brackets","operationId":"getLeverageBrackets","description":"Return the leverage and risk bracket configuration available to the account for a symbol.","parameters":[{"$ref":"#/components/parameters/AddressQuery"}],"responses":{"200":{"description":"Leverage brackets","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"list":{"type":"array","items":{"type":"object","properties":{"symbol_id":{"type":"integer"},"brackets":{"type":"array","items":{"$ref":"#/components/schemas/LeverageBracket"}}}}}}}}}]}}}}}}}},"components":{"parameters":{"AddressQuery":{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Account address (`0x`-prefixed hex)."}},"schemas":{"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}},"LeverageBracket":{"type":"object","properties":{"notional_cap":{"type":"string"},"max_leverage":{"type":"integer"},"mmr":{"type":"string"}}}}}}
```

## Get Asset Flow

> Return asset movement history for an address, including deposits, withdrawals, fees, and funding records.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/asset-flow":{"get":{"tags":["Account"],"summary":"Get Asset Flow","operationId":"getAssetFlow","description":"Return asset movement history for an address, including deposits, withdrawals, fees, and funding records.","parameters":[{"$ref":"#/components/parameters/AddressQuery"},{"name":"coin_id","in":"query","required":false,"schema":{"type":"integer"}},{"name":"flow_type","in":"query","required":false,"schema":{"type":"string","enum":["deposit","withdraw","pnl","spot_buy","spot_sell","fee","funding_fee","liquidation","transfer","interest","isolated_open","isolated_close","isolated_margin_change","system_adjust"]}},{"$ref":"#/components/parameters/StartTimeQuery"},{"$ref":"#/components/parameters/EndTimeQuery"},{"$ref":"#/components/parameters/LimitQuery"},{"$ref":"#/components/parameters/CursorQuery"}],"responses":{"200":{"description":"Asset flow records (paginated)","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"list":{"type":"array","items":{"$ref":"#/components/schemas/AssetFlow"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}}}}}]}}}}}}}},"components":{"parameters":{"AddressQuery":{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Account address (`0x`-prefixed hex)."},"StartTimeQuery":{"name":"start_time","in":"query","required":false,"schema":{"type":"integer","format":"int64"},"description":"Start time (Unix ms)."},"EndTimeQuery":{"name":"end_time","in":"query","required":false,"schema":{"type":"integer","format":"int64"},"description":"End time (Unix ms)."},"LimitQuery":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50},"description":"Page size."},"CursorQuery":{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Pagination cursor from the previous response's `next_cursor`."}},"schemas":{"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}},"AssetFlow":{"type":"object","properties":{"flow_id":{"type":"string"},"coin_id":{"type":"integer"},"flow_type":{"type":"string","description":"See [Enums](/reference/enums) for the full list of flow types.","enum":["deposit","withdraw","pnl","spot_buy","spot_sell","fee","funding_fee","liquidation","transfer","interest","isolated_open","isolated_close","isolated_margin_change","system_adjust"]},"balance_delta":{"type":"string","description":"Positive = increase, negative = decrease."},"balance_after":{"type":"string"},"biz_id":{"type":"string"},"tx_hash":{"type":"string"},"update_time":{"type":"integer","format":"int64"}}}}}}
```

## Get Account Settings

> Return account-level trading settings such as position mode and related configuration.

```json
{"openapi":"3.0.3","info":{"title":"UniX API","version":"1.11.0"},"tags":[{"name":"Account"}],"servers":[{"url":"https://api.unixtrade.pro/v1","description":"Production"}],"paths":{"/account/settings":{"get":{"tags":["Account"],"summary":"Get Account Settings","operationId":"getAccountSettings","description":"Return account-level trading settings such as position mode and related configuration.","parameters":[{"$ref":"#/components/parameters/AddressQuery"}],"responses":{"200":{"description":"Account settings","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseEnvelope"},{"type":"object","properties":{"data":{"type":"object","properties":{"address":{"type":"string"},"position_mode":{"type":"string","enum":["one_way","hedge"]},"auto_borrow":{"type":"boolean"}}}}}]}}}}}}}},"components":{"parameters":{"AddressQuery":{"name":"address","in":"query","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"description":"Account address (`0x`-prefixed hex)."}},"schemas":{"ResponseEnvelope":{"type":"object","description":"Standard response envelope shared by every endpoint.","required":["code","msg","data"],"properties":{"code":{"type":"string","description":"`\"0\"` for success. Non-zero indicates an error code — see [Error Codes](/reference/error-codes)."},"msg":{"type":"string","description":"Empty on success; human-readable error description on failure."},"data":{"description":"Endpoint-specific payload on success; `null` on failure.","nullable":true},"trace_code":{"type":"string","description":"Backend trace identifier. Empty on success; populated on failure for support diagnostics."}}}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.unix.market/rest-api/account.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
