# Account Data

Endpoints to retrieve account information, balances, and historical activity.

## Get Account Settings

`GET /v2/account-settings/{source}`

Get the account settings for the currently authorised user

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your account settings in our DTW smart contract on (e.g. `OFFCHAIN`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `accountSettings` | AccountSetting[] | Account Settings |


  Example (Account Settings response):
  ```json
  {"accountSettings":[{"settingType":"COMMISSION","setting":"0.001"},{"settingType":"COLLATERAL_CREDIT_LEVERAGE","setting":"2"}]}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid order source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/account-settings/{source}" \
  -H "Authorization: Bearer <token>"
```

---

## Get Account Snapshot

`GET /v2/account-snapshot/{source}`

Get snapshot of your account showing your balances, their valuations in account asset, the available to withdraw in each asset and then your credit usages. The available to withdraw is the amount of an asset you could withdraw whilst leaving enough balance in the account to satisfy any credit usage.

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your snapshot in our DTW smart contract on (e.g. `OFFCHAIN`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `accountAsset` | string | Account asset (e.g. `usd`) |
  | `balances` | BalanceEntry[] |  |
  | `totalAccountAssetValuation` | string | Total valuation in account asset (e.g. `25864.23`) |
  | `totalCredit` | string | Total credit (e.g. `25864.23`) |
  | `creditUsed` | string | Credit used (e.g. `10433.1`) |


  Example (Account Snapshot response):
  ```json
  {"accountAsset":"usdc","balances":[{"asset":"usdc","balance":"33","accountAssetValuation":"33","availableToWithdraw":"33"},{"asset":"eth","balance":"4","accountAssetValuation":"8000","availableToWithdraw":"3.5665"},{"asset":"sol","balance":"-3","accountAssetValuation":"-600","availableToWithdraw":"0"}],"totalAccountAssetValuation":"7433","totalCredit":"14866","creditUsed":"600"}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid Order Source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/account-snapshot/{source}" \
  -H "Authorization: Bearer <token>"
```

---

## Get Balance

`GET /v3/balance/{source}`

Get the balances for the currently authorised user

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your balance in our DTW smart contract on (e.g. `OFFCHAIN`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `balances` | BalanceV2[] | balances |

- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid Order Source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v3/balance/{source}" \
  -H "Authorization: Bearer <token>"
```

---

## Get Commission Rate

`GET /v2/commission-rate/{source}`

Get the commission rate for the specified asset pair

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your commission in our DTW smart contract on (e.g. `OFFCHAIN`) |
| `buying_asset` | query | Yes | string | Asset you with to buy (e.g. `btc`) |
| `selling_asset` | query | Yes | string | Asset you with to sell (e.g. `eth`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `buyingAsset` | string |  |
  | `sellingAsset` | string |  |
  | `commission` | string |  |


  Example (Commission Rate response):
  ```json
  {"buyingAsset":"btc","sellingAsset":"eth","commission":"0.001"}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid order source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/commission-rate/{source}" \
  -H "Authorization: Bearer <token>"
```

---

## Get Credit Usage

`GET /v2/credit/{source}`

Get credit usage for the currently authorised user

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `source` | path | Yes | string | Please use OFFCHAIN, credit does not exist for on-chain trading currently. (e.g. `OFFCHAIN`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `totalCredit` | string | Total Credit (e.g. `12932.1`) |
  | `creditUsed` | string | Credit Used (e.g. `10120.65`) |

- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid Order Source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/credit/{source}" \
  -H "Authorization: Bearer <token>"
```

---

## Get Historical Deposits

`GET /v3/deposits`

Retrieves the user's deposit history, specified by the timestamp using the query parameters.

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `source` | query | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your deposit updates on (e.g. `OFFCHAIN`) |
| `start_time` | query | Yes | string | Point in time to receive results from (e.g. `2025-10-20T07:00:00.465Z`) |
| `end_time` | query | Yes | string | Point in time to receive results to (e.g. `2025-10-25T12:00:00.465Z`) |
| `page_size` | query | No | string | Optionally specify the page size. This defaults to 500 and can be a max of 2000 (e.g. `100`) |
| `before` | query | No | string | Optionally specify the before cursor from a previous query. Cannot be used in conjunction with the 'after' parameter |
| `after` | query | No | string | Optionally specify the after cursor from a previous query. Cannot be used in conjunction with the 'before' parameter |
| `order_by` | query | No | string | Optionally specify the order of results. Defaults to oldest_first |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `user` | string | User |
  | `orderSource` | string | Order Source |
  | `activityType` | string | Activity Type |
  | `transactions` | AccountActivity[] | Transactions |
  | `beforeCursor` | string | Before Cursor |
  | `afterCursor` | string | After Cursor |
  | `hasMore` | boolean | Whether more results exist beyond this page |


  Example (Deposit Response):
  ```json
  {"user":"userAddsh4d","orderSource":"OFFCHAIN","activityType":"DEPOSIT","transactions":[{"asset":"usdc","amount":"10000","timestampMillis":"1764069040681"},{"asset":"eth","amount":"4.12","timestampMillis":"1764069040697"}],"beforeCursor":"182","afterCursor":"183","hasMore":false}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid order source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v3/deposits" \
  -H "Authorization: Bearer <token>"
```

---

## Get Historical Withdrawals

`GET /v3/withdrawals`

Retrieves the user's withdrawal history, specified by the timestamp using the query parameters.

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `source` | query | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your withdrawal updates on (e.g. `OFFCHAIN`) |
| `start_time` | query | Yes | string | Point in time to receive results from (e.g. `2025-10-20T07:00:00.465Z`) |
| `end_time` | query | Yes | string | Point in time to receive results to (e.g. `2025-10-25T12:00:00.465Z`) |
| `page_size` | query | No | string | Optionally specify the page size. This defaults to 500 and can be a max of 2000 (e.g. `100`) |
| `before` | query | No | string | Optionally specify the before cursor from a previous query. Cannot be used in conjunction with the 'after parameter |
| `after` | query | No | string | Optionally specify the after cursor from a previous query. Cannot be used in conjunction with the 'before' parameter |
| `order_by` | query | No | string | Optionally specify the order of results. Defaults to oldest_first |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `user` | string | User |
  | `orderSource` | string | Order Source |
  | `activityType` | string | Activity Type |
  | `transactions` | AccountActivity[] | Transactions |
  | `beforeCursor` | string | Before Cursor |
  | `afterCursor` | string | After Cursor |
  | `hasMore` | boolean | Whether more results exist beyond this page |


  Example (Withdrawal Response):
  ```json
  {"user":"userAcc3y4u","orderSource":"OFFCHAIN","activityType":"WITHDRAWAL","transactions":[{"asset":"usdc","amount":"10000","timestampMillis":"1764069040681","reference":{"instructionId":"hfeUP9vvF0j6rw0J3hrWrw6iZv322h6i","transactionHash":"0xabc123def456","activityLocation":"ETHEREUM"}},{"asset":"eth","amount":"3.2","timestampMillis":"1764069040697"}],"beforeCursor":"181","afterCursor":"182","hasMore":false}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid order source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v3/withdrawals" \
  -H "Authorization: Bearer <token>"
```

---

## Get Order History

`GET /v3/order-history`

Returns a user's order history in chronological order (oldest first) by default, can optionally reverse this order using the `order_by` query parameter - this will also reverse the before / after cursor so that you can page through consistently

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `sub_account` | query | No | string | Deprecated (Sunset: 2026-02-01). Please provide as a path parameter instead - using the endpoint: /v3/accounts/{accountId}/order-history |
| `start_time` | query | No | string | Optionally specify a start time for your query (e.g. `2025-06-04T12:50:39.465Z`) |
| `end_time` | query | No | string | Optionally specify an end time for your query (e.g. `2025-06-04T12:50:39.465Z`) |
| `page_size` | query | No | string | Optionally specify the page size. This defaults to 500 and can be a max of 2000 (e.g. `100`) |
| `before` | query | No | string | Optionally specify the before cursor from a previous query. Cannot be used in conjunction with the 'after parameter. |
| `after` | query | No | string | Optionally specify the after cursor from a previous query. Cannot be used in conjunction with the 'before' parameter |
| `order_by` | query | No | string | specify order you would like to receive results (e.g. `newest_first`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `orders` | Order[] | A page of orders |
  | `beforeCursor` | string | A cursor pointing to the earliest retrieved order |
  | `afterCursor` | string | A cursor pointing to the latest retrieved order |
  | `hasMore` | boolean | Whether more results exist beyond this page |

- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid query parameters):
  ```json
  {"code":"INVALID_QUERY_PARAMS","description":"Invalid cursor '4'"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v3/order-history" \
  -H "Authorization: Bearer <token>"
```

---

## Get Sub Accounts

`GET /v2/accounts`

Get the sub-accounts for the current account

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `accountId` | string | Account id |
  | `subAccounts` | string[] | Sub accounts |


  Example (Account response):
  ```json
  {"accountId":"alice","subAccounts":["mallory","mallet","darth"]}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/accounts" \
  -H "Authorization: Bearer <token>"
```

---

## Get Deposit Addresses

`GET /v2/deposit-addresses`

Get all deposit addresses associated with your account. These are the addresses you can use to deposit funds.

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `addresses` | DepositAddress[] | List of deposit addresses associated with your account |


  Example (Deposit Addresses):
  ```json
  {"addresses":[{"address":"0x1234567890abcdef1234567890abcdef12345678","depositAddressReference":"Main ETH deposit","depositLocation":"ETHEREUM"}]}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/deposit-addresses" \
  -H "Authorization: Bearer <token>"
```

---

## Get Withdrawal Addresses

`GET /v2/withdrawal-addresses`

Get all withdrawal addresses associated with your account. These are the addresses that have been whitelisted for withdrawals.

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `addresses` | WithdrawalAddress[] | List of withdrawal addresses associated with your account |


  Example (Withdrawal Addresses):
  ```json
  {"addresses":[{"id":"f8cb6120-7247-4e2b-81c3-f5ff5e289018","withdrawalLocation":"ETHEREUM","withdrawalLocationReference":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","status":"PENDING"}]}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/withdrawal-addresses" \
  -H "Authorization: Bearer <token>"
```

---

