# Omnia Exchange - REST API Documentation — Full API Reference > Omnia is a next‑generation infrastructure layer enabling users to seamlessly convert any asset in real‑time via a single API, anywhere, anytime. ## Key Constraints - **Authentication**: All API endpoints (except auth endpoints) require a Bearer JWT token in the `Authorization` header. - **Token Expiry**: JWT tokens expire after 24 hours. Generate tokens via `POST /v3/auth/get-token` (API keys) or `POST /v2/auth/siwe/verify` (Ethereum wallet). - **Source Parameter**: Endpoints with a `{source}` path parameter accept `OFFCHAIN` for API trading, or a blockchain name (`ETHEREUM`, `OPTIMISM`, `POLYGON`, `LINEA`, etc.) for on-chain trading. - **Error Format**: Errors return JSON with `error_code` and `error_message` fields. HTTP 4xx = client error, 5xx = server error. - **API Versioning**: The API may add new endpoints, optional request parameters, and new response fields at any time. Clients must be tolerant of unknown fields. - **Rate Limits**: Contact sales@omniaexchange.com for rate limit details for your account tier. - **Instruction IDs**: Client-specified instruction IDs must be unique per order and at most 64 characters long. - **Quote Expiry**: RFQ quotes are valid for 5 seconds after being issued. - **Webhook Limit**: Maximum 5 webhook subscriptions per user. ## Connection Details - **Demo/UAT**: https://api.demo.omniaexchange.com/api - **Production**: https://api.production.omniaexchange.com/api - **Documentation**: https://docs.omniaexchange.com/ ## Authentication ### API Key Authentication Endpoints to generate a Bearer Token using issued API Keys. If you do not have API Keys, please contact us at sales@omniaexchange.com ## API Credential Auth `POST /v3/auth/token` Generate a JWT token using your api credentials. Tokens will expire after 24 hours **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `keyId` | string | Api key id provided during onboarding (e.g. `QNl8Xfl729CJlNgwkA329EL1D8z8BAQ2`) | | `secret` | string | Api secret provided during onboarding (e.g. `u0WgWWLXYhcS+UnAGk2H+eZ3JZp1P4kpUxcoNitzu3U=`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `jwtToken` | string | The token you should include on any requests to endpoints that require authorisation (e.g. `eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJIaSI6IkRpZCBub3QgdGhpbmsgYW55b25lIHdvdWxkIGRlY29kZSB0aGlzIiwicHVia2V5IjoiMHgwMFlvdXJQdWJsaWNLZXkwMCIsImlhdCI6MTY5OTgwMTE5NSwiZXhwIjoxNjk5ODg3NTk1fQ.CZdxZje7VRrMdfbfQSbnaliNmpmhat_tNZWiDqi-tboXqBLnP1qQRpwdl8A89eaGxkvmVmZGbeA8wP6ghqHjuzCjr1G5OwG40draexCZyBgys1IaPJFHVujrKxr3BxI5U0e8fSQ7s_kuWy3mA5SzlQJnlMy6y5WeY0GS7PACgXRBH3g3R0cua-pNmA-PzvRPTaQzU4-Bs3rsisNIcaJMIXCS2ofnvH6aLmWDpucfepJ1NgX0QJHZupBNBAoV67NPz4c9McERwG5G_pykmwz9sOJxLNpjjvf8OyF_21epX_YkxR1tzhPAHQuiIg8DAAWI7S435cR1yQyoY7R0TJWPZQ`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid schema): ```json {"code":"INVALID_SCHEMA","description":"Missing or malformed schema"} ``` **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v3/auth/token" \ -H "Content-Type: application/json" \ -d '{"keyId": "QNl8Xfl729CJlNgwkA329EL1D8z8BAQ2", "secret": "u0WgWWLXYhcS+UnAGk2H+eZ3JZp1P4kpUxcoNitzu3U="}' ``` --- ### Blockchain Authentication Endpoints to generate a Bearer Token using the Sign in with Ethereum (SIWE) standard. See https://docs.login.xyz/sign-in-with-ethereum/quickstart-guide. ## Generate a SIWE nonce `GET /v2/auth/siwe/nonce` Get a nonce to perform a Sign in with Ethereum (SIWE) verification. (https://docs.login.xyz/sign-in-with-ethereum/quickstart-guide) **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `nonce` | string | nonce (e.g. `AwxV9CQHJamoLxIJlfeh`) | **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/auth/siwe/nonce" ``` --- ## SIWE Verification `POST /v2/auth/siwe/verify` Perform Sign in with Ethereum (SIWE) verification. This will issue you a token if successful. **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `message` | string | SIWE Message (e.g. `message -> demo.omniaexchange.com wants you to sign in with your Ethereum account: 0x12YOUR_PUBLIC_KEY34 Sign in to use the app URI: https://demo.omniaexchange.com Version: 1 Chain ID: 11155111 Nonce: AwxV9CQHJamoLxIJlfeh Issued At: 2023-11-12T15:13:37.996908215Z`) | | `signature` | string | Signature of the message (e.g. `0xc2d0018de1528b8dab42e85482263060903ec1fec13768f66977f9b7b37333a3f2a1bbf42`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `jwtToken` | string | The token you should include on any requests to endpoints that require authorisation (e.g. `eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJIaSI6IkRpZCBub3QgdGhpbmsgYW55b25lIHdvdWxkIGRlY29kZSB0aGlzIiwicHVia2V5IjoiMHgwMFlvdXJQdWJsaWNLZXkwMCIsImlhdCI6MTY5OTgwMTE5NSwiZXhwIjoxNjk5ODg3NTk1fQ.CZdxZje7VRrMdfbfQSbnaliNmpmhat_tNZWiDqi-tboXqBLnP1qQRpwdl8A89eaGxkvmVmZGbeA8wP6ghqHjuzCjr1G5OwG40draexCZyBgys1IaPJFHVujrKxr3BxI5U0e8fSQ7s_kuWy3mA5SzlQJnlMy6y5WeY0GS7PACgXRBH3g3R0cua-pNmA-PzvRPTaQzU4-Bs3rsisNIcaJMIXCS2ofnvH6aLmWDpucfepJ1NgX0QJHZupBNBAoV67NPz4c9McERwG5G_pykmwz9sOJxLNpjjvf8OyF_21epX_YkxR1tzhPAHQuiIg8DAAWI7S435cR1yQyoY7R0TJWPZQ`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid schema): ```json {"code":"INVALID_SCHEMA","description":"Missing or malformed schema"} ``` - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid nonce): ```json {"code":"INVALID_NONCE","description":"Invalid nonce"} ``` - **403**: Forbidden | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (User not whitelisted): ```json {"code":"USER_NOT_WHITELISTED","description":"User is not whitelisted"} ``` **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v2/auth/siwe/verify" \ -H "Content-Type: application/json" \ -d '{"message": "message -> demo.omniaexchange.com wants you to sign in with your Ethereum account: 0x12YOUR_PUBLIC_KEY34 Sign in to use the app URI: https://demo.omniaexchange.com Version: 1 Chain ID: 11155111 Nonce: AwxV9CQHJamoLxIJlfeh Issued At: 2023-11-12T15:13:37.996908215Z", "signature": "0xc2d0018de1528b8dab42e85482263060903ec1fec13768f66977f9b7b37333a3f2a1bbf42"}' ``` --- ### Check Authentication Endpoints to verify that you are correctly authenticated to the APIs. ## Check JWT Token `GET /v2/auth/jwt-check` Checks the presence and validity of the provided JWT token **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `Authorization` | header | No | string | JWT received as part of the auth process | **Responses** - **204**: Ok - No Content - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid JWT): ```json {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"} ``` **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/auth/jwt-check" \ -H "Authorization: Bearer " ``` --- ### API Key Management Endpoints to manage your accounts API keys. ## List API Keys `GET /v3/api-keys` Returns all API keys belonging to the authenticated user with associated permissions. **Responses** - **200**: Ok - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid JWT): ```json {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"} ``` **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v3/api-keys" \ -H "Authorization: Bearer " ``` --- ## Create API Key `POST /v3/api-keys` Creates a new API key with the specified label and permissions. The requested permissions must be a subset of the permissions on the API key used to authenticate this request. Store the returned secret securely as it will not be shown again. **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `label` | string | Label for the new API key (e.g. `Trading Key`) | | `permissions` | string[] | Permissions to grant to the new API key. Must be a subset of the permissions on the API key used to make this request. | **Responses** - **201**: Created | Field | Type | Description | |-------|------|-------------| | `apiKeyId` | string | The API key id (e.g. `QNl8Xfl729CJlNgwkA329EL1D8z8BAQ2`) | | `apiKeySecret` | string | The API key secret. Store this securely, it will not be shown again. (e.g. `u0WgWWLXYhcS+UnAGk2H+eZ3JZp1P4kpUxcoNitzu3U=`) | | `label` | string | Label for the new API key (e.g. `Trading Key`) | | `permissions` | string[] | Permissions granted to this API key | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid schema): ```json {"code":"INVALID_SCHEMA","description":"Missing or malformed schema"} ``` - **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**: Requested permissions exceed those of the authenticating API key | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid permissions): ```json {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"} ``` - **500**: Internal server error | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Internal error): ```json {"code":"INTERNAL_SERVER_ERROR","description":"Internal Server Error"} ``` **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v3/api-keys" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"label": "Trading Key", "permissions": ""}' ``` --- ## Rotate API Key `POST /v3/api-keys/{apiKeyId}/rotate` Generates a new secret for the specified API key. The old secret and jwt is immediately invalidated. Store the new secret securely as it will not be shown again. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `apiKeyId` | path | Yes | string | The id of the API key to rotate | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `apiKeyId` | string | The API key id (e.g. `QNl8Xfl729CJlNgwkA329EL1D8z8BAQ2`) | | `apiKeySecret` | string | The new API key secret. Store this securely, it will not be shown again. (e.g. `u0WgWWLXYhcS+UnAGk2H+eZ3JZp1P4kpUxcoNitzu3U=`) | - **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"} ``` - **404**: API key not found or does not belong to this user | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Not found): ```json {"code":"NOT_FOUND","description":"Not Found"} ``` - **500**: Internal server error | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Internal error): ```json {"code":"INTERNAL_SERVER_ERROR","description":"Internal Server Error"} ``` **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v3/api-keys/{apiKeyId}/rotate" \ -H "Authorization: Bearer " ``` --- ## Information ### Assets Endpoints to list the assets and tokens supported by the system. ## Get Asset List `GET /v2/assets/{source}` Get all assets for a given source. If you are trading via a blockchain please use that as the source, if not use OFFCHAIN **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you wish to trade on to see its supported assets. | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `assets` | string[] | | Example (Asset List Response): ```json {"assets":["btc","usd","gbp","eur","eth","sol"]} ``` - **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/assets/{source}" \ -H "Authorization: Bearer " ``` --- ## Get Token Information `GET /v2/assets/{source}/token-information` Get on-chain information for an asset **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you wish to trade on to see its supported tokens. | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `tokenInfoResponses` | TokenInfoResponse[] | tokenInformation | Example (Token Information): ```json {"tokenInfoResponses":[{"asset":"usd","tokens":[{"token":"usdc","tokenAddress":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","decimals":"6"}]}]} ``` - **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/assets/{source}/token-information" \ -H "Authorization: Bearer " ``` --- ### Chain Data Endpoints to access on‑chain specific data. ## Get Token Information `GET /v2/assets/{source}/token-information` Get on-chain information for an asset **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you wish to trade on to see its supported tokens. | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `tokenInfoResponses` | TokenInfoResponse[] | tokenInformation | Example (Token Information): ```json {"tokenInfoResponses":[{"asset":"usd","tokens":[{"token":"usdc","tokenAddress":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","decimals":"6"}]}]} ``` - **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/assets/{source}/token-information" \ -H "Authorization: Bearer " ``` --- ## Get Order Status `GET /v3/order-status/{source}/{orderId}` Returns the status of a given order id for a given source (chain). **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-status/{source}/{orderId} | | `source` | path | Yes | string | Specify the blockchain you placed the order on | | `orderId` | path | Yes | integer | OrderId of the on chain order (e.g. `42`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - If order placed via api this is the client specified id. If placed on chain this is the transaction id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `returnTxId` | string | Return Transaction Id - If OFFCHAIN order this is null. If on chain this is the transaction id of the return transaction (Settle/Cancel) (e.g. `0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6`) | | `orderSource` | string | Source (e.g. `OFFCHAIN`) | | `sellingAsset` | string | Selling Asset (e.g. `btc`) | | `buyingAsset` | string | Buying Asset (e.g. `usd`) | | `quantitySold` | string | Amount Sold (e.g. `5.67`) | | `quantityBought` | string | Amount Received (e.g. `12932.1`) | | `limitAmount` | string | Limit Amount To Specified (e.g. `12932.1`) | | `status` | string | Status (e.g. `SETTLED`) | | `timestampMillis` | string | Timestamp (e.g. `1653480000000`) | - **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/order-status/{source}/{orderId}" \ -H "Authorization: Bearer " ``` --- ### 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 " ``` --- ## 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 " ``` --- ## 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 " ``` --- ## 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 " ``` --- ## 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 " ``` --- ## 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 " ``` --- ## 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 " ``` --- ## 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 " ``` --- ## 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 " ``` --- ## 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 " ``` --- ## 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 " ``` --- ### Market Data Endpoints to obtain pricing for all supported assets. ## Get Price `GET /v2/price/{sellingAsset}/{buyingAsset}` Returns the price of a selling asset for a buying asset. The price is the quantity of the buying asset received for 1 unit of the selling asset, e.g. selling 1 BTC for 10120.65 USD. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `sellingAsset` | path | Yes | string | Asset you wish to sell (e.g. `btc`) | | `buyingAsset` | path | Yes | string | Asset you wish to buy (e.g. `usd`) | | `commission_source` | query | No | string | If specified, returns the price adjusted to the commission you pay when trading on a particular source. If trading via API use OFFCHAIN, else specify the blockchain you plan to trade on (e.g. `OFFCHAIN`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `price` | string | Price (e.g. `10120.65`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Duplicate asset pair): ```json {"code":"DUPLICATE_ASSET_PAIR","description":"Buying and selling asset cannot be the same"} ``` - **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"} ``` - **404**: Instrument or market data not found | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (No market data): ```json {"code":"NO_MARKET_DATA_FOUND","description":"No market data found"} ``` **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/price/{sellingAsset}/{buyingAsset}" \ -H "Authorization: Bearer " ``` --- ## Get Prices `GET /v2/prices` Gets multiple prices at once. The prices of each selling/buying asset pair can be requested by including them as query params (e.g. sellingAsset/buyingAsset). The price is the quantity of the buying asset received for 1 unit of the selling asset, e.g. selling 1 BTC for 10120.65 USD. There is a limit of 50 assets at once and no duplicates are allowed. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `assets` | query | Yes | string[] | Specify all asset combinations you want prices for in the format {sellingAsset}/{buyingAsset}. This parameter can be repeated, e.g. ?assets=btc/usd&assets=eth/usd&assets=usd/sol | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `prices` | BatchPricePriceResponse[] | prices | Example (Single price success response): ```json {"prices":[{"assets":"btc/usd","price":"10120.65"}]} ``` - **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/prices" \ -H "Authorization: Bearer " ``` --- ## Get Quantity Estimate `GET /v2/quantity-estimate` Calculates the estimated quantity of a buying asset you would receive for a specified quantity of a selling asset, based on current market data **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `selling_asset` | query | Yes | string | Asset you wish to sell (e.g. `btc`) | | `buying_asset` | query | Yes | string | Asset you wish to buy (e.g. `usd`) | | `sell_quantity` | query | Yes | string | Amount you wish to sell (e.g. `1.75`) | | `commission_source` | query | No | string | If specified, returns the estimated quantity adjusted to the commission you pay when trading on a particular source. If trading via API use OFFCHAIN, else specify the blockchain you plan to trade on (e.g. `OFFCHAIN`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `sellingAsset` | string | Selling Asset (e.g. `btc`) | | `buyingAsset` | string | Buying Asset (e.g. `usd`) | | `sellingAmount` | string | Selling Amount (e.g. `5.67`) | | `quantityEstimate` | string | Quantity Estimate (e.g. `25864.23`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Not enough liquidity): ```json {"code":"NOT_ENOUGH_LIQUIDITY","description":"Not enough liquidity"} ``` - **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/quantity-estimate" \ -H "Authorization: Bearer " ``` --- ## Trading ### API Trading API endpoints for initiating trades. There are two options: Swaps and RFQ (Request for Quote). Swaps (Submit Order) - This is for when you want to sell some asset for another asset and just want to best available price at that point in time. RFQ (Request Quote + Action Quote) - This is if you need to fix the price. You specify how much you need to buy and we will give you a fixed price for 5 seconds, you can accept or reject this. This price will be slightly less competitive than doing a swap as the price has to be held. ## Action Quote `POST /v2/action-quote` Action a previously received quote. **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id that you supplied when requesting the specific quote that you wish to action. (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | **Responses** - **204**: Ok - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (No available market date): ```json {"code":"NO_MARKET_DATA_FOUND","description":"No market data found"} ``` - **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 -X POST "https://api.demo.omniaexchange.com/api/v2/action-quote" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c"}' ``` --- ## Get Order Status `GET /v2/order/{source}/{instructionId}` Check the status of an order. **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 order status on | | `instructionId` | path | Yes | string | Instruction Id - If order placed via api this is the client specified id. If placed on chain this is the transaction id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `type` | query | No | string | The type of order you wish to retrieve the status for. Available options are 'SWAP' & 'RFQ'. If not specified, defaults to 'SWAP'. | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `orderSource` | string | Order Source | | `sellingAsset` | string | Selling Asset (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `buyingAsset` | string | Buying Asset (e.g. `0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE`) | | `amountToSell` | string | Amount To Sell (e.g. `5.67`) | | `limitAmountToReceive` | string | Limit Amount To Receive (e.g. `10433.1`) | | `status` | string | Status (e.g. `COMPLETED`) | | `rejectionReason` | string | Rejection reason | | `amountReceived` | string | Amount Received (e.g. `12932.1`) | | `feePaid` | string | Fee Paid (e.g. `0.042`) | | `transactionId` | string | Transaction Id (e.g. `0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6`) | Example (Chain order response): ```json {"instructionId":"375b23de-febf-4a6e-a517-e7b5dfa9357c","orderSource":"ETHEREUM","sellingAsset":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","buyingAsset":"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE","amountToSell":"5.67","limitAmountToReceive":"10433.1","status":"COMPLETED","amountReceived":"12932.1","feePaid":"0.042","transactionId":"0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6"} ``` - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Insufficient funds): ```json {"code":"INSUFFICIENT_FUNDS","description":"Insufficient funds"} ``` - **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/order/{source}/{instructionId}" \ -H "Authorization: Bearer " ``` --- ## Submit Order `POST /v2/orders` Swap assets using a market or limit order. Specify how much of a given asset you want to sell. **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id for the order. This can be any string less than 64 in length and needs to be unique per order (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `sellingAsset` | string | Asset you wish to sell (e.g. `USD`) | | `buyingAsset` | string | Asset you wish to buy (e.g. `EUR`) | | `amountToSell` | string | Amount to sell of the selling asset (e.g. `5.67`) | | `limitAmountToReceive` | string | The minimum amount of the buying asset you want to receive (e.g. `5.5`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `sellingAsset` | string | Selling Asset (e.g. `btc`) | | `buyingAsset` | string | Buying Asset (e.g. `usd`) | | `amountToSell` | string | Amount To Sell (e.g. `5.1`) | | `limitAmountToReceive` | string | Limit Amount To Receive (e.g. `10433.1`) | | `status` | string | Status (e.g. `COMPLETED`) | | `rejectionReason` | string | Rejection reason | | `amountReceived` | string | Amount Received (e.g. `12932.1`) | | `feePaid` | string | Fee Paid (e.g. `0.042`) | Example (Offchain order response): ```json {"instructionId":"375b23de-febf-4a6e-a517-e7b5dfa9357c","sellingAsset":"usd","buyingAsset":"xrp","amountToSell":"5602.01","limitAmountToReceive":"2400","status":"COMPLETED","amountReceived":"2424.06","feePaid":"0.56"} ``` - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Asset not supported): ```json {"code":"ASSET_IS_NOT_SUPPORTED","description":"Asset is not supported"} ``` - **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 -X POST "https://api.demo.omniaexchange.com/api/v2/orders" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c", "sellingAsset": "USD", "buyingAsset": "EUR", "amountToSell": "5.67", "limitAmountToReceive": "5.5"}' ``` --- ## Request Quote `POST /v2/request-quote` Request a firm quote to swap some assets, the quote is inclusive of commission. Specify how much of an asset you want to receive. Quote is valid for 5 seconds. **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id for the quote. This can be any string less than 64 in length and needs to be unique. (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `sellingAsset` | string | Selling Asset (e.g. `USD`) | | `buyingAsset` | string | Buying Asset (e.g. `EUR`) | | `amountToBuy` | string | Amount of buying asset you want (e.g. `5.67`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - the id you specified on the request (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `sellingAsset` | string | Selling Asset (e.g. `USD`) | | `buyingAsset` | string | Buying Asset (e.g. `EUR`) | | `amountToBuy` | string | Amount To Buy (e.g. `5.67`) | | `amountToSell` | string | Amount To Sell (e.g. `12932.1`) | | `expiryTimestampMillis` | string | Time the quote expires - Epoch milliseconds (e.g. `1653480000000`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid instruction id length): ```json {"code":"INVALID_INSTRUCTION_ID_LENGTH","description":"Invalid instructionId length"} ``` - **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 -X POST "https://api.demo.omniaexchange.com/api/v2/request-quote" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c", "sellingAsset": "USD", "buyingAsset": "EUR", "amountToBuy": "5.67"}' ``` --- ### On-chain Trading Endpoints to manage trading via the Deposit‑Trade‑Withdraw (DTW) on‑chain mechanism. ## Get Order Status `GET /v2/order/{source}/{instructionId}` Check the status of an order. **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 order status on | | `instructionId` | path | Yes | string | Instruction Id - If order placed via api this is the client specified id. If placed on chain this is the transaction id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `type` | query | No | string | The type of order you wish to retrieve the status for. Available options are 'SWAP' & 'RFQ'. If not specified, defaults to 'SWAP'. | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `orderSource` | string | Order Source | | `sellingAsset` | string | Selling Asset (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `buyingAsset` | string | Buying Asset (e.g. `0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE`) | | `amountToSell` | string | Amount To Sell (e.g. `5.67`) | | `limitAmountToReceive` | string | Limit Amount To Receive (e.g. `10433.1`) | | `status` | string | Status (e.g. `COMPLETED`) | | `rejectionReason` | string | Rejection reason | | `amountReceived` | string | Amount Received (e.g. `12932.1`) | | `feePaid` | string | Fee Paid (e.g. `0.042`) | | `transactionId` | string | Transaction Id (e.g. `0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6`) | Example (Chain order response): ```json {"instructionId":"375b23de-febf-4a6e-a517-e7b5dfa9357c","orderSource":"ETHEREUM","sellingAsset":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","buyingAsset":"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE","amountToSell":"5.67","limitAmountToReceive":"10433.1","status":"COMPLETED","amountReceived":"12932.1","feePaid":"0.042","transactionId":"0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6"} ``` - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Insufficient funds): ```json {"code":"INSUFFICIENT_FUNDS","description":"Insufficient funds"} ``` - **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/order/{source}/{instructionId}" \ -H "Authorization: Bearer " ``` --- ## Submit DTW order `POST /v2/order` Swap assets using a market or limit order. Specify how much of a given asset you want to sell. This utilises the deposit trade withdraw mechanism of Alice. **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id for the order. This can be any string less than 64 in length and needs to be unique per order (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `orderSource` | string | Order Source | | `sellingAsset` | string | Selling Asset (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `buyingAsset` | string | Buying Asset (e.g. `0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE`) | | `amountToSell` | string | Amount to sell of the selling asset (e.g. `5.67`) | | `limitAmountToReceive` | string | The minimum amount of the buying asset you want to receive (e.g. `12932.1`) | | `deadline` | integer | Deadline for the order (e.g. `1653480000000`) | | `signature` | string | Signature for the order request (e.g. `0xc2d0018de1528b8dab42e85482263060903ec1fec13768f66977f9b7b37333a3f2a1bbf42`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `orderSource` | string | Order Source | | `sellingAsset` | string | Selling Asset (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `buyingAsset` | string | Buying Asset (e.g. `0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE`) | | `amountToSell` | string | Amount To Sell (e.g. `5.67`) | | `limitAmountToReceive` | string | Limit Amount To Receive (e.g. `10433.1`) | | `status` | string | Status (e.g. `COMPLETED`) | | `rejectionReason` | string | Rejection reason | | `amountReceived` | string | Amount Received (e.g. `12932.1`) | | `feePaid` | string | Fee Paid (e.g. `0.042`) | | `transactionId` | string | Transaction Id (e.g. `0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6`) | Example (Chain order response): ```json {"instructionId":"375b23de-febf-4a6e-a517-e7b5dfa9357c","orderSource":"ETHEREUM","sellingAsset":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","buyingAsset":"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE","amountToSell":"5.67","limitAmountToReceive":"10433.1","status":"COMPLETED","amountReceived":"12932.1","feePaid":"0.042","transactionId":"0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6"} ``` - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Asset not supported): ```json {"code":"ASSET_IS_NOT_SUPPORTED","description":"Asset is not supported"} ``` - **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 -X POST "https://api.demo.omniaexchange.com/api/v2/order" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c", "orderSource": "", "sellingAsset": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "buyingAsset": "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE", "amountToSell": "5.67", "limitAmountToReceive": "12932.1", "deadline": 1653480000000, "signature": "0xc2d0018de1528b8dab42e85482263060903ec1fec13768f66977f9b7b37333a3f2a1bbf42"}' ``` --- ## Operations ### API Withdrawal Endpoints to mange withdrawals using the OFFCHAIN mechanism. ## Get Fund Locations `GET /v2/fund-locations` Get the list of available locations for withdrawals **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `locations` | string[] | | Example (Fund locations): ```json {"locations":["FIAT","ETHEREUM","TRON","SOLANA","BITCOIN","BITCOIN_CASH","DOGECOIN","XRPL","LITECOIN"]} ``` - **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/fund-locations" \ -H "Authorization: Bearer " ``` --- ## Withdrawal Status `GET /v2/offchain-withdrawals/{instructionId}` Check the status of a withdrawal **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `instructionId` | path | Yes | string | Instruction Id - This is the client specified id when requesting (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - This is the client specified id when requesting (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `withdrawalLocation` | string | Withdrawal location specified in your request. (e.g. `ETHEREUM`) | | `withdrawalLocationReference` | string | The withdrawal location reference specified in your request. (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `bankReference` | string | The bank reference specified in your request. (e.g. `withdrawal-reference-1`) | | `asset` | string | asset (e.g. `usd`) | | `amount` | string | amount (e.g. `5.67`) | | `status` | string | status | | `rejectionReason` | string | rejectionReason | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Insufficient funds): ```json {"code":"INSUFFICIENT_FUNDS","description":"Insufficient funds"} ``` - **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"} ``` - **404**: Withdrawal not found | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Unknown withdrawal request): ```json {"code":"UNKNOWN_WITHDRAWAL_REQUEST","description":"No withdrawal request found for instruction id 5"} ``` **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/offchain-withdrawals/{instructionId}" \ -H "Authorization: Bearer " ``` --- ## Withdrawal Request `POST /v2/offchain-withdrawals` Create a withdrawal request **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id for the request. This can be any string less than 64 in length and needs to be unique per request (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `withdrawalLocation` | string | Withdrawal location (e.g. `ETHEREUM`) | | `withdrawalLocationReference` | string | Withdrawal location reference. If withdrawal location is a blockchain - specify your wallet you want to withdraw to, this must have been already whitelisted. If withdrawal location is FIAT please specify the bank name, this must have been already whitelisted. (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `bankReference` | string | Bank reference. If specified, this is the bank reference associated with the withdrawal. This can be any string up to 35 characters in length. (e.g. `withdrawal-reference-1`) | | `asset` | string | Asset to withdraw (e.g. `usd`) | | `amount` | string | Amount to withdraw. Maximum of 5 decimal places. (e.g. `5.67`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - This is the client specified id when requesting (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `withdrawalLocation` | string | Withdrawal location specified in your request. (e.g. `ETHEREUM`) | | `withdrawalLocationReference` | string | The withdrawal location reference specified in your request. (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `bankReference` | string | The bank reference specified in your request. (e.g. `withdrawal-reference-1`) | | `asset` | string | asset (e.g. `usd`) | | `amount` | string | amount (e.g. `5.67`) | | `status` | string | status | | `rejectionReason` | string | rejectionReason | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid amount): ```json {"code":"INVALID_AMOUNT","description":"Amount passed in must be present, a numeric value and greater than 0"} ``` - **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 -X POST "https://api.demo.omniaexchange.com/api/v2/offchain-withdrawals" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c", "withdrawalLocation": "ETHEREUM", "withdrawalLocationReference": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "bankReference": "withdrawal-reference-1", "asset": "usd", "amount": "5.67"}' ``` --- ### On-chain Withdrawal Endpoints to manage withdrawals via the Deposit‑Trade‑Withdraw (DTW) on‑chain mechanism. ## Withdrawal Status `GET /v2/withdrawals/{instructionId}` Check the status of a withdrawal **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `instructionId` | path | Yes | string | Instruction Id - This is the client specified id when requesting (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - This is the client specified id when requesting (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `orderSource` | string | orderSource | | `tokenAddress` | string | tokenAddress (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `amount` | string | amount (e.g. `5.67`) | | `status` | string | status | | `rejectionReason` | string | rejectionReason | | `transactionId` | string | transaction Id (e.g. `0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6`) | Example (Withdrawal response): ```json {"instructionId":"375b23de-febf-4a6e-a517-e7b5dfa9357c","orderSource":"ETHEREUM","tokenAddress":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","amount":"5.67","status":"COMPLETED","transactionId":"0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6"} ``` - **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"} ``` - **404**: Withdrawal not found | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Unknown withdrawal request): ```json {"code":"UNKNOWN_WITHDRAWAL_REQUEST","description":"No withdrawal request found for instruction id 5"} ``` **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/withdrawals/{instructionId}" \ -H "Authorization: Bearer " ``` --- ## Withdrawal Request `POST /v2/withdrawals` Create a withdrawal request to remove assets from the Deposit, Trade, Withdraw contract. **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id for the request. This can be any string less than 64 in length and needs to be unique per request (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `orderSource` | string | orderSource | | `tokenAddress` | string | tokenAddress (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `amount` | string | amount (e.g. `5.67`) | | `deadline` | integer | deadline (e.g. `1653480000000`) | | `signature` | string | signature (e.g. `0xc2d0018de1528b8dab42e85482263060903ec1fec13768f66977f9b7b37333a3f2a1bbf42`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - This is the client specified id when requesting (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `orderSource` | string | orderSource | | `tokenAddress` | string | tokenAddress (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `amount` | string | amount (e.g. `5.67`) | | `status` | string | status | | `rejectionReason` | string | rejectionReason | | `transactionId` | string | transaction Id (e.g. `0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6`) | Example (Withdrawal response): ```json {"instructionId":"375b23de-febf-4a6e-a517-e7b5dfa9357c","orderSource":"ETHEREUM","tokenAddress":"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","amount":"5.67","status":"COMPLETED","transactionId":"0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6"} ``` - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Order source not found): ```json {"code":"ORDER_SOURCE_NOT_FOUND","description":"Order source not found"} ``` - **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 -X POST "https://api.demo.omniaexchange.com/api/v2/withdrawals" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c", "orderSource": "", "tokenAddress": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "amount": "5.67", "deadline": 1653480000000, "signature": "0xc2d0018de1528b8dab42e85482263060903ec1fec13768f66977f9b7b37333a3f2a1bbf42"}' ``` --- ## Websocket ### Websocket Endpoints to open and manage websocket connections to the system. ## Authentication Ticket `POST /v3/auth/ticket` Generate a ticket for use with websockets if your client does not support customisable headers. **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `keyId` | string | Api key id provided during onboarding (e.g. `QNl8Xfl729CJlNgwkA329EL1D8z8BAQ2`) | | `secret` | string | Api secret provided during onboarding (e.g. `u0WgWWLXYhcS+UnAGk2H+eZ3JZp1P4kpUxcoNitzu3U=`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `ticket` | string | The ticket you should include as part of the query when establishing a websocket connection (e.g. `eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJIaSI6IkRpZCBub3QgdGhpbmsgYW55b25lIHdvdWxkIGRlY29kZSB0aGlzIiwicHVia2V5IjoiMHgwMFlvdXJQdWJsaWNLZXkwMCIsImlhdCI6MTY5OTgwMTE5NSwiZXhwIjoxNjk5ODg3NTk1fQ.CZdxZje7VRrMdfbfQSbnaliNmpmhat_tNZWiDqi-tboXqBLnP1qQRpwdl8A89eaGxkvmVmZGbeA8wP6ghqHjuzCjr1G5OwG40draexCZyBgys1IaPJFHVujrKxr3BxI5U0e8fSQ7s_kuWy3mA5SzlQJnlMy6y5WeY0GS7PACgXRBH3g3R0cua-pNmA-PzvRPTaQzU4-Bs3rsisNIcaJMIXCS2ofnvH6aLmWDpucfepJ1NgX0QJHZupBNBAoV67NPz4c9McERwG5G_pykmwz9sOJxLNpjjvf8OyF_21epX_YkxR1tzhPAHQuiIg8DAAWI7S435cR1yQyoY7R0TJWPZQ`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid schema): ```json {"code":"INVALID_SCHEMA","description":"Missing or malformed schema"} ``` **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v3/auth/ticket" \ -H "Content-Type: application/json" \ -d '{"keyId": "QNl8Xfl729CJlNgwkA329EL1D8z8BAQ2", "secret": "u0WgWWLXYhcS+UnAGk2H+eZ3JZp1P4kpUxcoNitzu3U="}' ``` --- ## Open Websocket `GET /v2/websocket` Open a websocket with Alice. This will allow you to subscribe to live data channels. **Available Channels:** **PRICE_FEED_UPDATES** — Receive real-time price updates for specified asset pairs. You must provide a list of asset pairs (sellingAsset/buyingAsset) in the subscription body. **ACCOUNT_ACTIVITY** — Receive notifications when deposits or withdrawals occur on your account. **ORDERS** — Receive notifications when your orders are settled or cancelled, including both offchain and on-chain orders. You must subscribe to at least one channel within 5 seconds or we will close your socket with a 400. You can subscribe to multiple channels simultaneously by including them in the same subscription message. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `token` | query | No | string | If you are connecting via a browser or a client that doesn't support header customisation, you can pass the ticket which you retrieve from '/v3/auth/ticket' as a query param in order to subscribe to price updates (e.g. `eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJrZXktaWQiOiIzdVFjSnJZQkJlVlFwUExsVDNNY3pETGxUVktkRHEzRCIsImtleSI6InVzZXIxNjZpc2FyIiwidmVyc2lvbiI6MSwicGVybWlzc2lvbnMiOlsiQUNDT1VOVF9NQUlOVEVOQU5DRSIsIk1BUktFVF9EQVRBIiwiUkZRIiwiQUNDT1VOVF9JTkZPUk1BVElPTiIsIlRSQURJTkciXSwiaWF0IjoxNzYzMzkyOTYxLCJleHAiOjE3NjM0NzkzNjEsInN1YiI6IjN1UWNKcllCQmVWUXBQTGxUM01jekRMbFRWS2REcTNEIn0.oQgdavtOnn8mdZj8_JM78197F1LUlZN3W8ry3v4Tgg84dpEun6yj-EPr7WqtsWWJckMHB_xbnTjUlwhQFp1JMw`) | **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `type` | string | Request message type | | `metadata` | object | Metadata | Example: ```json {"type":"SUBSCRIBE","metadata":{"subscriptions":[{"channelType":"PRICE_FEED_UPDATES","body":{"assets":[{"sellingAsset":"btc","buyingAsset":"usd"},{"sellingAsset":"eth","buyingAsset":"pyth"},{"sellingAsset":"sol","buyingAsset":"gbp"}]}}]}} ``` **Responses** - **200**: Response examples | Field | Type | Description | |-------|------|-------------| | `type` | string | Message type | | `metadata` | object | Response | Example (Subscription Response): ```json {"type":"SUBSCRIPTIONS","metadata":{"subscriptions":[{"channelType":"ACCOUNT_ACTIVITY"},{"channelType":"ORDERS"},{"channelType":"PRICE_FEED_UPDATES","body":{"assets":[{"sellingAsset":"btc","buyingAsset":"usd"},{"sellingAsset":"eth","buyingAsset":"pyth"},{"sellingAsset":"sol","buyingAsset":"gbp"}]}}]}} ``` **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/websocket" \ -H "Content-Type: application/json" \ -d '{"type":"SUBSCRIBE","metadata":{"subscriptions":[{"channelType":"PRICE_FEED_UPDATES","body":{"assets":[{"sellingAsset":"btc","buyingAsset":"usd"},{"sellingAsset":"eth","buyingAsset":"pyth"},{"sellingAsset":"sol","buyingAsset":"gbp"}]}}]}}' ``` --- ## Webhooks ### Webhooks ## Get All Webhooks `GET /v3/webhooks` Returns all webhook subscriptions for the authenticated user. Each subscription includes a subscriptionId, the event types it listens for, and the target server configuration. **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `webhooks` | WebhookGetResponse[] | List of active webhook subscriptions for the authenticated user. (e.g. `[{subscriptionId=9d701848-a6c2-4b4a-baac-9704f144bd02, eventTypes=[ACCOUNT_ACTIVITY], target={url=https://api.example.com/webhooks, headers={Authorization=Bearer , Content-Type=application/json}}}]`) | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid nonce): ```json {"code":"INVALID_NONCE","description":"Invalid nonce"} ``` **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v3/webhooks" \ -H "Authorization: Bearer " ``` --- ## Create Webhook `POST /v3/webhooks` Create a new webhook subscription. You may create at most 5 webhooks per user. The response includes a subscriptionId that you can use to retrieve or delete the webhook. Currently the only supported event type is ACCOUNT_ACTIVITY, which fires on deposits and withdrawals. **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `eventTypes` | ChannelType[] | Types of events you want webhooks for | | `target` | object | The destination server where webhook events will be delivered. (e.g. `{"url":"https://api.example.com/webhooks","headers":{"Authorization":"Bearer ","Content-Type":"application/json"}}`) | **Responses** - **201**: Accepted | Field | Type | Description | |-------|------|-------------| | `subscriptionId` | string | Unique identifier for this webhook subscription. Use this to retrieve details or delete the webhook. (e.g. `9d701848-a6c2-4b4a-baac-9704f144bd02`) | | `eventTypes` | ChannelType[] | The event types this webhook is subscribed to. Currently the only supported type is ACCOUNT_ACTIVITY, which fires on deposits and withdrawals. | | `target` | object | The destination server where webhook events will be delivered. (e.g. `{"url":"https://api.example.com/webhooks","headers":{"Authorization":"Bearer ","Content-Type":"application/json"}}`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid nonce): ```json {"code":"INVALID_NONCE","description":"Invalid nonce"} ``` **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v3/webhooks" \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"eventTypes": "", "target": "{"url":"https://api.example.com/webhooks","headers":{"Authorization":"Bearer ","Content-Type":"application/json"}}"}' ``` --- ## Get Webhook Details `GET /v3/webhooks/{subscriptionId}` Retrieve a specific webhook subscription by its subscriptionId. The subscriptionId is returned when you create a webhook via the Create Webhook endpoint. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `subscriptionId` | path | Yes | string | The unique identifier of the webhook subscription, returned when the webhook was created. (e.g. `9d701848-a6c2-4b4a-baac-9704f144bd02`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `subscriptionId` | string | Unique identifier for this webhook subscription. Use this to retrieve details or delete the webhook. (e.g. `9d701848-a6c2-4b4a-baac-9704f144bd02`) | | `eventTypes` | ChannelType[] | The event types this webhook is subscribed to. Currently the only supported type is ACCOUNT_ACTIVITY, which fires on deposits and withdrawals. | | `target` | object | The destination server where webhook events will be delivered. (e.g. `{"url":"https://api.example.com/webhooks","headers":{"Authorization":"Bearer ","Content-Type":"application/json"}}`) | - **404**: Not found | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Not Found): ```json {"code":"NOT_FOUND","description":"Not Found"} ``` - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid nonce): ```json {"code":"INVALID_NONCE","description":"Invalid nonce"} ``` **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v3/webhooks/{subscriptionId}" \ -H "Authorization: Bearer " ``` --- ## Delete Webhook `DELETE /v3/webhooks/{subscriptionId}` Delete a webhook subscription by its subscriptionId. Once deleted, events will no longer be delivered to the target URL. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `subscriptionId` | path | Yes | string | The unique identifier of the webhook subscription to delete. (e.g. `9d701848-a6c2-4b4a-baac-9704f144bd02`) | **Responses** - **204**: Ok - **404**: Not found | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Not Found): ```json {"code":"NOT_FOUND","description":"Not Found"} ``` - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | Example (Invalid nonce): ```json {"code":"INVALID_NONCE","description":"Invalid nonce"} ``` **Example** ```bash curl -X DELETE "https://api.demo.omniaexchange.com/api/v3/webhooks/{subscriptionId}" \ -H "Authorization: Bearer " ``` --- ## Sub Account ### Sub Account Information ## Get Account Settings `GET /v2/accounts/{accountId}/account-settings/{source}` Get the account settings for the sub account **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | | `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 | **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 | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/account-settings/{source}" ``` --- ## Get Account Snapshot `GET /v2/accounts/{accountId}/account-snapshot/{source}` Get snapshot of the sub account showing balances, valuations in account asset, the available to withdraw in each asset and then credit usages. The available to withdraw is the amount of an asset that can be withdrawn whilst leaving enough balance in the account to satisfy any credit usage. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | | `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 | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/account-snapshot/{source}" ``` --- ## Get Balance `GET /v3/accounts/{accountId}/balance/{source}` Get the balances for the sub account **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | | `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 | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v3/accounts/{accountId}/balance/{source}" ``` --- ## Get Commission Rate `GET /v2/accounts/{accountId}/commission-rate/{source}` Get the commission rate for the specified asset pair on the sub account **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | | `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/accounts/{accountId}/commission-rate/{source}" ``` --- ## Get Credit Usage `GET /v2/accounts/{accountId}/credit/{source}` Get credit usage for the sub account **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | | `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 | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/credit/{source}" ``` --- ## Get Order History `GET /v3/accounts/{accountId}/order-history` Returns sub account order history in chronological order (oldest first). **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | | `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 | **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 | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v3/accounts/{accountId}/order-history" ``` --- ### Sub Account Trading ## Action Quote `POST /v2/accounts/{accountId}/action-quote` Action a previously received quote. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id that you supplied when requesting the specific quote that you wish to action. (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | **Responses** - **204**: Ok - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/action-quote" \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c"}' ``` --- ## Order Status `GET /v2/accounts/{accountId}/order/{source}/{instructionId}` Check the status of an order made by the sub account **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | | `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your order status on (e.g. `OFFCHAIN`) | | `instructionId` | path | Yes | string | Instruction Id - If order placed via api this is the client specified id. If placed on chain this is the transaction id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `orderSource` | string | Order Source | | `sellingAsset` | string | Selling Asset (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `buyingAsset` | string | Buying Asset (e.g. `0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE`) | | `amountToSell` | string | Amount To Sell (e.g. `5.67`) | | `limitAmountToReceive` | string | Limit Amount To Receive (e.g. `10433.1`) | | `status` | string | Status (e.g. `COMPLETED`) | | `rejectionReason` | string | Rejection reason | | `amountReceived` | string | Amount Received (e.g. `12932.1`) | | `feePaid` | string | Fee Paid (e.g. `0.042`) | | `transactionId` | string | Transaction Id (e.g. `0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/order/{source}/{instructionId}" ``` --- ## Submit Order `POST /v2/accounts/{accountId}/orders` Swap assets using a market or limit order. Specify how much of a given asset you want to sell. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id for the order. This can be any string less than 64 in length and needs to be unique per order (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `sellingAsset` | string | Asset you wish to sell (e.g. `USD`) | | `buyingAsset` | string | Asset you wish to buy (e.g. `EUR`) | | `amountToSell` | string | Amount to sell of the selling asset (e.g. `5.67`) | | `limitAmountToReceive` | string | The minimum amount of the buying asset you want to receive (e.g. `5.5`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `sellingAsset` | string | Selling Asset (e.g. `btc`) | | `buyingAsset` | string | Buying Asset (e.g. `usd`) | | `amountToSell` | string | Amount To Sell (e.g. `5.1`) | | `limitAmountToReceive` | string | Limit Amount To Receive (e.g. `10433.1`) | | `status` | string | Status (e.g. `COMPLETED`) | | `rejectionReason` | string | Rejection reason | | `amountReceived` | string | Amount Received (e.g. `12932.1`) | | `feePaid` | string | Fee Paid (e.g. `0.042`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/orders" \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c", "sellingAsset": "USD", "buyingAsset": "EUR", "amountToSell": "5.67", "limitAmountToReceive": "5.5"}' ``` --- ## Get Order Status `GET /v3/accounts/{accountId}/order-status/{source}/{orderId}` Returns the status of a given order id for a given source (chain). **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | | `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your order status (e.g. `ETHEREUM`) | | `orderId` | path | Yes | integer | OrderId of the on chain order (e.g. `42`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - If order placed via api this is the client specified id. If placed on chain this is the transaction id (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `returnTxId` | string | Return Transaction Id - If OFFCHAIN order this is null. If on chain this is the transaction id of the return transaction (Settle/Cancel) (e.g. `0x99687859ddbe6050ca9615b7a5ae7b202f856ff289255758216b16887cd072f6`) | | `orderSource` | string | Source (e.g. `OFFCHAIN`) | | `sellingAsset` | string | Selling Asset (e.g. `btc`) | | `buyingAsset` | string | Buying Asset (e.g. `usd`) | | `quantitySold` | string | Amount Sold (e.g. `5.67`) | | `quantityBought` | string | Amount Received (e.g. `12932.1`) | | `limitAmount` | string | Limit Amount To Specified (e.g. `12932.1`) | | `status` | string | Status (e.g. `SETTLED`) | | `timestampMillis` | string | Timestamp (e.g. `1653480000000`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v3/accounts/{accountId}/order-status/{source}/{orderId}" ``` --- ## Request Quote `POST /v2/accounts/{accountId}/request-quote` Request a firm quote to swap some assets. Specify how much of an asset you want to receive. **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id for the quote. This can be any string less than 64 in length and needs to be unique. (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `sellingAsset` | string | Selling Asset (e.g. `USD`) | | `buyingAsset` | string | Buying Asset (e.g. `EUR`) | | `amountToBuy` | string | Amount of buying asset you want (e.g. `5.67`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - the id you specified on the request (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `sellingAsset` | string | Selling Asset (e.g. `USD`) | | `buyingAsset` | string | Buying Asset (e.g. `EUR`) | | `amountToBuy` | string | Amount To Buy (e.g. `5.67`) | | `amountToSell` | string | Amount To Sell (e.g. `12932.1`) | | `expiryTimestampMillis` | string | Time the quote expires - Epoch milliseconds (e.g. `1653480000000`) | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | - **401**: Unauthorized | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/request-quote" \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c", "sellingAsset": "USD", "buyingAsset": "EUR", "amountToBuy": "5.67"}' ``` --- ### Sub Account Operations Endpoints to perform actions on a sub‑account you control. ## Withdrawal Status `GET /v2/accounts/{accountId}/offchain-withdrawals/{instructionId}` Check the status of a withdrawal request made on a sub account **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | | `instructionId` | path | Yes | string | Instruction Id - This is the client specified id when requesting (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - This is the client specified id when requesting (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `withdrawalLocation` | string | Withdrawal location specified in your request. (e.g. `ETHEREUM`) | | `withdrawalLocationReference` | string | The withdrawal location reference specified in your request. (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `bankReference` | string | The bank reference specified in your request. (e.g. `withdrawal-reference-1`) | | `asset` | string | asset (e.g. `usd`) | | `amount` | string | amount (e.g. `5.67`) | | `status` | string | status | | `rejectionReason` | string | rejectionReason | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/offchain-withdrawals/{instructionId}" ``` --- ## Withdrawal Request `POST /v2/accounts/{accountId}/offchain-withdrawals` Create a withdrawal request for the sub account **Parameters** | Name | In | Required | Type | Description | |------|-----|----------|------|-------------| | `accountId` | path | Yes | string | The account you want to call to be actioned for | **Request Body** _(required)_ | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | This is your client reference id for the request. This can be any string less than 64 in length and needs to be unique per request (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `withdrawalLocation` | string | Withdrawal location (e.g. `ETHEREUM`) | | `withdrawalLocationReference` | string | Withdrawal location reference. If withdrawal location is a blockchain - specify your wallet you want to withdraw to, this must have been already whitelisted. If withdrawal location is FIAT please specify the bank name, this must have been already whitelisted. (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `bankReference` | string | Bank reference. If specified, this is the bank reference associated with the withdrawal. This can be any string up to 35 characters in length. (e.g. `withdrawal-reference-1`) | | `asset` | string | Asset to withdraw (e.g. `usd`) | | `amount` | string | Amount to withdraw. Maximum of 5 decimal places. (e.g. `5.67`) | **Responses** - **200**: Ok | Field | Type | Description | |-------|------|-------------| | `instructionId` | string | Instruction Id - This is the client specified id when requesting (e.g. `375b23de-febf-4a6e-a517-e7b5dfa9357c`) | | `withdrawalLocation` | string | Withdrawal location specified in your request. (e.g. `ETHEREUM`) | | `withdrawalLocationReference` | string | The withdrawal location reference specified in your request. (e.g. `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`) | | `bankReference` | string | The bank reference specified in your request. (e.g. `withdrawal-reference-1`) | | `asset` | string | asset (e.g. `usd`) | | `amount` | string | amount (e.g. `5.67`) | | `status` | string | status | | `rejectionReason` | string | rejectionReason | - **400**: Bad request | Field | Type | Description | |-------|------|-------------| | `code` | string | Error code | | `description` | string | Error description | **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/offchain-withdrawals" \ -H "Content-Type: application/json" \ -d '{"instructionId": "375b23de-febf-4a6e-a517-e7b5dfa9357c", "withdrawalLocation": "ETHEREUM", "withdrawalLocationReference": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "bankReference": "withdrawal-reference-1", "asset": "usd", "amount": "5.67"}' ``` --- ## MCP ### MCP Server Omnia Exchange provides an MCP (Model Context Protocol) server for AI and LLM agent integration. The server implements the [Model Context Protocol](https://modelcontextprotocol.io/) over Streamable HTTP, enabling agents to discover and invoke exchange tools programmatically. ### Endpoint - **Demo/UAT** - `https://api.demo.omniaexchange.com/api/mcp` - **Production** - `https://api.production.omniaexchange.com/api/mcp` `POST` — Send JSON-RPC requests (initialize, tools/list, tools/call, ping) `DELETE` — Terminate a session ### Protocol Version The server implements MCP protocol version `2025-11-25`. ### Transport The server uses Streamable HTTP transport. SSE streaming is not supported — `GET /api/mcp` returns `405`. ### Authentication The server implements [OAuth 2.0 Client Credentials](https://datatracker.ietf.org/doc/html/rfc6749#section-4.4) for authentication, following the MCP authorization specification. **Discovery endpoints:** - `GET /.well-known/oauth-protected-resource` — returns the resource metadata (scopes, authorization servers) - `GET /.well-known/oauth-authorization-server` — returns the authorization server metadata (token endpoint, supported grants) **Obtaining a token:** `POST /oauth/token` with form parameters: - `grant_type` = `client_credentials` - `client_id` = your API key ID - `client_secret` = your API key secret The response includes an `access_token`, `token_type`, `expires_in`, and granted `scope`. **Usage:** Include the token as `Authorization: Bearer ` on `tools/call` requests. Session management methods (`initialize`, `tools/list`, `ping`) do not require authentication. ### Session Lifecycle Clients must initialize a session before calling tools. The server returns a session ID in the `MCP-Session-Id` response header on successful initialization. This session ID must be included as a request header on all subsequent requests. Sessions expire after a period of inactivity — clients should re-initialize if they receive an "Invalid or missing session" error. ### Tool Discovery Available tools are discoverable via the `tools/list` method. Each tool definition includes a name, description, and input schema. Tools currently span market data, account data, and order history categories. ### Important Notes - SSE streaming (`GET /api/mcp`) is not supported. All communication uses request/response over `POST`. - Authentication (Bearer token) is only required for `tools/call`. Other methods (`initialize`, `tools/list`, `ping`) work without a token. ## MCP JSON-RPC `POST /mcp` Send JSON-RPC requests to the MCP server (initialize, tools/list, tools/call, ping). See the MCP Server section description for full protocol details including authentication, session lifecycle, and tool discovery. **Responses** - **200**: JSON-RPC response **Example** ```bash curl -X POST "https://api.demo.omniaexchange.com/api/mcp" ``` --- ## Terminate MCP Session `DELETE /mcp` Terminate an active MCP session. The session ID must be included in the `MCP-Session-Id` request header. **Responses** - **200**: Session terminated **Example** ```bash curl -X DELETE "https://api.demo.omniaexchange.com/api/mcp" ``` ---