Wayex API
Wayex is an Australian exchange offering 80+ tokens to trade or spend with. Wayex also offers instant AUD bank deposits & withdrawals. This document provides you with a reference to our API and how you can consume it to trade with Wayex.
API Endpoints
WebSocket URL: wss://cexapi.wayex.com/WSGateway
HTTP URL: https://cexapi.wayex.com/ap
All WebSocket calls use the /WSGateway endpoint. All HTTP calls use the /ap base path.
Websocket Message Frame
A JSON-formatted frame object.
{
"m": 0,
"i": 0,
"n": "function name",
"o": "payload"
}
Wrap all calls in a JSON-formatted frame object. Responses from the server are similarly wrapped. The API calls are documented as payloads by function name.
| Key | Value |
|---|---|
| m message type | integer. The type of the message. One of: 0 request 1 reply 2 subscribe-to event 3 event 4 unsubscribe-from event 5 error |
| i sequence number | long integer. The sequence number identifies an individual request or request-and-response pair, to your application. The system requires a non-zero sequence number, but the numbering scheme you use is up to you. No arbitrary sequence numbering scheme is enforced. Best Practices: A client-generated API call (of message types 0, 2, and 4) should: Carry an even sequence number Begin at the start of each user session Be unique within each user session. Begin with 2 (as in 2, 4, 6, 8) Message types 1 (reply), 3 (event), and 5 (error) are generated by the server. These messages echo the sequence number of the message to which they respond. See the example, following. |
| n function name | string. The function name is the name of the function being called or that the server is responding to. The server echoes your call. See the example, following. |
| o payload | Payload is a JSON-formatted string containing the data being sent with the message. Payload may consist of request parameters (key-value pairs) or response parameters. |
Example 1
Example 1
var frame = {
m: 0,
i: 0,
n: "function name",
o: "",
};
var requestPayload = {
parameter1: "value",
parameter2: 0,
};
frame.o = json.Stringify(requestPayload);
// Stringify escapes the payload's quotation marks automatically.
WS.Send(json.Stringtify(frame)); // WS.Send escapes the frame
When sending a request in the frame to the software using JavaScript, a call looks like Example 1.
Example 2
Example 2
var frame = json.Parse(wsMessage);
if (frame.m == 1) {
// message of type reply
//This is a reply
if (frame.n == "WebAuthenticateUser") {
var LoginReply = json.Parse(frame.o);
if (loginReply.Authenticated) {
var user = LoginReplay.User;
}
}
}
When receiving a frame from the software, use the frame to determine the context, and then unwrap the content, as in Example 2.
Standard response objects and common error codes
A response to an API call usually consists of a specific response, but both successful and unsuccessful responses may consist of a generic response object that verifies only that the call was received, and not that the action requested by the call took place. A generic response to an unsuccessful call provides an error code. A generic response looks like Example 3.
Example 3
Example 3
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
| Key | Value |
|---|---|
| result | boolean. If the call has been successfully received by the OMS, result is true; otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null. The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. The content of this key is usually null. |
Accounts
An account will be generated via Wayex administration team and they will provide you with the API Key with which you can authenticate using HTTP or Websocket.
Products
In Wayex, a product is an asset that is tradable or paid out. A product might be a national currency or a crypto-currency. For example, a product might be AUD or Bitcoin. Transaction and withdrawal fees are denominated in products. (Products may be referred to as assets in some API calls.)
GetProducts
Permissions: Public
Call Type: Synchronous
Retrieves an array of products available on the trading venue. A product is an asset that is tradable or paid out.
Request
POST /GetProducts HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 15
{
"OMSId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the products are available. required. |
Response
[
{
"OMSId": 1,
"ProductId": 2,
"Product": "BTC",
"ProductFullName": "Bitcoin",
"MasterDataUniqueProductSymbol": "",
"ProductType": "CryptoCurrency",
"DecimalPlaces": 8,
"TickSize": 0.00000001,
"DepositEnabled": true,
"WithdrawEnabled": true,
"NoFees": false,
"IsDisabled": false,
"MarginEnabled": false
},
{
"OMSId": 1,
"ProductId": 3,
"Product": "AUD",
"ProductFullName": "Australian Dollar",
"MasterDataUniqueProductSymbol": "",
"ProductType": "NationalCurrency",
"DecimalPlaces": 4,
"TickSize": 0.0001,
"DepositEnabled": true,
"WithdrawEnabled": true,
"NoFees": false,
"IsDisabled": false,
"MarginEnabled": false
}
]
Returns an array of products available on the trading venue.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System on which the product is traded. |
| ProductId | integer. The ID of the product. |
| Product | string. The symbol or short name of the product. For example, BTC for Bitcoin. |
| ProductFullName | string. The full name of the product. For example, Bitcoin. |
| MasterDataUniqueProductSymbol | string. Unique product symbol from master data. Usually empty. |
| ProductType | string. The type of product. One of: NationalCurrency CryptoCurrency Contract |
| DecimalPlaces | integer. The number of decimal places in which the product is denominated. |
| TickSize | decimal. The smallest increment in which the product can be traded. |
| DepositEnabled | boolean. If true, deposits are enabled for this product. |
| WithdrawEnabled | boolean. If true, withdrawals are enabled for this product. |
| NoFees | boolean. If true, no fees are charged for trading this product. |
| IsDisabled | boolean. If true, the product is disabled and cannot be traded. |
| MarginEnabled | boolean. If true, margin trading is enabled for this product. |
GetProduct
Permissions: Public
Call Type: Synchronous
Retrieves the details of a specific product.
Request
POST /GetProduct HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 35
{
"OMSId": 1,
"ProductId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System. required. |
| ProductId | integer. The ID of the product. required. |
Response
{
"OMSId": 1,
"ProductId": 2,
"Product": "BTC",
"ProductFullName": "Bitcoin",
"MasterDataUniqueProductSymbol": "",
"ProductType": "CryptoCurrency",
"DecimalPlaces": 8,
"TickSize": 0.00000001,
"DepositEnabled": true,
"WithdrawEnabled": true,
"NoFees": false,
"IsDisabled": false,
"MarginEnabled": false
}
Returns a single product object.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System. |
| ProductId | integer. The ID of the product. |
| Product | string. The symbol or short name of the product. |
| ProductFullName | string. The full name of the product. |
| MasterDataUniqueProductSymbol | string. Unique product symbol from master data. Usually empty. |
| ProductType | string. The type of product. One of: NationalCurrency CryptoCurrency Contract |
| DecimalPlaces | integer. The number of decimal places in which the product is denominated. |
| TickSize | decimal. The smallest increment in which the product can be traded. |
| DepositEnabled | boolean. If true, deposits are enabled for this product. |
| WithdrawEnabled | boolean. If true, withdrawals are enabled for this product. |
| NoFees | boolean. If true, no fees are charged for trading this product. |
| IsDisabled | boolean. If true, the product is disabled and cannot be traded. |
| MarginEnabled | boolean. If true, margin trading is enabled for this product. |
Time and Date-Stamp Formats
Wayex uses two different time and date-stamp formats, POSIX and Microsoft Ticks. Where the value of a time field key is an integer or long, the value is in POSIX format; when the value of a time field key is a string, it is in Microsoft Ticks format (also called datetime).
- POSIX stores date/time values as the number of seconds since 1 January 1970 (long integer). Wayex often multiples this number by 1000 for the number of milliseconds since 1 January 1970. Recognize POSIX format: POSIX format is a long integer. It is usually formatted like this:
1501603632000 - Microsoft Ticks (datetime) format represents the number of ticks that have elapsed since 00:00:00 UTC, 1 January 0001, in the Gregorian calendar. A single tick represents one hundred nanoseconds (one ten-millionth of a second). There are 10,000 ticks in a millisecond; ten million ticks in a second. Ticks format does not include the number of ticks attributable to leap-seconds. Recognize Ticks format: Ticks format is a string. In Wayex, it is usually formatted like this:
"2018-08-17T17:57:56Z"Note that a T (for time) separates the initial date from the time. The trailing Z represents the time zone, in all cases in Wayex, this is UTC (also called Zulu time).
Account
GetAccountTransactions
Permissions: Trading, AccountReadOnly
Call Type: Synchronous
Gets a list of transactions for an account.
Results can be filtered using different search parameters such as TransactionType and ProductId, other optional fields that can serve as search parameter are defined in the request key value table below.
Request
POST /GetAccountTransactions HTTP/1.1
Host: cexapi.wayex.com
aptoken: 15a9b337-94c4-4e11-a051-287725519a45
Content-Type: application/json
Content-Length: 91
{
"OMSId": 1,
"AccountId": 7,
"TransactionReferenceTypes": ["Deposit", "Withdraw"],
"ProductId": 3
}
| Key | Value |
|---|---|
| OMSId | integer. Always 1. |
| AccountId | integer. Your account ID provided by Wayex administration |
| Depth | integer. The number of transactions that will be returned, starting with the most recent transaction. If not defined, all transactions of the account will be returned(assuming not other search parameters are defined). optional. |
| ProductId | integer. Can be used to filter results, if set, only transactions for the specific product id specified will be returned, else, all transactions regardless of the product will be returned(assuming not other search parameters are defined). optional. |
| TransactionId | integer. Can be used to filter results, if set, only transaction with the specific id specified will be returned, else, all transactions regardless of the transaction id will be returned(assuming not other search parameters are defined). optional. |
| ReferenceId | integer. Can be used to filter results, if set, only transaction with the specific id specified will be returned, else, all transactions regardless of the reference id will be returned(assuming not other search parameters are defined). optional. |
| TransactionTypes | array of string or integer type. Can be used to filter results according to transaction type/s(can filter with either just 1 or more). If not set, transactions with any transaction type will be returned. optional. |
| TransactionReferenceTypes | array of string or integer type. Can be used to filter results according to transaction reference type/s(can filter with either just 1 or more). If not set, transactions with any transaction reference type will be returned. optional. |
| StartTimestamp | long integer. Can be used to filter results based on timestamp the transaction has happened. This filter will return transactions that happened on or after(earliest possible time) the specified timestamp value, if not set, transactions that happened any time will be returned. optional. |
| EndTimeStamp | long integer. Can be used to filter results based on timestamp the transaction has happened. This filter will return transactions that happened on or before(latest possible time) the specified timestamp value, if not set, transactions that happened any time will be returned. optional. |
TransactionTypes Enums
1 Fee
2 Trade
3 Other
TransactionReferenceTypes Enums
1 Trade
2 Deposit
3 Withdraw
4 Transfer
10 ManualEntry
Response
[
{
"TransactionId": 24214,
"ReferenceId": 294,
"OMSId": 1,
"AccountId": 7,
"CR": 0.01247667,
"DR": 0.0,
"Counterparty": 3,
"TransactionType": "Other",
"ReferenceType": "Deposit",
"ProductId": 3,
"Balance": 1.138154399436,
"TimeStamp": 1678904016338
},
{
"TransactionId": 24021,
"ReferenceId": 293,
"OMSId": 1,
"AccountId": 7,
"CR": 0.01247667,
"DR": 0.0,
"Counterparty": 3,
"TransactionType": "Other",
"ReferenceType": "Deposit",
"ProductId": 3,
"Balance": 1.125677729436,
"TimeStamp": 1678706804112
},
{
"TransactionId": 23403,
"ReferenceId": 292,
"OMSId": 1,
"AccountId": 7,
"CR": 0.01311447,
"DR": 0.0,
"Counterparty": 3,
"TransactionType": "Other",
"ReferenceType": "Deposit",
"ProductId": 3,
"Balance": 1.122515996076,
"TimeStamp": 1677575188002
},
{
"TransactionId": 22693,
"ReferenceId": 286,
"OMSId": 1,
"AccountId": 7,
"CR": 0.0,
"DR": 0.00001,
"Counterparty": 3,
"TransactionType": "Other",
"ReferenceType": "Withdraw",
"ProductId": 3,
"Balance": 1.11033172,
"TimeStamp": 1676348233473
}
]
Returns an array of objects as a response, each object represents a transaction.
| Key | Value |
|---|---|
| TransactionId | Integer. The ID of the transaction. |
| OMSId | Integer. The ID of the OMS under which the requested transactions took place. |
| AccountId | Integer. The single account under which the transactions took place. |
| CR | decimal. Credit entry for the account on the order book. Funds entering an account. |
| DR | decimal. Debit entry for the account on the order book. Funds leaving an account. |
| Counterparty | long integer. The corresponding party in a trade. |
| TransactionType | string. The type of transaction: 1 Fee 2 Trade 3 Other |
| ReferenceId | long integer. The ID of the action or event that triggered this transaction. |
| ReferenceType | integer. The type of action or event that triggered this transaction. One of: 1 Trade 2 Deposit 3 Withdraw 4 Transfer 10 ManualEntry |
| ProductId | integer. The ID of the product on this account’s side of the transaction. For example, in a dollars-for-Bitcoin transaction, one side will have the product Dollar and the other side will have the product Bitcoin. Use GetProduct to return information about a product based on its ID. |
| Balance | decimal. The balance in the account after the transaction. |
| TimeStamp | long integer. Time at which the transaction took place, in POSIX format. |
GetAccountPositions
Permissions: Operator,Trading,AccountReadOnly,Manual Trader
Call Type: Synchronous
Retrieves a list of Positions(Balances) on a specific account.
Request
POST /GetAccountPositions HTTP/1.1
Host: cexapi.wayex.com
aptoken: b59915f0-06c5-4d41-8fbf-fd157af7ea30
Content-Type: application/json
Content-Length: 41
{
"OMSId": 1,
"AccountId": 1,
"IncludePending": true
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| AccountId | integer. The ID of the account on the OMS for which positions will be returned for. required. |
| IncludePending | boolean. If true, pending deposit and withdraw amounts will be included in the response, else they will not be included. Defaults to false if not defined. optional. |
Response
[
{
"OMSId": 1,
"AccountId": 1,
"ProductSymbol": "AUD",
"ProductId": 1,
"Amount": 100.95,
"Hold": 0,
"PendingDeposits": 0,
"PendingWithdraws": 0,
"TotalDayDeposits": 0,
"TotalMonthDeposits": 0,
"TotalYearDeposits": 0,
"TotalDayDepositNotional": 0,
"TotalMonthDepositNotional": 0,
"TotalYearDepositNotional": 0,
"TotalDayWithdraws": 0,
"TotalMonthWithdraws": 0,
"TotalYearWithdraws": 0,
"TotalDayWithdrawNotional": 0,
"TotalMonthWithdrawNotional": 0,
"TotalYearWithdrawNotional": 0,
"NotionalProductId": 1,
"NotionalProductSymbol": "AUD",
"NotionalValue": 100.95,
"NotionalHoldAmount": 0,
"NotionalRate": 1,
"TotalDayTransferNotional": 0
},
{
"OMSId": 1,
"AccountId": 1,
"ProductSymbol": "BTC",
"ProductId": 2,
"Amount": 0,
"Hold": 0,
"PendingDeposits": 0,
"PendingWithdraws": 0,
"TotalDayDeposits": 0,
"TotalMonthDeposits": 0,
"TotalYearDeposits": 0,
"TotalDayDepositNotional": 0,
"TotalMonthDepositNotional": 0,
"TotalYearDepositNotional": 0,
"TotalDayWithdraws": 0,
"TotalMonthWithdraws": 0,
"TotalYearWithdraws": 0,
"TotalDayWithdrawNotional": 0,
"TotalMonthWithdrawNotional": 0,
"TotalYearWithdrawNotional": 0,
"NotionalProductId": 1,
"NotionalProductSymbol": "AUD",
"NotionalValue": 0,
"NotionalHoldAmount": 0,
"NotionalRate": 30005,
"TotalDayTransferNotional": 0
}
]
Returns an array of objects as a response.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS to which the account is assigned. |
| AccountId | integer. The ID of the account whose positions/balances were retrieved. |
| ProductSymbol | string. The symbol of a specific product. |
| ProductId | integer. The ID of a specific product. |
| Amount | decimal. The current actual balance of the account for a specific product. |
| Hold | decimal. The current actual hold amount against the current balance of the account for a specific product. A hold amount is part of the total balance or the Amount field value but is not available to be used for other transactions. A trade on working status of 100 units at $1 each will produce a $100 hold. |
| PendingDeposits | decimal. Deposit amount for a specific product that is not yet credited to the account. |
| PendingWithdraws | decimal. Withdraw amount for a specific product that is not yet debited from the account |
| TotalDayDeposits | decimal. Total amount deposited by the account for a specific product in the current day; UTC Midnight and UTC Midnight. |
| TotalMonthDeposits | decimal. Total amount deposited by the account for a specific product in the current month. |
| TotalYearDeposits | decimal. Total amount deposited by the account for a specific product in the current year. |
| TotalDayDepositNotional | decimal. Total amount in notional value deposited by the account for a specific product in the current day. |
| TotalMonthDepositNotional | decimal. Total amount in notional value deposited by the account for a specific product in the current month. |
| TotalYearDepositNotional | decimal. Total amount in notional value deposited by the account for a specific product in the current year. |
| TotalDayWithdraws | decimal. Total amount withdrawn by the account for a specific product in the current day; UTC Midnight and UTC Midnight. |
| TotalMonthWithdraws | decimal. Total amount withdrawn by the account for a specific product in the current month. |
| TotalYearWithdraws | decimal. Total amount withdrawn by the account for a specific product in the current year. |
| TotalDayWithdrawNotional | decimal. Total amount in notional value withdrawn by the account for a specific product in the current day. |
| TotalMonthWithdrawNotional | decimal. Total amount in notional value withdrawn by the account for a specific product in the current month. |
| TotalYearWithdrawNotional | decimal. Total amount in notional value withdrawn by the account for a specific product in the current year. |
| NotionalProductId | integer. The ID of the product set as the BaseNotionalProduct on the OMS. |
| NotionalProductSymbol | string. The symbol of the product set as the BaseNotionalProduct on the OMS. |
| NotionalValue | decimal. The current actual balance in notional value of the account for a specific product. |
| NotionalHoldAmount | decimal. The current actual hold amount in notional value against the current balance of the account for a specific product. |
| NotionalRate | decimal. The current rate of a specific product against the notional product. |
| TotalDayTransferNotional | decimal. Total amount in notional value transfered by the account for a specific product in the current day. |
Authentication
AuthenticateUser
Permissions: Public
CallType: Synchronous
Authenticates a user.
Request
GET /AuthenticateUser HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Authorization: Base64 encoded username:password
GET /AuthenticateUser HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
APIKey: "28c68ac3fcfafc3d4e8d653fe57e5baf",
Signature: "29c15c42e4fabcc9e229421e148e647903927c503ab4578ada55bb13a63a9636",
UserId: "96",
Nonce: "2247733562"
| Key | Value |
|---|---|
| APIKey | string. This is a Wayex generated key used in user-identification. |
| Signature | string. A long, alphanumeric string generated by Wayex by using the APIKey and Nonce. To generate your own signature with a different nonce, HMAC-Sha256 encode your nonce, user ID, and API key, in the format NonceUserIdAPIKey using the secret as your key. |
| UserId | string. The ID of the user, stated as a string. |
| Nonce | string. Any arbitrary number or random string used with the APIKey to generate a signature. |
Response
{
"Authenticated": true,
"SessionToken": "02de4e6d-507d-4e89-8a2c-49a9935d5607",
"User": {
"UserId": 81,
"UserName": "example1",
"Email": "user@example.com",
"EmailVerified": true,
"AccountId": 90,
"OMSId": 1,
"Use2FA": true
},
"Locked": false,
"Requires2FA": false,
"EnforceEnable2FA": false,
"TwoFAType": null,
"TwoFAToken": null,
"errormsg": null
}
| Key | Value |
|---|---|
| Authenticated | boolean. True if the user is authenticated; false otherwise. |
| User | JSON user object (below) |
| Locked | boolean. True if the user is currently locked; false otherwise. A user may be locked by trying to log in too many times in rapid succession. He must be unlocked by an admin. |
| Requires2FA | boolean. True if the user must use two-factor authentication; false otherwise. |
| TwoFAType | string. The type of 2FA this user requires. For example, Google. |
| TwoFAToken | string. Defaults to null. |
| errormsg | string. A successful receipt of the call returns null. |
JSON user object:
| Key | Value |
|---|---|
| UserId | integer. The ID of the user being authenticated on the exchange. |
| UserName | string. The name of the user. |
| string. The email address of the user. | |
| EmailVerified | boolean. Whether the email address has been verified by the registration process or directly by an Admin. |
| AccountId | integer. The ID of the account with which the user is associated (each user has a default account). |
| OMSId | integer. The ID of the OMS with which the user and account are associated. |
| Use2FA | boolean. True if the user must use 2FA to log in; false otherwise. |
LogOut
Permissions: Public
Call Type: Synchronous
Logs a user out
Request
POST /Logout HTTP/1.1
Host: cexapi.wayex.com
aptoken: 282663b4-1e87-4130-8953-9dc584ae24ee
Content-Type: application/json
No request payload is required for websockets.
For HTTP, the existing session token must be included in the request Headers as aptoken.
Response
{
"result": "true",
"errormsg": "",
"errorcode": 0,
"detail": ""
}
| Key | Value |
|---|---|
| result | boolean. A successful logout request returns true; and unsuccessful (an error condition) returns false. |
| errormsg | string. A successful logout request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful request returns 0. An unsuccessful request returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
Deposit
GetNewDepositAddress
Permissions: Operator,Deposit
Call Type: Synchronous
Creates a new deposit address and retrieves all the other existing deposit addresses of the specified AccountId for the specified ProductId.
Request
POST /GetNewDepositAddress HTTP/1.1
Host: cexapi.wayex.com
aptoken: 2c3a0675-1136-45c0-84a9-a9f40d07a290
Content-Type: application/json
Content-Length: 62
{
"OMSId": 1,
"AccountId": 7,
"ProductId": 3
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS where the account belongs to. required. |
| AccountId | integer. The ID of the account you wish to create a new deposit address for. required. |
| ProductId | integer. The ID of the product for which the deposit address of the account specified will be created. required. |
Response
{
"AssetManagerId": 1,
"AccountId": 7,
"AssetId": 3,
"ProviderId": 7,
"DepositInfo": "[\"2N3r9roRrHy7p6C5pGE8NQP9ZNT81H7ZKyU\",\"2MsZHcpBonQrqPuWhgBPG4h5jQxzn73AmP8\"]",
"result": true,
"errormsg": null,
"statuscode": 0
}
| Key | Value |
|---|---|
| AssetManagerId | integer. The ID of the Asset Manager where the asset or product belongs to. |
| AccountId | integer. The ID of the account for which the new deposit info was created. |
| AssetId | integer. The ID of the product the deposit info is/are for. |
| ProviderId | integer. The ID of the account provider setup for the product, a deposit info is directly linked to an account provider. No deposit info can be created without a functional account provider. |
| DepositInfo | string. The actual deposit info or keys, when parsed, it is an array where each element represents a deposit key, the newly created deposit key would be the element with the highest index. |
| result | boolean. A successful request returns true; and unsuccessful request (an error condition) returns false. |
| errormsg | string. A successful request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| statuscode | integer. A successful request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
Fee
GetWithdrawFee
Permissions: Operator, Trading, Withdraw
Call Type: Synchronous
Get a fee estimate for a withdrawal.
Withdraw fee is something that can be set by an exchange operator in the AdminUI, it is set per product. It can also be set programmatically using SetOMSFee.
Request
POST /GetWithdrawFee HTTP/1.1
Host: cexapi.wayex.com
aptoken: 1287b2b0-76c8-4249-ad22-3204fe4f4028 //valid sessiontoken
Content-Type: application/json
Content-Length: 82
{
"OMSId": 1,
"AccountId": 1,
"ProductId": 1,
"Amount": 100
}
All fields in the table below are required in order to the the correct withdraw fee estimate.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS trading the product. required. |
| AccountId | integer. The ID of the account making the withdrawal. Not explicitly required but needs to be defined to get the accurate estimate of withdraw fee especially if there are fee overrides. Defaults to zero if not defined. required. |
| ProductId | integer. The ID of the product intended to be withdrawn. Fees may vary with product. Not explicitly required but needs to be defined to get the accurate estimate of withdraw fee. Defaults to zero if not defined. required. |
| Amount | decimal. The amount of product intended to be withdrawn, not explicitly required but needs to be defined to get the accurate estimate of withdraw fee. Defaults to zero if not defined. required. |
| AccountProviderId | integer. When there are multiple account providers, an operator may defined varying fees for each. Defining an ID here makes sure the fee is accurate according to the account provider used to withdraw. Defaults to zero if not defined. optional. |
Response
{
"FeeAmount": 1.0,
"TicketAmount": 100
}
| Key | Value |
|---|---|
| FeeAmount | decimal. The estimated amount of the fee for the indicated withdrawal. |
| TicketAmount | decimal. The amount of product intended to be withdrawn. |
GetOrderFee
Permissions: Operator, Trading
Call Type: Synchronous
Returns an estimate of the transaction/trading fee for a specific order side, instrument, and order type. An exchange operator decides and sets the fees for each instrument.
The exchange generally deducts fees from the "receiving" side of the trade (although an operator can modify this). There are two products in every trade (and in every instrument); for example, the instrument BTCAUD comprises a Bitcoin product and a AUD product. Placing a buy order on the book causes fees to be deducted from Product 1, in this case, Bitcoin; placing a sell order causes fees to be deducted from Product 2, in this case, AUD.
A user with Trading permission can get fee estimates for any account that user is associated with and for any instrument or product that that account can trade; a user with Operator permission can get fee estimates for any account, instrument, or product.
If loyalty token is enabled and there is no market for the loyalty token, the system automatically uses 3rd party rates for the loyalty token market.
Request
POST /GetOrderFee HTTP/1.1
Host: cexapi.wayex.com
aptoken: f7e2c811-a9db-454e-9c9e-77533baf92d9 //valid sessiontoken
Content-Type: application/json
Content-Length: 177
{
"OMSId": 1,
"AccountId": 9,
"InstrumentId": 1,
"Quantity": 0.5,
"Side": 0,
"Price": "10000",
"OrderType": 2,
"MakerTaker": "Maker"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS on which the trade would take place. required. |
| AccountId | integer. The ID of the account requesting the fee estimate. There can be account overrides, the exchange operator can decide to apply very specific fees to specific accounts, such as a discounted price to a specific account. required. |
| InstrumentId | integer. The ID of the instrument being or to be traded. required. |
| Quantity | decimal. The quantity or amount of the proposed trade for which the OMS would charge a fee. required. |
| Price | decimal. The price at which the proposed trade would take place. Supply your price for a limit order; the exact price is difficult to know before execution. required. |
| OrderType | integer.. The type of the proposed order. An operator can set fees per OrderType. required. One of: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| MakerTaker | integer. Depending on the venue, there may be different fees for a maker (one who places the order on the books, either buy or sell) or taker (one who accepts the order, either buy or sell). If the user places a large order that is only partially filled, he is a partial maker. required. 0 Unknown 1 Maker 2 Taker |
| Side | integer. Side of the trade. It will decide at which product will the fee be donominated. In Wayex, the fee is charged in the incoming product by default. required. One of: 0 Buy 1 Sell 2 Short 3 Unknown |
Response
{
"OrderFee": 0.00001,
"ProductId": 2
}
| Key | Value |
|---|---|
| OrderFee | decimal. The estimated fee for the trade as described. |
| ProductId | integer. The ID of the product (currency) in which the fee is denominated. |
Instruments
An instrument is a pair of exchanged products (or fractions of them). For example, AUD for Bitcoin. In conventional investment parlance, a stock or a bond is called an instrument, but implicit in that is the potential exchange of one product for another (crypto for dollars). Wayex thinks of that exchange as explicit, and separates product from instrument.
GetInstruments
Permissions: Public
Call Type: Synchronous
Retrieves an array of instruments available on the trading venue. An instrument is a pair of products that can be traded.
Request
POST /GetInstruments HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 15
{
"OMSId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System. required. |
Response
[
{
"OMSId": 1,
"InstrumentId": 2,
"Symbol": "BTCAUD",
"Product1": 2,
"Product1Symbol": "BTC",
"Product2": 3,
"Product2Symbol": "AUD",
"InstrumentType": "Standard",
"VenueInstrumentId": 2,
"VenueId": 1,
"SortIndex": 0,
"SessionStatus": "Running",
"PreviousSessionStatus": "Paused",
"SessionStatusDateTime": "2025-04-02T21:08:41.129Z",
"SelfTradePrevention": true,
"QuantityIncrement": 0.00001,
"PriceIncrement": 0.01,
"MinimumQuantity": 0.0000001,
"MinimumPrice": 0.01,
"VenueSymbol": "BTCAUD",
"IsDisable": false,
"MasterDataId": 0,
"PriceCollarThreshold": 0.0,
"PriceCollarPercent": 20.0,
"PriceCollarEnabled": true,
"PriceFloorLimit": 0.0,
"PriceFloorLimitEnabled": false,
"PriceCeilingLimit": 0.0,
"PriceCeilingLimitEnabled": false,
"CreateWithMarketRunning": true,
"AllowOnlyMarketMakerCounterParty": false,
"PriceCollarIndexDifference": 20.0,
"PriceCollarConvertToOtcEnabled": false,
"PriceCollarConvertToOtcClientUserId": 0,
"PriceCollarConvertToOtcAccountId": 0,
"PriceCollarConvertToOtcThreshold": 0.0,
"OtcConvertSizeThreshold": 0.0,
"OtcConvertSizeEnabled": false,
"OtcTradesPublic": true,
"PriceTier": 0
}
]
Returns an array of instrument objects.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System. |
| InstrumentId | integer. The ID of the instrument. |
| Symbol | string. The symbol of the instrument. |
| Product1 | integer. The product ID of the first product in the instrument. |
| Product1Symbol | string. The symbol of the first product. |
| Product2 | integer. The product ID of the second product in the instrument. |
| Product2Symbol | string. The symbol of the second product. |
| InstrumentType | string. The type of instrument. One of: Standard Unknown Option Future |
| VenueInstrumentId | integer. The ID of the instrument on the trading venue. |
| VenueId | integer. The ID of the trading venue. |
| SortIndex | integer. The sort order for display. |
| SessionStatus | string. The current session status. One of: Unknown Running Paused Stopped Starting |
| PreviousSessionStatus | string. The previous session status. |
| SessionStatusDateTime | string. The date and time of the session status change, in ISO 8601 format. |
| SelfTradePrevention | boolean. If true, prevents self-trading. |
| QuantityIncrement | decimal. The smallest quantity increment in which the instrument can be traded. |
| PriceIncrement | decimal. The smallest price increment (tick size). |
| MinimumQuantity | decimal. The minimum quantity that can be traded. |
| MinimumPrice | decimal. The minimum price at which the instrument can be traded. |
| VenueSymbol | string. The symbol of the instrument on the trading venue. |
| IsDisable | boolean. If true, the instrument is disabled. |
| MasterDataId | integer. Reserved for future use. |
| PriceCollarThreshold | decimal. Price collar threshold value. |
| PriceCollarPercent | decimal. Price collar percentage. |
| PriceCollarEnabled | boolean. If true, price collar is enabled. |
| PriceFloorLimit | decimal. The price floor limit. |
| PriceFloorLimitEnabled | boolean. If true, price floor limit is enabled. |
| PriceCeilingLimit | decimal. The price ceiling limit. |
| PriceCeilingLimitEnabled | boolean. If true, price ceiling limit is enabled. |
| CreateWithMarketRunning | boolean. If true, orders can be created while the market is running. |
| AllowOnlyMarketMakerCounterParty | boolean. If true, only market makers can be counterparties. |
| PriceCollarIndexDifference | decimal. Price collar index difference. |
| PriceCollarConvertToOtcEnabled | boolean. If true, price collar converts to OTC. |
| PriceCollarConvertToOtcClientUserId | integer. Client user ID for OTC conversion. |
| PriceCollarConvertToOtcAccountId | integer. Account ID for OTC conversion. |
| PriceCollarConvertToOtcThreshold | decimal. Threshold for OTC conversion. |
| OtcConvertSizeEnabled | boolean. If true, OTC size conversion is enabled. |
| OtcConvertSizeThreshold | decimal. Threshold for OTC size conversion. |
| OtcTradesPublic | boolean. If true, OTC trades are public. |
| PriceTier | integer. The price tier. |
GetInstrument
Permissions: Public
Call Type: Synchronous
Retrieves the details of a specific instrument.
Request
POST /GetInstrument HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 39
{
"OMSId": 1,
"InstrumentId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System. required. |
| InstrumentId | integer. The ID of the instrument. required. |
Response
{
"OMSId": 1,
"InstrumentId": 2,
"Symbol": "BTCAUD",
"Product1": 2,
"Product1Symbol": "BTC",
"Product2": 3,
"Product2Symbol": "AUD",
"InstrumentType": "Standard",
"VenueInstrumentId": 2,
"VenueId": 1,
"SortIndex": 0,
"SessionStatus": "Running",
"PreviousSessionStatus": "Paused",
"SessionStatusDateTime": "2025-04-02T21:08:41.129Z",
"SelfTradePrevention": true,
"QuantityIncrement": 0.00001,
"PriceIncrement": 0.01,
"MinimumQuantity": 0.0000001,
"MinimumPrice": 0.01,
"VenueSymbol": "BTCAUD",
"IsDisable": false,
"MasterDataId": 0,
"PriceCollarThreshold": 0.0,
"PriceCollarPercent": 20.0,
"PriceCollarEnabled": true,
"PriceFloorLimit": 0.0,
"PriceFloorLimitEnabled": false,
"PriceCeilingLimit": 0.0,
"PriceCeilingLimitEnabled": false,
"CreateWithMarketRunning": true,
"AllowOnlyMarketMakerCounterParty": false,
"PriceCollarIndexDifference": 20.0,
"PriceCollarConvertToOtcEnabled": false,
"PriceCollarConvertToOtcClientUserId": 0,
"PriceCollarConvertToOtcAccountId": 0,
"PriceCollarConvertToOtcThreshold": 0.0,
"OtcConvertSizeThreshold": 0.0,
"OtcConvertSizeEnabled": false,
"OtcTradesPublic": true,
"PriceTier": 0
}
Returns a single instrument object.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the Order Management System. |
| InstrumentId | integer. The ID of the instrument. |
| Symbol | string. The symbol of the instrument. |
| Product1 | integer. The product ID of the first product. |
| Product1Symbol | string. The symbol of the first product. |
| Product2 | integer. The product ID of the second product. |
| Product2Symbol | string. The symbol of the second product. |
| InstrumentType | string. The type of instrument. |
| VenueInstrumentId | integer. The ID of the instrument on the venue. |
| VenueId | integer. The ID of the trading venue. |
| SortIndex | integer. The sort order for display. |
| SessionStatus | string. The current session status. |
| PreviousSessionStatus | string. The previous session status. |
| SessionStatusDateTime | string. The date and time of the session status change. |
| SelfTradePrevention | boolean. If true, prevents self-trading. |
| QuantityIncrement | decimal. The smallest quantity increment. |
| PriceIncrement | decimal. The smallest price increment. |
| MinimumQuantity | decimal. The minimum tradeable quantity. |
| MinimumPrice | decimal. The minimum price. |
| VenueSymbol | string. The symbol on the venue. |
| IsDisable | boolean. If true, the instrument is disabled. |
| MasterDataId | integer. Reserved for future use. |
| PriceCollarThreshold | decimal. Price collar threshold. |
| PriceCollarPercent | decimal. Price collar percentage. |
| PriceCollarEnabled | boolean. If true, price collar is enabled. |
| PriceFloorLimit | decimal. The price floor limit. |
| PriceFloorLimitEnabled | boolean. If true, price floor is enabled. |
| PriceCeilingLimit | decimal. The price ceiling limit. |
| PriceCeilingLimitEnabled | boolean. If true, price ceiling is enabled. |
| CreateWithMarketRunning | boolean. If true, orders can be created while market is running. |
| AllowOnlyMarketMakerCounterParty | boolean. If true, only market makers can be counterparties. |
Subscription
UnsubscribeLevel2
Permissions: Public
Call Type: Synchronous
Unsubscribes the user from a Level 2 Market Data Feed subscription.
Request
UnSubscribeLevel2 is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| InstrumentId | integer. The ID of the instrument being tracked by the Level 2 market data feed. required. |
| Symbol | string. Can be used instead of the InstrumentId. The symbol of the instrument you are unsubscribing level2 data from. required. |
Response
UnSubscribeLevel2 is not available in http. Subscription APIs are only supported in websockets.
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
| Key | Value |
|---|---|
| result | boolean. A successful receipt of the unsubscribe request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the unsubscribe request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the unsubscribe request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
SubscribeLevel2
Permissions: Public
Call Type: Synchronous
Retrieves the latest Level 2 Ticker information and then subscribes the user to Level 2 market data event updates for one specific instrument. Level 2 allows the user to specify the level of market depth information on either side of the bid and ask. The SubscribeLevel2 call responds with the Level 2 response shown below. The OMS then periodically sends Level2UpdateEvent information in the same format as this response until you send the UnsubscribeLevel2 call.
Only a user with Operator permission can issue a Level2MarketData permission using the call AddUserMarketDataPermission.
Request
SubscribeLevel2 is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| InstrumentId | integer. The ID of the instrument you’re tracking. required. |
| Symbol | string. Can be used instead of the InstrumentId. The symbol of the instrument you are subscribing to. required. |
| Depth | integer. The depth of the order book. The example request returns 10 price levels on each side of the market. required. |
Response
[
[
0, // MDUpdateId
1, // Number of Accounts
123, // ActionDateTime in Posix format X 1000
0, // ActionType 0 (New), 1 (Update), 2(Delete)
0.0, // LastTradePrice
0, // Number of Orders
0.0, //Price
0, // ProductPairCode
0.0, // Quantity
0, // Side
],
];
SubscribeLevel2 is not available in http. Subscription APIs are only supported in websockets.
The response is an array of elements for one specific instrument, the number of elements correspons to the depth specified in the Request. It is sent as an uncommented, comma-delimited list of numbers. The example is commented.
| Key | Value |
|---|---|
| MDUpdateID | long integer. Market Data Update ID. This sequential ID identifies the order in which the update was created. |
| Number of Accounts | integer. Number of accounts |
| ActionDateTime | long integer.. ActionDateTime identifies the time and date that the snapshot was taken or the event occurred, in POSIX format X 1000 (milliseconds since 1 January 1970). |
| ActionType | integer. L2 information provides price data. This value shows whether this data is: 0 new 1 update 2 deletion |
| LastTradePrice | decimal. The price at which the instrument was last traded. |
| Number of Orders | decimal. Number of orders |
| Price | decimal. Bid or Ask price for the Quantity (see Quantity below). |
| ProductPairCode | integer. ProductPairCode is the same value and used for the same purpose as InstrumentID. The two are completely equivalent. InstrumentId 47 = ProductPairCode 47. |
| Quantity | decimal. Quantity available at a given Bid or Ask price (see Price above). |
| Side | integer. One of: 0 Buy 1 Sell 2 Short (reserved for future use) 3 Unknown (error condition) |
SubscribeLevel1
Permissions: Public
Call Type: Synchronous
Retrieves the latest Level 1 Ticker information and then subscribes the user to ongoing Level 1 market data event updates for one specific instrument.
The SubscribeLevel1 call responds with the Level 1 response shown below. The OMS then periodically sends in the same format as this response Leve1UpdateEvent information when best-bid/best-offer issue, until you send the UnsubscribeLevel1 call.
Only a user with Operator permission can issue Level1MarketData permission using the call AddUserMarketDataPermission.
Request
SubscribeLevel1 is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| InstrumentId | integer. The ID of the instrument you’re tracking. required. |
| Symbol | string. Can be used instead of the InstrumentId. The symbol of the instrument you are subscribing to. required. |
Response
The SubscribeLevel1 response and Level1UpdateEvent both provide the same information.
{
"OMSId": 1,
"InstrumentId": 1,
"BestBid": 6423.57,
"BestOffer": 6436.53,
"LastTradedPx": 6423.57,
"LastTradedQty": 0.96183964,
"LastTradeTime": 1534862990343,
"SessionOpen": 6249.64,
"SessionHigh": 11111,
"SessionLow": 4433,
"SessionClose": 6249.64,
"Volume": 0.96183964,
"CurrentDayVolume": 3516.31668185,
"CurrentDayNumTrades": 8529,
"CurrentDayPxChange": 173.93,
"CurrentNotional": 0.0,
"Rolling24HrNotional": 0.0,
"Rolling24HrVolume": 4319.63870783,
"Rolling24NumTrades": 10585,
"Rolling24HrPxChange": -0.4165607307408487,
"TimeStamp": "1534862990358"
}
SubscribeLevel1 is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. |
| InstrumentId | integer. The ID of the instrument being tracked. |
| BestBid | decimal. The current best bid for the instrument. |
| BestOffer | decimal. The current best offer for the instrument. |
| LastTradedPx | decimal. The last-traded price for the instrument. |
| LastTradedQty | decimal. The last-traded quantity for the instrument. |
| LastTradeTime | long integer. The time of the last trade, in POSIX format. |
| SessionOpen | decimal. Opening price. In markets with openings and closings, this is the opening price for the current session; in 24-hour markets, it is the price as of UTC Midnight. |
| SessionHigh | decimal. Highest price during the trading day, either during a session with opening and closing prices or UTC midnight to UTC midnight. |
| SessionLow | decimal. Lowest price during the trading day, either during a session with opening and closing prices or UTC midnight to UTC midnight. |
| SessionClose | decimal. The closing price. In markets with openings and closings, this is the closing price for the current session; in 24-hour markets, it is the price as of UTC Midnight. |
| Volume | decimal. The last-traded quantity for the instrument, same value as LastTradedQty |
| CurrentDayVolume | decimal. The unit volume of the instrument traded either during a session with openings and closings or in 24-hour markets, the period from UTC Midnight to UTC Midnight. |
| CurrentDayNumTrades | integer. The number of trades during the current day, either during a session with openings and closings or in 24-hour markets, the period from UTC Midnight to UTC Midnight. |
| CurrentDayPxChange | decimal. Current day price change, either during a trading session or UTC Midnight to UTC midnight. |
| CurrentNotional | decimal. Current day quote volume - resets at UTC Midnight. |
| Rolling24HrNotional | decimal. Rolling 24 hours quote volume. |
| Rolling24HrVolume | decimal. Unit volume of the instrument during the past 24 hours, regardless of time zone. Recalculates continuously. |
| Rolling24HrNumTrades | decimal. Number of trades during the past 24 hours, regardless of time zone. Recalculates continuously. |
| Rolling24HrPxChange | decimal. Price change during the past 24 hours, regardless of time zone. Recalculates continuously. |
| TimeStamp | string. The time this information was provided, in POSIX format, it is stringified. |
UnsubscribeLevel1
Permissions: Public
Call Type: Synchronous
Unsubscribes the user from a Level 1 Market Data Feed subscription.
Request
UnSubscribeLevel1 is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| InstrumentId | integer. The ID of the instrument you’re unsubscribing level1 updates from. required. |
| Symbol | string. Can be used instead of the InstrumentId. The symbol of the instrument you’re unsubscribing level1 updates from. required. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
UnSubscribeLevel1 is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| result | boolean. A successful receipt of the unsubscribe request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the unsubscribe request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the unsubscribe request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
SubscribeTrades
Permissions: Public
Call Type: Synchronous
Subscribes an authenticated user to the Trades Market Data Feed for a specific instrument.
Request
SubscribeTrades is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS on which the instrument is traded. required. |
| InstrumentId | integer. The ID of the instrument whose trades will be reported. required. |
| IncludeLastCount | integer. Specifies the number of previous trades to retrieve in the immediate snapshot. required. |
Response
Numerical keys reduce package transmission load. See Response table for an explanation.
[
{
0: 1713390,
1: 1,
2: 0.25643269,
3: 6419.77,
4: 203100209,
5: 203101083,
6: 1534863265752,
7: 2,
8: 1,
9: 0,
10: 0,
},
];
SubscribeTrades is not available in http. Subscription APIs are only supported in websockets.
The response returns an array of trades. The keys of each trade are numbers to reduce payload traffic.
| Key | Value |
|---|---|
| 0 (TradeId) | integer. The ID of this trade. |
| 1 (InstrumentId) | integer. The ID of the instrument. |
| 2 (Quantity) | decimal. The quantity of the instrument traded. |
| 3 (Price) | decimal. The price at which the instrument was traded. |
| 4 (Order1) | integer. The ID of the first order that resulted in the trade, either Buy or Sell. |
| 5 (Order2) | integer. The ID of the second order that resulted in the trade, either Buy or Sell. |
| 6 (Tradetime) | long integer. UTC trade time in Total Milliseconds. POSIX format. |
| 7 (Direction) | integer. Effect of the trade on the instrument’s market price. One of: 0 NoChange 1 UpTick 2 DownTick |
| 8 (TakerSide) | integer. Which side of the trade took liquidity? One of: 0 Buy 1 Sell The maker side of the trade provides liquidity by placing the order on the book (this can be a buy or a sell order). The other, taker, side takes the liquidity. It, too, can be buy-side or sell-side. |
| 9 (BlockTrade) | boolean. Was this a privately negotiated trade that was reported to the OMS? A private trade returns 1 (true); otherwise 0 (false). Default is false. Block trades are not supported in exchange version 3.1 |
| 10 (order1ClientId or order2ClientId) | integer. The client-supplied order ID for the trade. Internal logic determines whether the program reports the order1ClientId or the order2ClientId. |
UnsubscribeTrades
Permissions: Public
Call Type: Synchronous
Unsubscribes the user from a Trades Market Data Feed
Request
UnsubscribeTrades is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS on which the user has subscribed to a trades market data feed. required. |
| InstrumentId | integer. The ID of the instrument being tracked by the trades market data feed. required. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
UnsubscribeTrades is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| result | boolean. A successful receipt of the unsubscribe request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the unsubscribe request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the unsubscribe request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
SubscribeTicker
Permissions: Public
Call Type: Synchronous
Subscribes User to Ticker Market Data Feed of a specific instrument. Interval is number of seconds for each bar. IncludeLastCount field specifies the number of previous bars to retrieve as a snapshot.
Request
SubscribeTicker is not available in http. Subscription APIs are only supported in websockets.
Supported Intervals are:
60, 300, 900, 1800, 3600, 7200, 14400, 21600, 43200, 86400, 604800, 2419200, 9676800, 125798400
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| InstrumentId | integer. The ID of the instrument whose ticker data you want to track. required. |
| Interval | integer. The number of seconds for each bar. required. |
| IncludeLastCount | integer. The number of previous bars to retrieve as a snapshot. required. |
Response
[
[
1692926460000, //EndDateTime
28432.44, //High
28432.44, //Low
28432.44, //Open
28432.44, //Close
0, //Volume
0, //Best Bid
0, //Best Ask
1, //InstrumentId
1692926400000, //BeginDateTime
],
];
SubscribeTicker is not available in http. Subscription APIs are only supported in websockets.
The response returns an array of objects , each object an unlabeled, comma-delimited array of numbers. The Open price and Close price are those at the beginning of the tick — the Interval time subscribed to in the request. For 24-hour exchanges, the trading day runs from UTC midnight to UTC midnight; highs, lows, opens, closes, and volumes consider that midnight-to-midnight period to be the trading day.
| Key | Value |
|---|---|
| EndDateTime | long integer. The end/closing date and time of the ticker, in UTC and POSIX format. |
| High | decimal. The Highest Trade Price for the Time-Period ( 0 if no trades ). |
| Low | decimal. The Lowest Trade Price for the Time-Period ( 0 if no trades ). |
| Open | decimal. The Opening Trade Price for the Time-Period ( 0 if no trades ). |
| Close | decimal. The Last Trade Price for the Time-Period ( 0 if no trades ). |
| Volume | decimal. The Total Trade Volume since the last Tick. |
| Bid | decimal. The best bid price at the time of the Tick. |
| Ask | decimal. The best ask price at the time of the Tick. |
| InstrumentId | integer. The ID of the instrument. |
| BeginDateTime | long integer. The start/opening date and time of the ticker, in UTC and POSIX format. |
UnsubscribeTicker
Permissions: Public
Call Type: Synchronous
Unsubscribes the user from a Ticker Market Data Feed.
Request
UnsubscribeTicker is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| InstrumentId | integer. The ID of the instrument being tracked by the ticker market data feed. required. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
UnsubscribeTicker is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| result | boolean. A successful receipt of the unsubscribe request returns true; and unsuccessful receipt (an error condition) returns false. |
| errormsg | string. A successful receipt of the unsubscribe request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. A successful receipt of the unsubscribe request returns 0. An unsuccessful receipt returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
SubscribeAccountEvents
Permissions: Operator,Trading,AccountReadOnly
Call Type: Synchronous
Subscribe to account-level events, such as orders, trades, deposits and withdraws. Can be used to monitor account transactions real-time.
Request
SubscribeAccountEvents is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| AccountId | integer. The ID of the account to subscribe with. required. |
Response
{
Subscribed: true
}
//Example account event that can be received
{
m: 3,
i: 2,
n: 'WithdrawTicketUpdateEvent',
o: '{"AssetManagerId":1,"AccountProviderId":0,"AccountId":7,"AccountName":"sample","AssetId":3,"AssetName":"BTC","Amount":0.001,"NotionalValue":0.001,"NotionalProductId":1,"TemplateForm":"{\\"key\\":\\"value\\"}","TemplateFormType":null,"OMSId":1,"RequestCode":"ef0ec64d-953b-477d-80b7-c3b0bf4cad64","RequestIP":null,"RequestUserId":1,"RequestUserName":"admin","OperatorId":1,"Status":"Pending2Fa","FeeAmt":0.00,"UpdatedByUser":0,"UpdatedByUserName":null,"TicketNumber":292,"WithdrawTransactionDetails":"{\\"TxId\\":null,\\"ExternalAddress\\":null,\\"Amount\\":0,\\"Confirmed\\":false,\\"LastUpdated\\":\\"0001-01-01T00:00:00.000Z\\",\\"TimeSubmitted\\":\\"0001-01-01T00:00:00.000Z\\",\\"AccountProviderName\\":null,\\"AccountProviderId\\":0}","RejectReason":null,"CreatedTimestamp":"2023-03-23T12:48:31.067Z","LastUpdateTimestamp":"2023-03-23T12:48:31.067Z","CreatedTimestampTick":638151725110676052,"LastUpdateTimestampTick":638151725110676052,"Comments":[],"Attachments":[],"AuditLog":[]}'
}
{
m: 3,
i: 4,
n: 'AccountPositionEvent',
o: '{"OMSId":1,"AccountId":7,"ProductSymbol":"BTC","ProductId":3,"Amount":1.1381543,"Hold":1.1256,"PendingDeposits":0,"PendingWithdraws":0,"TotalDayDeposits":0,"TotalMonthDeposits":0,"TotalYearDeposits":0,"TotalDayDepositNotional":0,"TotalMonthDepositNotional":0,"TotalYearDepositNotional":0,"TotalDayWithdraws":0,"TotalMonthWithdraws":0,"TotalYearWithdraws":0,"TotalDayWithdrawNotional":0,"TotalMonthWithdrawNotional":0,"TotalYearWithdrawNotional":0,"NotionalProductId":1,"NotionalProductSymbol":"AUD","NotionalValue":1.1381543,"NotionalHoldAmount":1.12562,"NotionalRate":1,"TotalDayTransferNotional":0}'
}
SubscribeAccountEvents is not available in http. Subscription APIs are only supported in websockets.
Returns either Subscribed: true or false. If false, it means that you were not able to subscribe to events of the account. After successfully subscribing to account events, you will receive the events message for transactions that involves the account such as a withdraw transaction, the specific event name will be WithdrawTicketUpdateEvent
UnSubscribeAccountEvents
Permissions: Trading
Call Type: Synchronous
UnSubscribe from account-level events. After being unsubscribed, you will stop receiving real-time events about transactions that concerns the specific account you unsubscribed to.
Request
UnSubscribeAccountEvents is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| AccountId | integer. The ID of the account to subscribe with. This to make sure you will be unsubscribed to the correct account. required. |
Response
{
UnSubscribed: true;
}
UnSubscribeAccountEvents is not available in http. Subscription APIs are only supported in websockets.
SubscribeOrderStateEvents
Permissions: Trading
Call Type: Synchronous
Subscribe to order state events of a specific account's orders. Optional parameter to filter by instrument.
Request
SubscribeOrderStateEvents is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| AccountId | integer. The ID of the account to subscribe with. required. |
| InstrumentId | integer. The ID of the instrument to subscribe orderstateevents with. This field serves as the filter parameter. optional. |
Response
{
Subscribed: true;
}
SubscribeOrderStateEvents is not available in http. Subscription APIs are only supported in websockets.
Returns either Subscribed: true or false. If false, it means that you were not able to subscribe to orderstateevents of the account. After successfully subscribing to orderstatevents of the account, you will receive the events message for any change of state of the account's order/s.
UnSubscribeOrderStateEvents
Permissions: Trading
Call Type: Synchronous
UnSubscribe from account-level events. After being unsubscribed, you will stop receiving real-time events about transactions that concerns the specific account you unsubscribed to.
Request
UnSubscribeOrderStateEvents is not available in http. Subscription APIs are only supported in websockets.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| AccountId | integer. The ID of the account to subscribe with. This is to make sure you will be unsubscribed to the correct account. required. |
| InstrumentId | integer. The ID of the instrument to unsubscribe orderstateevents with. This field serves as the filter parameter. optional. |
Response
{
UnSubscribed: true;
}
UnSubscribeOrderStateEvents is not available in http. Subscription APIs are only supported in websockets.
System
Ping
Permissions: Public
Call Type: Synchronous
Keepalive, can be used to avoid getting session timeout.
Request
POST /Ping HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 52
//No request payload needed
{
}
No request payload required.
Response
{
"msg": "PONG";
}
| Key | Value |
|---|---|
| msg | PONG means Ping request was successful and the gateway has responded. |
Trading
SendOrderList
Permissions: Operator, Trading
Call Type: Synchronous
Sends or creates a list of orders. Payload is an array containing JSON object/s, each JSON object represents a single order which is exactly the same as the payload of a SendOrder request. The orders can be assorted, means that it can be for different instruments and different accounts.
Anyone submitting an order should also subscribe to the various market data and event feeds, or call GetOpenOrders or GetOrderStatus to monitor the status of the order. If the order is not in a state to be executed, GetOpenOrders will not return it.
A user with Trading permission can create an order only for those accounts and instruments with which the user is associated; a user with Operator permissions can create an order for any account and instrument.
Request
POST /SendOrderList HTTP/1.1
Host: cexapi.wayex.com
aptoken: f7e2c811-a9db-454e-9c9e-77533baf92d9 //valid sessiontoken
Content-Type: application/json
Content-Length: 583
[
{
"InstrumentId": 2,
"OMSId": 1,
"AccountId": 185,
"TimeInForce": 1,
"ClientOrderId": 0,
"OrderIdOCO": 0,
"UseDisplayQuantity": false,
"Side": 0,
"Quantity": 0.02,
"OrderType": 2,
"PegPriceType": "3",
"LimitPrice": 23436
},
{
"InstrumentId": 2,
"OMSId": 1,
"AccountId": 185,
"TimeInForce": 1,
"ClientOrderId": 0,
"OrderIdOCO": 0,
"UseDisplayQuantity": false,
"Side": 0,
"Quantity": 0.02,
"OrderType": 2,
"PegPriceType": "3",
"LimitPrice": 23436
}
]
If OrderType=1 (Market), Side=0 (Buy), and LimitPrice is supplied, the Market order will execute up to the value specified
| Key | Value |
|---|---|
| InstrumentId | integer. The ID of the instrument being traded. |
| OMSId | integer. The ID of the OMS where the instrument is being traded. |
| AccountId | integer. The ID of the account placing the order. |
| TimeInForce | integer. An integer that represents the period during which the new order is executable. One of: 0 Unknown (error condition) 1 GTC (good 'til canceled, the default) 2 OPG (execute as close to opening price as possible: not yet used, for future provision) 3 IOC (immediate or canceled) 4 FOK (fill-or-kill — fill immediately or kill immediately) 5 GTX (good 'til executed: not yet used, for future provision) 6 GTD (good 'til date: not yet used, for future provision) |
| ClientOrderId | long integer. A user-assigned ID for the order (like a purchase-order number assigned by a company). This ID is useful for recognizing future states related to this order. ClientOrderId defaults to 0. Duplicate client orderid of two open orders of the same account is not allowed, the incoming order with the same clientorderid will get rejected. |
| OrderIdOCO | long integer. The order ID if One Cancels the Other — If this order is order A, OrderIdOCO refers to the order ID of an order B (which is not the order being created by this call). If order B executes, then order A created by this call is canceled. You can also set up order B to watch order A in the same way, but that may require an update to order B to make it watch this one, which could have implications for priority in the order book. See CancelReplaceOrder and ModifyOrder. |
| UseDisplayQuantity | boolean. If you enter a Limit order with a reserve(reserve order), you must set UseDisplayQuantity to true. |
| Side | integer. A number representing on of the following potential sides of a trade. One of: 0 Buy 1 Sell |
| Quantity | decimal. The quantity of the instrument being ordered. |
| OrderType | integer. A number representing the nature of the order. One of: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade. |
| PegPriceType | integer. When entering a stop/trailing order, set PegPriceType to an integer that corresponds to the type of price that pegs the stop: 1 Last(default) 2 Bid 3 Ask 4 Midpoint |
| LimitPrice | decimal. The price at which to execute the order, if the order is a Limit order. |
| DisplayQuantity | integer If UseDisplayQuantity is set to true, you must set a value of this field greater than 0, else, order will not appear in the orderbook. |
Response
{
"result": false, //It returns false but the request were successfully placed.
"errormsg": "Operation In Process",
"errorcode": 107,
"detail": null
}
| Key | Value |
|---|---|
| result | boolean. Specifically for this API only, it returns false even if the request went through. |
| errormsg | string. A successful request returns Operation In Process; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20), Invalid Request (errorcode 100), Operation Failed (errorcode 101), Server Error (errorcode 102), Resource Not Found (errorcode 104) |
| errorcode | integer. A successful request returns 107. An unsuccessful request returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
SendCancelList
Permissions: Operator, Trading
Call Type: Synchronous
Send a list of orders to cancel. Payload is an array of objects, each object represents an order to be cancelled.
Request
POST /SendCancelList HTTP/1.1
Host: cexapi.wayex.com
aptoken: cf165646-2021-4460-9fc4-234e0cec454b
Content-Type: application/json
Content-Length: 178
[
{
"OMSId": 1,
"OrderId": 6714,
"AccountId": 9
},
{
"OMSId": 1,
"OrderId": 6507,
"AccountId": 9
}
]
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS where the original order was placed. required. |
| OrderId | integer. The ID of the order/s to be canceled. To get orderid/s of open orders, you can use GetOpenOrders API.required. |
| AccountId | integer. Account for which order/s will be canceled. If not specified, order/s will not be cancelled required. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
| Key | Value |
|---|---|
| result | boolean. A successful request returns true; and unsuccessful request (an error condition) returns false. |
| errormsg | string. A successful request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20), Invalid Request (errorcode 100), Operation Failed (errorcode 101), Server Error (errorcode 102), Resource Not Found (errorcode 104) |
| errorcode | integer. A successful request returns 0. An unsuccessful request returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
SendCancelReplaceList
Permissions: Operator, Trading
Call Type: Synchronous
Send a list of Cancel/Replace requests. Only working orders can be replaced.
Request
POST /SendCancelReplaceList HTTP/1.1
Host: cexapi.wayex.com
aptoken: 912ea315-31a3-43da-b229-d8f59c7db302
Content-Type: application/json
Content-Length: 566
[
{
"OMSId":1,
"OrderIdToReplace":6696,
"ClientOrdId":0,
"OrderType":"Limit",
"Side":"Buy",
"AccountId":7,
"InstrumentId":1,
"LimitPrice":29500,
"TimeInForce":1,
"Quantity":0.003
},
{
"OMSId":1,
"OrderIdToReplace":6698,
"ClientOrdId":0,
"OrderType":"Limit",
"Side":"Buy",
"AccountId":7,
"InstrumentId":1,
"LimitPrice":29900,
"TimeInForce":1,
"Quantity":0.004
}
]
| Key | Value |
|---|---|
| OmsId | integer. The ID of the OMS on which the order is being canceled and replaced by another order. required. |
| ReplaceOrderId | long integer. The ID of the order to be replaced. required. |
| ReplaceClientOrderId | long integer. The ClientOrderId of the existing order to be replaced. optional. |
| ClientOrderId | long integer. A custom ID that can identify the replacement order later on. It is required for this field to be unique for every working order. Defaults to 0 if not defined. optional. |
| OrderType | integer or string. An integer representing the type of the replacement order: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade. Either the string or integer value is accepted. required. |
| Side | integer. An integer representing the side of the replacement order: 0 Buy 1 Sell required. |
| AccountId | integer. The ID of the account who owns the order and is replacing the order, AccountId of the replacement order must match the AccountId of the existing order. required. |
| InstrumentId | integer. The ID of the instrument being traded. required. |
| UseDisplayQuantity | boolean. The display quantity is the quantity of a product shown to the market to buy or sell. A larger quantity may be wanted or available, but it may disadvantageous to display it when buying or selling. The display quantity is set when placing an order (using SendOrder or CancelReplaceOrder for instance). If you enter a Limit order with reserve, you must set useDisplayQuantity to true. optional. |
| DisplayQuantity | decimal. The quantity of a product that is available to buy or sell that is publicly displayed to the market or simply in the orderbook. Will be used when UseDisplayQuantity is set to true, and in that case it needs to be defined else order will not appear in the order book as it will default to 0. optional. |
| LimitPrice | decimal. The price at which to execute the new order, if the new order is a limit order. If the replacement order is a market order, there is no need to define this field. Expressed in ticks for trailing stops. conditionally required. |
| StopPrice | decimal. The price at which to execute the new order if the replacement order is a stop order. If the replacement order is a not a stop order, there is no need to define this field. Expressed in ticks for trailing stops. conditionally required. |
| ReferencePrice | decimal. Used if the replacement order is trailing order. If the replacement order is not a trailing order, there is no need to define this field. conditionally required. |
| PegPriceType | integer or string. The type of price you set in a stop/trailing order to "peg the stop." 0 Unknown (error condition) 1 Last 2 Bid 3 Ask 4 Midpoint.Either the integer or string value is accepted. If the replacement order is not a trailing/stop order, there is no need to define this field. conditionally required. |
| TimeInForce | integer or string. Represents the period during which the new order is executable. One of: 0 Unknown (error condition) 1 GTC (good 'til canceled, the default) 2 OPG (execute as close to opening price as possible: not yet used, for future provision) 3 IOC (immediate or canceled) 4 FOK (fill or kill — fill the order immediately, or cancel it immediately) 5 GTX (good 'til executed: not yet used, for future provision) 6 GTD (good 'til date: not yet used, for future provision). Either the integer or string value is accepted. required. |
| OrderIdOCO | integer. One Cancels the Other — If the order being canceled in this call is order A, and the order replacing order A in this call is order B, then OrderIdOCO refers to an order C that is currently open. If order C executes, then order B is canceled. You can also set up order C to watch order B in this way, but that will require an update to order C. Orderid to link this order to for OCO, negative values represent ordinal offset to current orderid, i.e., -1 = previous order. optional. |
| Quantity | decimal. The quantity of the replacement order. required. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
| Key | Value |
|---|---|
| result | boolean. A successful request returns true; and unsuccessful request (an error condition) returns false. |
| errormsg | string. A successful request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20), Invalid Request (errorcode 100), Operation Failed (errorcode 101), Server Error (errorcode 102), Resource Not Found (errorcode 104), Order Not Found (errorcode 104) |
| errorcode | integer. A successful request returns 0. An unsuccessful request returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
ModifyOrder
Permissions: Operator, Trading
Call Type: Synchronous
Reduces an order’s quantity without losing priority in the order book. An order’s quantity can only be reduced. The other call that can modify an order — CancelReplaceOrder — resets order book priority, but you can use it to increase an order quantity and also change the limitprice.
Request
POST /ModifyOrder HTTP/1.1
Host: cexapi.wayex.com
aptoken: 356cdf76-b767-4af5-890e-837ea17030d0
Content-Type: application/json
Content-Length: 109
{
"OMSId": 1,
"OrderId": 6507,
"InstrumentId": 9,
"Quantity": 0.1,
"AccountId": 9
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS where the original order was placed. required. |
| OrderId | long integer. The ID of the order to be modified. The ID was supplied by the server when the order was created. required. |
| InstrumentId | integer. The ID of the instrument traded in the order. required. |
| Quantity | decimal. The new quantity of the order. This value can only be reduced from a previous quantity. required. |
| AccountId | integer. Account for which order will be modified. required. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
//Possible error/s
//Quantity defined is greater than the existing quantity of the order being modified. This API can only reduce the quantity of the existing order.
{
"result": false,
"errormsg": "Invalid Quantity",
"errorcode": 100,
"detail": null
}
//One or more required fields are not defined
{
"result": false,
"errormsg": "Invalid Request",
"errorcode": 100,
"detail": "Not all required fields are provided"
}
The response acknowledges the successful receipt of your request to modify an order; it does not indicate that the order has been modified. To find if an order has been modified, check using GetOpenOrders and GetOrderHistory.
| Key | Value |
|---|---|
| result | boolean. The successful receipt of a modify order request returns true; otherwise, returns false. This is the acknowledgment of receipt of the request to modify, not a confirmation that the modification has taken place. |
| errormsg | string. A successful receipt of a modify request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Invalid Quantity (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) |
| errorcode | integer. The receipt of a successful request to modify returns 0. An unsuccessful request returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. Usually null. |
CancelAllOrders
Permissions: Operator, Trading
Call Type: Synchronous
Cancels all open matching orders for the specified account on an OMS.
A user with Trading permission can cancel orders for accounts it is associated with; a user with Operator permissions can cancel orders for any account.
Request
POST /CancelAllOrders HTTP/1.1
Host: cexapi.wayex.com
aptoken: 0b9e03f8-40c8-4653-b52f-1e75e9f9cd0b //valid sessiontoken
Content-Type: application/json
Content-Length: 60
//Cancel all orders of a specific account for a specific instrument
{
"OMSId": 1,
"AccountId": 9,
"InstrumentId": 1
}
//Cancel all orders of all accounts for a specific instrument
{
"OMSId": 1,
"AccountId": 0,
"InstrumentId": 1
}
//Cancel all orders of all accounts for all instruments
{
"OMSId": 1,
"AccountId": 0,
"InstrumentId": 0
}
| Key | Value |
|---|---|
| AccountId | integer. The account for which all orders are being canceled. If no AccountId is defined, orders for all accounts will be cancelled. optional. |
| OMSId | integer. The OMS under which the account operates. required.. |
| IntrumentId | integer. The instrument for which all orders are being canceled. If there is no instrumentid defined, all orders for all instruments will be cancelled. optional. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
The Response is a standard response object.
| Key | Value |
|---|---|
| result | boolean. If the call has been successfully received by the OMS, result is true; otherwise it is false. |
| errormsg | string. A successful receipt of the call returns null. The errormsg key for an unsuccessful call returns one of the following messages: Not Authorized (errorcode 20) Invalid Response (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successful receipt of the call returns 0. An unsuccessful receipt of the call returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. |
GetOrderStatus
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves the status information for a single order.
A user with Trading permission can retrieve status information for accounts and orders with which the user is associated; a user with Operator permission can retreive status information for any account or order ID.
Request
POST /GetOrderStatus HTTP/1.1
Host: cexapi.wayex.com
aptoken: f7e2c811-a9db-454e-9c9e-77533baf92d9 //valid session token
Content-Type: application/json
Content-Length: 63
{
"OMSId": 1,
"AccountId": 7,
"OrderId": 6562
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS on which the order was placed. optional. |
| AccountId | integer. The ID of the account under which the order was placed. If the authenticated user has elevated permission such as SUPERUSER, AccountId is not explicitly required. conditionally required. |
| OrderId | integer. The ID of the order whose status will be returned. If the authenticated user has elevated permission such as SUPERUSER, OrderId is not explicitly required. conditionally required. |
Response
{
"Side": "Buy",
"OrderId": 6562,
"Price": 23436.0,
"Quantity": 0.02,
"DisplayQuantity": 0.0,
"Instrument": 1,
"Account": 7,
"AccountName": "sample",
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 1680020672485,
"ReceiveTimeTicks": 638156174724846502,
"LastUpdatedTime": 1680020672485,
"LastUpdatedTimeTicks": 638156174724852936,
"OrigQuantity": 0.02,
"QuantityExecuted": 0.0,
"GrossValueExecuted": 0.0,
"ExecutableValue": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": 6562,
"OrigClOrdId": 0,
"EnteredBy": 0,
"UserName": "",
"IsQuote": false,
"InsideAsk": 29000.0,
"InsideAskSize": 0.52,
"InsideBid": 23436.0,
"InsideBidSize": 0.0,
"LastTradePrice": 29000.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "AddedToBook",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Ask",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": null,
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
}
The call GetOrderStatus returns a JSON object which contains the data of a specific order.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each OMS. |
| Price | decimal. The price at which the buy or sell has been ordered. |
| Quantity | decimal. The quantity of the product to be bought or sold. |
| DisplayQuantity | decimal. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| Account | integer. ID of the of the account which submitted the order. |
| AccountName | string. Name of the of the account which submitted the order. |
| OrderType | string. Will always be BlockTrade as this GetOpenTradeReports API will only return open blocktrades. |
| ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current or the latest state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 FullyExecuted. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | decimal. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | decimal. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| GrossValueExecuted | decimal. If the open order has been at least partially executed, this value shows the gross amount that has been executed. |
| AvgPrice | decimal. The average executed price of the order. |
| CounterPartyId | integer. The ID of the account who is the counterparty for the trade if order is already executed, either partial or fully executed. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified. An order that is newly added to book will have NewInputAccepted value by default. |
| OrigOrderId | integer. If the order is a replacement order, this is the ID of the original order. |
| OrigClOrdId | integer. If the order is a replacement order, this is the client order ID or the original order. |
| EnteredBy | integer. The ID of the user who submitted the order. |
| Username | string. The username of the user who submitted the order. Usually returns as an empty string. |
| IsQuote | boolean. If this order is a quote, the value for IsQuote is true, otherwise it is false. |
| InsideAsk | decimal. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | decimal. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | decimal. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | decimal. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | decimal. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancellation reason. |
| OrderFlag | string. One of the following: NoAccountRiskCheck, AddedToBook, RemovedFromBook, PostOnly, Liquidation, ReverseMarginPosition, Synthetic. |
| UseMargin | boolean. Margin is not yet supported so this always defaults to false. |
| StopPrice | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegPriceType | string. The type of price to peg the Stop to for Stop/Trailing orders. |
| PegOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegLimitOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| IpAddress | string. The IP address from where the order was submitted. |
| OMSId | integer. The ID of the OMS. |
GetOrdersHistory
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves a history of orders for the specified search parameters.
For example, if depth = 200 and startIndex = 0, the history returns 200 unique orders into the past starting with the most recent (0) order. If depth = 200 and startIndex = 100, the history returns 200 unique orders into the past starting at 101st order in the past.
The owner of the trading venue determines how long to retain order history before archiving.
A user with Trading permission can retrieve orders history only for accounts it is associated with; a user with Operator permission can retrieve orders history for any user or account.
Request
POST /GetOrdersHistory HTTP/1.1
Host: cexapi.wayex.com
aptoken: c5f917b9-f173-4c29-a615-1503d2e78023 //valid sessiontoken
Content-Type: application/json
Content-Length: 41
{
"OMSId": 1,
"AccountId": 7
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS on which the orders took place. If no other values are specified, the call returns the orders associated with the default account for the logged-in user on this OMS. required. |
| AccountId | integer. The account ID that made the trades. A user with Trading permission must be associated with this account, although other users also can be associated with the account. Not explicitly required if the authenticated user has elevated permission/s. conditionally required. |
| OrderState | string. The current state of the order. Can be used to filter results. If not specified all orders regardless of the order state will be returned. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 FullyExecuted. optional. |
| OrderId | long integer. ID for the order.Can be used to filter results. Can be used to filter for a specific orderid. There is a specific API call GetOrderHistoryByOrderId for filtering orders by OrderId. optional. |
| ClientOrderId | long integer. A user-assigned ID for the order (like a purchase-order number assigned by a company).Can be used to filter results. clientOrderId defaults to 0. optional. |
| OriginalOrderId | long integer. The original ID of the order. If specified, the call returns changed orders associated with this order ID. Can be used to filter results. optional. |
| OriginalClientOrderId | long integer. If the order has been changed, shows the original client order ID, a value that the client can create (much like a purchase order). Can be used to filter results. optional. |
| UserId | integer. The ID of the user whose account orders will be returned. If not specified, the call returns the orders of the logged-in user.Can be used to filter results. optional. |
| InstrumentId | long integer. The ID of the instrument named in the order. If not specified, the call returns orders for all instruments traded by this account. Can be used to filter results. optional. |
| StartTimestamp | long integer. Date and time at which to begin the orders history, in POSIX format. Can be used to filter results. optional. |
| EndTimestamp | long integer. Date and time at which to end the orders report, in POSIX format. Can be used to filter results. optional. |
| Depth | integer. In this case, the maximum number/count of unique orders to return, counting from the StartIndex if it is also specified. If not specified, returns the 100 most recent to orders; results can vary depending if other optional fields are defined such as StartIndex, StartTimestamp, and EndTimestamp. Can be used to filter results and for pagination. optional. |
| Limit | integer. Functions exactly the same as the Depth field. optional. |
| StartIndex | integer. A value of 0 means the first object in the result will be the the most recent order, a value of 2 means that the first object in the result set will be the third most recent order. If not specified, defaults to 0. Can be used to filter results or for pagination. optional. |
Response
[
{
"Side": "Sell",
"OrderId": 6713,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 11,
"Account": 7,
"AccountName": "sample",
"OrderType": "Market",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1682663431785,
"ReceiveTimeTicks": 638182602317851821,
"LastUpdatedTime": 1682663431791,
"LastUpdatedTimeTicks": 638182602317910891,
"OrigQuantity": 0.01,
"QuantityExecuted": 0.01,
"GrossValueExecuted": 60.0,
"ExecutableValue": 0.0,
"AvgPrice": 6000.0,
"CounterPartyId": 0,
"ChangeReason": "Trade",
"OrigOrderId": 6713,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_user",
"IsQuote": false,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"InsideBid": 6000.0,
"InsideBidSize": 0.01,
"LastTradePrice": 6000.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Bid",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
},
{
"Side": "Sell",
"OrderId": 6709,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 11,
"Account": 7,
"AccountName": "sample",
"OrderType": "Market",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1682663089848,
"ReceiveTimeTicks": 638182598898484597,
"LastUpdatedTime": 1682663089923,
"LastUpdatedTimeTicks": 638182598899230197,
"OrigQuantity": 0.01,
"QuantityExecuted": 0.01,
"GrossValueExecuted": 60.0,
"ExecutableValue": 0.0,
"AvgPrice": 6000.0,
"CounterPartyId": 0,
"ChangeReason": "Trade",
"OrigOrderId": 6709,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_user",
"IsQuote": false,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"InsideBid": 6000.0,
"InsideBidSize": 0.01,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Bid",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
}
]
The call GetOrdersHistory returns an array or objects, each object represents an order at its latest status; an order will only occupy 1 index or just 1 instance in the result. GetOrdersHistory API does not return the full history of a specific order, there is another API that will give you just that: GetOrderHistoryByOrderId.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each OMS. |
| Price | decimal. The price at which the buy or sell has been ordered. |
| Quantity | decimal. The quantity of the product to be bought or sold. |
| DisplayQuantity | decimal. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| Account | integer. ID of the of the account which the order belongs to. |
| AccountName | string. Name of the of the account which which the order belongs to. |
| OrderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current or the latest state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| LastUpdatedTime | long integer. Time stamp when the order was last updated, in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| LastUpdatedTimeTicks | long integer. Time stamp when the order was last updated, in Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | decimal. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | decimal. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| GrossValueExecuted | decimal. If the open order has been at least partially executed, this value shows the gross amount that has been executed. |
| ExecutableValue | decimal. Defaults to 0. |
| AvgPrice | decimal. The average executed price of the order. |
| CounterPartyId | integer. The ID of the account who is the counterparty for the trade if order is already executed, either partial or fully executed. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified. An order that is newly added to book will have NewInputAccepted value by default. |
| OrigOrderId | long integer. If the order is a replacement order, this is the ID of the original order. |
| OrigClOrdId | long integer. If the order is a replacement order, this is the client order ID or the original order. |
| EnteredBy | integer. The ID of the user who submitted the order. |
| Username | string. The username of the user who submitted the order. |
| IsQuote | boolean. If this order is a quote, the value for IsQuote is true, otherwise it is false. |
| InsideAsk | decimal. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | decimal. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | decimal. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | decimal. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | decimal. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancellation reason. |
| OrderFlag | string. One or more of: 1 NoAccountRiskCheck 2 AddedToBook 4 RemovedFromBook 8 PostOnly 16 Liquidation 32 ReverseMarginPosition |
| UseMargin | boolean. Margin is not yet supported so this always defaults to false. |
| StopPrice | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegPriceType | string. The type of price to peg the Stop to for Stop/Trailing orders. |
| PegOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegLimitOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| IpAddress | string. The IP address from where the order was submitted. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| OMSId | integer. The ID of the OMS. |
GetTradesHistory
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves a list of trades for a specified account, order ID, user, instrument, or starting and ending time stamp. The returned list begins at start index i, where i is an integer identifying a specific trade in reverse order; that is, the most recent trade has an index of 0. “Depth” is the count of trades to report backwards from StartIndex.
Users with Trading permission can retrieve trade history for accounts with which they are associated; users with Operator permission can retrieve trade history for any account.
Request
All values in the request other than OMSId are optional.
POST /GetTradesHistory HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
aptoken: d7676b7e-0290-1ad2-c08a-1280888ffda7
Content-Length: 211
{
"OMSId": 1,
"AccountId": 7,
"Depth": 2,
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS on which the trades took place. required. |
| AccountId | integer. The account ID that made the trades. If no account ID is supplied, the system assumes the default account for the logged-in user making the call. optional. |
| InstrumentId | integer. The ID of the instrument whose trade history is reported. If not specified, defaults to 0 which means results won't be filtered according to it. optional. |
| TradeId | long integer. The ID of a specific trade. optional. |
| OrderId | long integer. The ID of the order resulting in the trade. If specified, the call returns all trades associated with the order. If not specified, defaults to 0 which means results won't be filtered according to it. optional. |
| UserId | integer. If not specified, the call returns trades associated with the users belonging to the default account for the logged-in user. optional. |
| StartTimeStamp | long integer. The historical date and time at which to begin the trade report, in POSIX format. If not specified, defaults to 0 which means results won't be filtered according to it. Value must be in milliseconds if to be used. optional. |
| EndTimeStamp | long integer. Date and time at which to end the trade report, in POSIX format. If not specified, defaults to 0 which means results won't be filtered according to it. Value must be in milliseconds if to be used. optional. |
| Depth | integer. In this case, the count of trades to return, counting from the StartIndex. If Depth is not specified, returns all trades between BeginTimeStamp and EndTimeStamp, beginning at StartIndex. If no other filter parameter is defined, the maximum will result set will be according to the MaxApiResponseResultSet Gateway config value. optional. |
| StartIndex | integer. The starting index into the history of trades, from 0 (the most recent trade) and moving backwards in time. If not specified, defaults to 0 which means results won't be filtered according to it. optional. |
| ExecutionId | integer. The ID of the individual buy or sell execution. If not specified, defaults to 0 which means results won't be filtered according to it. optional. |
Response
[
{
"OMSId": 1,
"ExecutionId": 1928,
"TradeId": 964,
"OrderId": 6713,
"AccountId": 7,
"AccountName": "sample",
"SubAccountId": 0,
"ClientOrderId": 0,
"InstrumentId": 11,
"Side": "Sell",
"OrderType": "Market",
"Quantity": 0.01,
"RemainingQuantity": 0.0,
"Price": 6000.0,
"Value": 60.0,
"CounterParty": "185",
"OrderTradeRevision": 1,
"Direction": "NoChange",
"IsBlockTrade": false,
"Fee": 0.0,
"FeeProductId": 0,
"OrderOriginator": 6,
"UserName": "sample_user",
"TradeTimeMS": 1682663431787,
"MakerTaker": "Taker",
"AdapterTradeId": 0,
"InsideBid": 6000.0,
"InsideBidSize": 0.01,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"IsQuote": false,
"CounterPartyClientUserId": 1,
"NotionalProductId": 1,
"NotionalRate": 1.0,
"NotionalValue": 60.0,
"NotionalHoldAmount": 0,
"TradeTime": 638182602317874025
},
{
"OMSId": 1,
"ExecutionId": 1924,
"TradeId": 962,
"OrderId": 6709,
"AccountId": 7,
"AccountName": "sample",
"SubAccountId": 0,
"ClientOrderId": 0,
"InstrumentId": 11,
"Side": "Sell",
"OrderType": "Market",
"Quantity": 0.01,
"RemainingQuantity": 0.0,
"Price": 6000.0,
"Value": 60.0,
"CounterParty": "9",
"OrderTradeRevision": 1,
"Direction": "NoChange",
"IsBlockTrade": false,
"Fee": 0.0,
"FeeProductId": 0,
"OrderOriginator": 6,
"UserName": "sample_user",
"TradeTimeMS": 1682663089862,
"MakerTaker": "Taker",
"AdapterTradeId": 0,
"InsideBid": 6000.0,
"InsideBidSize": 0.01,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"IsQuote": false,
"CounterPartyClientUserId": 1,
"NotionalProductId": 1,
"NotionalRate": 1.0,
"NotionalValue": 60.0,
"NotionalHoldAmount": 0,
"TradeTime": 638182598898615128
}
]
The response is an array of objects, each element represents a single trade.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS to which the account belongs. |
| ExecutionId | integer. The ID of this account's side of the trade. Every trade has two sides. |
| TradeId | long integer. The ID of the overall trade. |
| OrderId | long integer. The ID of the order causing the trade (buy or sell). |
| AccountId | integer. The ID of the account that made the trade (buy or sell). |
| AccountName | string. The Name of the account that made the trade (buy or sell). |
| SubAccountId | integer. Not currently used; reserved for future use. Defaults to 0. |
| ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The clientOrderId defaults to 0 if not supplied. |
| InstrumentId | integer. The ID of the instrument being traded. An instrument comprises two products, for example Dollars and Bitcoin. |
| Side | string. One of the following potential sides of a trade: 0 Buy 1 Sell |
| OrderType | string. One of the following potential sides of a trade: Market Limit BlockTrade StopMarket StopLimit TrailingStopLimit StopMarket TrailingStopMarket |
| Quantity | decimal. The unit quantity of this side of the trade. |
| RemainingQuantity | decimal. The number of units remaining to be traded by the order after this execution. This number is not revealed to the other party in the trade. This value is also known as "leave size" or "leave quantity." |
| Price | decimal. The unit price at which the instrument traded. |
| Value | decimal. The total value of the deal. The system calculates this as: unit price X quantity executed. |
| CounterParty | string. The ID of the other party in a block trade. Usually, IDs are stated as integers; this value is an integer written as a string. |
| OrderTradeRevision | integer. The revision number of this trade; usually 1. |
| Direction | integer. The effect of the trade on the instrument's market price. One of: 0 No change 1 Uptick 2 DownTick |
| IsBlockTrade | boolean. A value of true means that this trade was a block trade; a value of false that it was not a block trade. |
| Fee | decimal. Any fee levied against the trade by the Exchange. |
| FeeProductId | integer. The ID of the product in which the fee was levied. |
| OrderOriginator | integer. The ID of the user who initiated the trade. |
| UserName | string. The UserName of the user who initiated the trade. |
| TradeTimeMS | long integer. The date and time that the trade took place, in milliseconds and POSIX format. All dates and times are UTC. |
| MakerTaker | string. One of the following potential liquidity provider of a trade: Maker Taker |
| AdapterTradeId | integer. The ID of the adapter of the overall trade. |
| InsideBid | decimal. The best (highest) price level of the buy side of the book at the time of the trade. |
| InsideBidSize | decimal. The quantity of the best (highest) price level of the buy side of the book at the time of the trade. |
| InsideAsk | decimal. The best (lowest) price level of the sell side of the book at the time of the trade. |
| InsideAskSize | decimal. The quantity of the best (lowest) price level of the sell side of the book at the time of the trade. |
| CounterPartyClientUserId | integer. Indicates counterparty source of trade (OMS, Remarketer, FIX) |
| NotionalProductId | integer. Notional product the notional value was captured in |
| NotionalRate | decimal. Notional rate from base currency at time of trade |
| NotionalValue | decimal. Notional value in base currency of venue at time of trade |
| TradeTime | long integer. The date and time that the trade took place, in C# Ticks. All dates and times are UTC. |
GetOrderHistoryByOrderId
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves an order with the specified OrderId, includes all the history of that specific order, from being added to the book up to the full execution or rejection, or cancellation. ReceiveTime in POSIX format X 1000 (milliseconds since 1 January 1970)
A user with Trading permission can retrieve an order history only for his/her account/s; a user with Operator permission can retrieve order history for all accounts.
Request
POST /GetOrderHistoryByOrderId HTTP/1.1
Host: cexapi.wayex.com
aptoken: c5f917b9-f173-4c29-a615-1503d2e78023 //valid sessiontoken
Content-Type: application/json
Content-Length: 42
{
"OMSId": 1,
"OrderId": 6459
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| OrderId | long integer. The ID of the of the order which you want to get details and history of. Not explicitly required but no order will be retrieved if not defined. required. |
Response
[
{
"Side": "Buy",
"OrderId": 6459,
"Price": 1.3638,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 9,
"Account": 7,
"AccountName": "sample_user",
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1678263954878,
"ReceiveTimeTicks": 638138607548778980,
"LastUpdatedTime": 1678263960020,
"LastUpdatedTimeTicks": 638138607600197010,
"OrigQuantity": 18307.63,
"QuantityExecuted": 18307.63,
"GrossValueExecuted": 24966.439664,
"ExecutableValue": 0.0,
"AvgPrice": 1.3637177321149706433874837977,
"CounterPartyId": 0,
"ChangeReason": "Trade",
"OrigOrderId": 6455,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_superuser",
"IsQuote": false,
"InsideAsk": 1.3646,
"InsideAskSize": 8959.3,
"InsideBid": 1.3638,
"InsideBidSize": 10776.98,
"LastTradePrice": 1.3636,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "AddedToBook, RemovedFromBook",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Last",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
},
{
"Side": "Buy",
"OrderId": 6459,
"Price": 1.3638,
"Quantity": 10776.98,
"DisplayQuantity": 10776.98,
"Instrument": 9,
"Account": 7,
"AccountName": "sample_user",
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 1678263954878,
"ReceiveTimeTicks": 638138607548778980,
"LastUpdatedTime": 1678263954881,
"LastUpdatedTimeTicks": 638138607548809830,
"OrigQuantity": 18307.63,
"QuantityExecuted": 7530.65,
"GrossValueExecuted": 10268.79434,
"ExecutableValue": 0.0,
"AvgPrice": 1.3636,
"CounterPartyId": 0,
"ChangeReason": "Trade",
"OrigOrderId": 6455,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_superuser",
"IsQuote": false,
"InsideAsk": 1.3646,
"InsideAskSize": 8959.3,
"InsideBid": 1.3638,
"InsideBidSize": 10776.98,
"LastTradePrice": 1.3636,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "AddedToBook",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Last",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
},
{
"Side": "Buy",
"OrderId": 6459,
"Price": 1.3638,
"Quantity": 10776.98,
"DisplayQuantity": 10776.98,
"Instrument": 9,
"Account": 7,
"AccountName": "sample_user",
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 1678263954878,
"ReceiveTimeTicks": 638138607548778980,
"LastUpdatedTime": 1678263954881,
"LastUpdatedTimeTicks": 638138607548807642,
"OrigQuantity": 18307.63,
"QuantityExecuted": 7530.65,
"GrossValueExecuted": 10268.79434,
"ExecutableValue": 0.0,
"AvgPrice": 1.3636,
"CounterPartyId": 0,
"ChangeReason": "Trade",
"OrigOrderId": 6455,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_superuser",
"IsQuote": false,
"InsideAsk": 1.3636,
"InsideAskSize": 7530.65,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 1.3636,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Last",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
},
{
"Side": "Buy",
"OrderId": 6459,
"Price": 1.3638,
"Quantity": 18307.63,
"DisplayQuantity": 18307.63,
"Instrument": 9,
"Account": 7,
"AccountName": "sample_user",
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 1678263954878,
"ReceiveTimeTicks": 638138607548778980,
"LastUpdatedTime": 1678263954880,
"LastUpdatedTimeTicks": 638138607548795384,
"OrigQuantity": 18307.63,
"QuantityExecuted": 0.0,
"GrossValueExecuted": 0.0,
"ExecutableValue": 0.0,
"AvgPrice": 0.0,
"CounterPartyId": 0,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": 6455,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_superuser",
"IsQuote": false,
"InsideAsk": 1.3636,
"InsideAskSize": 7530.65,
"InsideBid": 0.0,
"InsideBidSize": 0.0,
"LastTradePrice": 1.3636,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Last",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
}
]
Returns the full history of a specific order or simply all the orderstates that the order went through. Response is an array of objects, each object represents the order itself in a specific orderstate.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each OMS. |
| Price | decimal. The price at which the buy or sell has been ordered. |
| Quantity | decimal. The quantity of the product to be bought or sold. |
| DisplayQuantity | decimal. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| Account | integer. ID of the of the account which the order belongs to. |
| AccountName | string. Name of the of the account which which the order belongs to. |
| OrderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current or the latest state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| LastUpdatedTime | long integer. Time stamp when the order was last updated, UNIX timestamp format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| LastUpdatedTimeTicks | long integer. Time stamp when the order was last updated, in Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | decimal. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | decimal. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| GrossValueExecuted | decimal. If the open order has been at least partially executed, this value shows the gross amount that has been executed. |
| ExecutableValue | decimal. Defaults to 0. |
| AvgPrice | decimal. The average executed price of the order. |
| CounterPartyId | integer. The ID of the account who is the counterparty for the trade if order is already executed, either partial or fully executed. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified. An order that is newly added to book will have NewInputAccepted value by default. |
| OrigOrderId | long integer. If the order is a replacement order, this is the ID of the original order. |
| OrigClOrdId | long integer. If the order is a replacement order, this is the client order ID or the original order. |
| EnteredBy | integer. The ID of the user who submitted the order. |
| Username | string. The username of the user who submitted the order. |
| IsQuote | boolean. If this order is a quote, the value for IsQuote is true, otherwise it is false. |
| InsideAsk | decimal. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | decimal. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | decimal. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | decimal. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | decimal. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancellation reason. |
| OrderFlag | string. One or more of: 1 NoAccountRiskCheck 2 AddedToBook 4 RemovedFromBook 8 PostOnly 16 Liquidation 32 ReverseMarginPosition |
| UseMargin | boolean. Margin is not yet supported so this always defaults to false. |
| StopPrice | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegPriceType | string. The type of price to peg the Stop to for Stop/Trailing orders. |
| PegOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegLimitOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| IpAddress | string. The IP address from where the order was submitted. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| OMSId | integer. The ID of the OMS. |
GetTickerHistory
Permissions: Public
Call Type: Synchronous
Requests a ticker history (high, low, open, close, volume, bid, ask, ID) of a specific instrument from the given FromDate up to the ToDate in the request payload. You will need to format the returned data per your requirements.
Because permission is Public, any user can retrieve the ticker history for any instrument on the OMS.
Request
POST /GetTickerHistory HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 117
{
"InstrumentId": 1,
"Interval": 60,
"FromDate": "2023-01-18 01:02:03",
"ToDate": "2023-08-31 23:59:59",
"OMSId": 1
}
| Key | Value |
|---|---|
| InstrumentId | integer. The ID of a specific instrument. required. |
| Interval | integer. The time between ticks, in seconds. For example, a value of 60 returns ticker array elements between FromDate to ToDate in 60-second increments. required. |
| FromDate | string. Oldest date from which the ticker history will start; in DateTime format. If hour:minutes:seconds is not defined, it defaults to 00:00:00. required. |
| ToDate | string. Most recent date, at which the ticker history will end; in DateTime format. If hour:minutes:seconds is not defined, it defaults to 00:00:00. required. |
| OMSId | integer. The ID of the OMS. required. |
Response
The response is an array of arrays of comma-separated, but unlabeled, numbers. This sample shows comments applied to identify the data being returned (comments are not part of the response:
[
[
1692926460000, //EndDateTime
28432.44, //High
28432.44, //Low
28432.44, //Open
28432.44, //Close
0, //Volume
0, //Best Bid
0, //Best Ask
1, //InstrumentId
1692926400000 //BeginDateTime
]
];
Returns an array of arrays dating from the FromDate value of the request to the ToDate. The data are returned oldest-date first. The data returned in the arrays are not labeled.
| Key | Value |
|---|---|
| EndDateTime | long integer. The end/closing date and time of the ticker, in UTC and POSIX format. |
| High | decimal. The Highest Trade Price for the Time-Period ( 0 if no trades ). |
| Low | decimal. The Lowest Trade Price for the Time-Period ( 0 if no trades ). |
| Open | decimal. The Opening Trade Price for the Time-Period ( 0 if no trades ). |
| Close | decimal. The Last Trade Price for the Time-Period ( 0 if no trades ). |
| Volume | decimal. The Total Trade Volume since the last Tick. |
| Bid | decimal. The best bid price at the time of the Tick. |
| Ask | decimal. The best ask price at the time of the Tick. |
| InstrumentId | integer. The ID of the instrument. |
| BeginDateTime | long integer. The start/opening date and time of the ticker, in UTC and POSIX format. |
GetLastTrades
Permissions: Public, Trading
Call Type: Synchronous
Gets the trades that happened for a specific instrument, parameter Count can be set to limit the results, number of results defaults to 100 if not defined.
Request
POST /GetLastTrades HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 48
//Get all trades for instrument id 1
{
"OMSId": 1,
"InstrumentId": 1
}
//Get the 10 most recent trades for instrumentid 1
{
"OMSId": 1,
"InstrumentId": 1,
"Count": 10
}
| Key | Value |
|---|---|
| InstrumentId | The id of the instrument, symbol is not accepted.If you don't specify this, response will have the current timestamp which is not valid. required. |
| OMSId | ID of the OMS where the pair or instrument is being traded. required. |
| Count | Value represents the number of trades you want to get, value of 10 will return 10 most recent trades. If not set, 100 most recent trades for the instrument will be included in the results. optional. |
Response
[
[14, 2, 0.02, 1970, 5922, 5923, 1675332676849, 1, 0, 0, 0],
[15, 2, 0.98, 1970, 5922, 6012, 1676397856371, 0, 0, 0, 0],
];
Returns an object with multiple arrays as a response, each array represents 1 trade.
| Key | Value |
|---|---|
| 0 (TradeId) | integer. The ID of this trade. |
| 1 (InstrumentId) | integer. The ID of the instrument. |
| 2 (Quantity) | decimal. The quantity of the instrument traded. |
| 3 (Price) | decimal. The price at which the instrument was traded. |
| 4 (Order1) | integer. The ID of the first order that resulted in the trade, either Buy or Sell. |
| 5 (Order2) | integer. The ID of the second order that resulted in the trade, either Buy or Sell. |
| 6 (Tradetime) | long integer. UTC trade time in Total Milliseconds. POSIX format. |
| 7 (Direction) | integer. Effect of the trade on the instrument’s market price. One of: 0 NoChange 1 UpTick 2 DownTick |
| 8 (TakerSide) | integer. Which side of the trade took liquidity? One of: 0 Buy 1 Sell The maker side of the trade provides liquidity by placing the order on the book (this can be a buy or a sell order). The other, taker, side takes the liquidity. It, too, can be buy-side or sell-side. |
| 9 (BlockTrade) | boolean. Was this a privately negotiated trade that was reported to the OMS? A private trade returns 1 (true); otherwise 0 (false). Default is false. Block trades are not supported in exchange version 3.1 |
| 10 (order1ClientId or order2ClientId) | integer. The client-supplied order ID for the trade. Internal logic determines whether the program reports the order1ClientId or the order2ClientId. |
GetLevel1Summary
Permissions: Trading, Public
Call Type: Synchronous
Provides a current Level 1 snapshot (best bid, best offer and other data such lasttradedprice) of all instruments trading on an OMS.
Request
POST /GetLevel1Summary HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 27
{
"OMSId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
Response
[
"{ \"OMSId\":1, \"InstrumentId\":1, \"BestBid\":30000, \"BestOffer\":32000, \"LastTradedPx\":29354.89, \"LastTradedQty\":0.2563, \"LastTradeTime\":1690773094972, \"SessionOpen\":0, \"SessionHigh\":0, \"SessionLow\":0, \"SessionClose\":29354.89, \"Volume\":0.2563, \"CurrentDayVolume\":0, \"CurrentDayNotional\":0, \"CurrentDayNumTrades\":0, \"CurrentDayPxChange\":0, \"Rolling24HrVolume\":0.00, \"Rolling24HrNotional\":0.00, \"Rolling24NumTrades\":0, \"Rolling24HrPxChange\":0, \"TimeStamp\":\"1690782922150\", \"BidQty\":1, \"AskQty\":1, \"BidOrderCt\":0, \"AskOrderCt\":0, \"Rolling24HrPxChangePercent\":0 }",
"{ \"OMSId\":1, \"InstrumentId\":2, \"BestBid\":0, \"BestOffer\":0, \"LastTradedPx\":2500, \"LastTradedQty\":1, \"LastTradeTime\":1689087260408, \"SessionOpen\":0, \"SessionHigh\":0, \"SessionLow\":0, \"SessionClose\":2500, \"Volume\":1, \"CurrentDayVolume\":0, \"CurrentDayNotional\":0, \"CurrentDayNumTrades\":0, \"CurrentDayPxChange\":0, \"Rolling24HrVolume\":0.0000, \"Rolling24HrNotional\":0.0000, \"Rolling24NumTrades\":0, \"Rolling24HrPxChange\":0, \"TimeStamp\":\"1690782922150\", \"BidQty\":0, \"AskQty\":0, \"BidOrderCt\":0, \"AskOrderCt\":0, \"Rolling24HrPxChangePercent\":0 }",
"{ \"OMSId\":1, \"InstrumentId\":3, \"BestBid\":0, \"BestOffer\":0, \"LastTradedPx\":9.66, \"LastTradedQty\":0.001, \"LastTradeTime\":1656645761755, \"SessionOpen\":0, \"SessionHigh\":0, \"SessionLow\":0, \"SessionClose\":9.66, \"Volume\":0.001, \"CurrentDayVolume\":0, \"CurrentDayNotional\":0, \"CurrentDayNumTrades\":0, \"CurrentDayPxChange\":0, \"Rolling24HrVolume\":0.000, \"Rolling24HrNotional\":0.00000, \"Rolling24NumTrades\":0, \"Rolling24HrPxChange\":0, \"TimeStamp\":\"1690782921869\", \"BidQty\":0, \"AskQty\":0, \"BidOrderCt\":0, \"AskOrderCt\":0, \"Rolling24HrPxChangePercent\":0 }"
]
Returns an array with multiple objects, each object represents the Level1 data of a specific instrument.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. |
| InstrumentId | integer. The ID of the instrument being tracked. |
| BestBid | decimal. The current best bid for the instrument. |
| BestOffer | decimal. The current best offer for the instrument. |
| LastTradedPx | decimal. The last-traded price for the instrument. |
| LastTradedQty | decimal. The last-traded quantity for the instrument. |
| LastTradeTime | long integer. The time of the last trade, in POSIX format. |
| SessionOpen | decimal. Opening price. In markets with openings and closings, this is the opening price for the current session; in 24-hour markets, it is the price as of UTC Midnight. |
| SessionHigh | decimal. Highest price during the trading day, either during a session with opening and closing prices or UTC midnight to UTC midnight. |
| SessionLow | decimal. Lowest price during the trading day, either during a session with opening and closing prices or UTC midnight to UTC midnight. |
| SessionClose | decimal. The closing price. In markets with openings and closings, this is the closing price for the current session; in 24-hour markets, it is the price as of UTC Midnight. |
| Volume | decimal. The last-traded quantity for the instrument, same value as LastTradedQty |
| CurrentDayVolume | decimal. The unit volume of the instrument traded either during a session with openings and closings or in 24-hour markets, the period from UTC Midnight to UTC Midnight. |
| CurrentDayNumTrades | integer. The number of trades during the current day, either during a session with openings and closings or in 24-hour markets, the period from UTC Midnight to UTC Midnight. |
| CurrentDayPxChange | decimal. Current day price change, either during a trading session or UTC Midnight to UTC midnight. |
| CurrentNotional | decimal. Current day quote volume - resets at UTC Midnight. |
| Rolling24HrNotional | decimal. Rolling 24 hours quote volume. |
| Rolling24HrVolume | decimal. Unit volume(quantity traded, in the product 1 or in the base currency denomination) of the instrument during the past 24 hours, regardless of time zone. Recalculates continuously. |
| Rolling24HrNumTrades | integer. Number of trades during the past 24 hours, regardless of time zone. Recalculates continuously. |
| Rolling24HrPxChange | decimal. Price change during the past 24 hours, regardless of time zone. Recalculates continuously. |
| TimeStamp | string. The time this information was provided, in POSIX format. |
| BidQty | decimal. The quantity currently being bid. |
| AskQty | decimal. The quantity currently being asked. |
| BidOrderCt | integer. The count of bid orders. |
| AskOrderCt | integer. The count of ask orders. |
| Rolling24HrPxChangePercent | decimal. Percent change in price during the past 24hours regardless of the timezone. Recalculates continuously. |
GetLevel1SummaryMin
Permissions: Trading, Public
Call Type: Synchronous
Retrieves the latest Level 1 Snapshot of all markets/instruments. Snapshot includes LastTradedPx, Rolling24HrPxChange, Rolling24HrPxChangePercent, Rolling24HrVolume. Can also be filtered according to instrument ids.
Request
POST /GetLevel1SummaryMin HTTP/1.1
Host: cexapi.wayex.com
aptoken: 11882457-4c83-4d7a-a932-890ec3ac5aa2
Content-Type: application/json
Content-Length: 48
{
"OMSId": 1,
"InstrumentIds":"[1]"
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| InstrumentIds | string. An array but will be passed as a string. List of instrument ids to get level1 summary of. If this field is not specified, level1 summary of all instruments will be returned. optional. |
Response
[
[
1, //InstrumentId
"BTCAUD", //Instrument symbol
29900, //LastTradedPx
-1100, //Rolling24HrPxChange
-3.5483870967741935483870967700, //Rolling24HrPxChangePercent
0.0021 //Rolling24HrVolume
],
[
2,
"ETHAUD",
20030,
0,
0,
0.0000
]
]
| Key | Value |
|---|---|
| InstrumentId | integer. The ID of the instrument. |
| InstrumentSymbol | string. The symbol of the instrument. |
| LastTradedPX | decimal. The last-traded price for the instrument. |
| Rolling24HrVolume | decimal. Unit volume(quantity traded, in the product 1 or in the base currency denomination) of the instrument during the past 24 hours, regardless of time zone. Recalculates continuously. |
| Rolling24HrPxChange | decimal. Change in price during the past 24 hours regardless of the timezone. Recalculates continuously. |
| Rolling24HrPxChangePercent | decimal. Percent change in price during the past 24 hours regardless of the timezone. Recalculates continuously. |
GetOpenTradeReports
Permissions: Operator,Trading,AccountReadOnly,Manual Trader
Call Type: Synchronous
Retrieves the Open Trade Reports(block trades), for the given accountId. ReceiveTime in POSIX format X 1000 (milliseconds since 1 January 1970)
Request
POST /GetOpenTradeReports HTTP/1.1
Host: cexapi.wayex.com
aptoken: cf165646-2021-4460-9fc4-234e0cec454b
Content-Type: application/json
Content-Length: 41
{
"OMSId": 1,
"AccountId": 9
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| AccountId | integer. The ID of the account whose open blocktrade/s will be retrieved. required. |
Response
[
{
"Side": "Buy",
"OrderId": 6723,
"Price": 29500,
"Quantity": 0.2563,
"DisplayQuantity": 0.2563,
"Instrument": 1,
"Account": 9,
"AccountName": "AnotherName",
"OrderType": "BlockTrade",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 1683190853154,
"ReceiveTimeTicks": 638187876531538042,
"LastUpdatedTime": 1683190853159,
"LastUpdatedTimeTicks": 638187876531592832,
"OrigQuantity": 0.2563,
"QuantityExecuted": 0,
"GrossValueExecuted": 0,
"ExecutableValue": 0,
"AvgPrice": 0,
"CounterPartyId": 7,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": 6723,
"OrigClOrdId": 0,
"EnteredBy": 1,
"UserName": "admin",
"IsQuote": false,
"InsideAsk": 31000,
"InsideAskSize": 0.5,
"InsideBid": 30000,
"InsideBidSize": 0.5,
"LastTradePrice": 30500,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 0,
"PegPriceType": "Last",
"PegOffset": 0,
"PegLimitOffset": 0,
"IpAddress": null,
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
}
]
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each OMS. |
| Price | decimal. The price at which the buy or sell has been ordered. |
| Quantity | decimal. The quantity of the product to be bought or sold. |
| DisplayQuantity | decimal. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| Account | integer. ID of the of the account which submitted the order. |
| AccountName | string. Name of the of the account which submitted the order. |
| OrderType | string. Will always be BlockTrade as this GetOpenTradeReports API will only return open blocktrades. |
| ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 FullyExecuted. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | decimal. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | decimal. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| GrossValueExecuted | decimal. If the open order has been at least partially executed, this value shows the gross amount that has been executed. |
| AvgPrice | decimal. The average executed price of the order. |
| CounterPartyId | integer. The ID of the account who will be the counter party of the blocktrade. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified |
| OrigOrderId | integer. If the order has been changed, this is the ID of the original order. |
| OrigClOrdId | integer. If the order has been changed, this is the ID of the original client order ID. |
| EnteredBy | integer. The ID of the user who submitted the order. |
| Username | integer. The username of the user who submitted the order. |
| IsQuote | boolean. If this order is a quote(created using CreateQuote API), the value for IsQuote is true, else false. |
| InsideAsk | decimal. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | decimal. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | decimal. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | decimal. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | decimal. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancellation reason. |
| UseMargin | boolean. Margin is not yet supported so this always defaults to false. |
| StopPrice | decimal. Not applicable for an order resulting from SubmitBlockTrade |
| PegPriceType | string. Not applicable for an order resulting from SubmitBlockTrade |
| PegOffset | decimal. Not applicable for an order resulting from SubmitBlockTrade |
| PegLimitOffset | decimal. Not applicable for an order resulting from SubmitBlockTrade |
| IpAddress | string. The IP address from where the order was submitted. |
| OMSId | integer. The ID of the OMS. |
GetOrders
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves a list of the latest states of orders for an account. ReceiveTime in POSIX format X 1000 (milliseconds since 1 January 1970).
Results can also be filtered according to different search parameters such as OrderState, InstrumentId, OrderId etc. This API functions just like GetOrdersHistory
A user with Trading permission can retrieve orders only for accounts is associated with; a user with Operator permission can retrieve orders for any account.
Request
POST /GetOrders HTTP/1.1
Host: cexapi.wayex.com
aptoken: c5f917b9-f173-4c29-a615-1503d2e78023 //valid sessiontoken
Content-Type: application/json
Content-Length: 41
{
"OMSId": 1,
"AccountId": 7
}
| Key | Value |
|---|---|
| OMSId | Integer. The ID of the OMS on which the orders took place. If no other values are specified, the call returns the orders associated with the default account for the logged-in user on this OMS. required. |
| AccountId | Integer. The account ID that made the trades. A user with Trading permission must be associated with this account, although other users also can be associated with the account. required. |
| OrderState | string. The current state of the order. Can be used to filter results. If not specified all orders regardless of the order state will be returned. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 FullyExecuted. optional. |
| OrderId | long integer. ID for the order.Can be used to filter results. Can be used to filter for a specific orderid. There is a specific API call GetOrderHistoryByOrderId for filtering orders by OrderId. optional. |
| ClientOrderId | long integer. A user-assigned ID for the order (like a purchase-order number assigned by a company).Can be used to filter results. clientOrderId defaults to 0. optional. |
| OriginalOrderId | long integer. The original ID of the order. If specified, the call returns changed orders associated with this order ID. Can be used to filter results. optional. |
| OriginalClientOrderId | long integer. If the order has been changed, shows the original client order ID, a value that the client can create (much like a purchase order). Can be used to filter results. optional. |
| UserId | integer. The ID of the user whose account orders will be returned. If not specified, the call returns the orders of the logged-in user.Can be used to filter results. optional. |
| InstrumentId | long integer. The ID of the instrument named in the order. If not specified, the call returns orders for all instruments traded by this account. Can be used to filter results. optional. |
| StartTimestamp | long integer. Date and time at which to begin the orders history, in POSIX format. Can be used to filter results. optional. |
| EndTimestamp | long integer. Date and time at which to end the orders report, in POSIX format. Can be used to filter results. optional. |
| Depth | integer. In this case, the maximum number/count of orders to return, counting from the StartIndex if it is also specified. If not specified, returns all orders from the most recent to oldest; results can vary depending if other optional fields are defined such as StartIndex, StartTimestamp, and EndTimestamp. Can be used to filter results and for pagination. optional. |
| Limit | integer. Functions exactly the same as the Depth field. optional. |
| StartIndex | integer. A value of 0 means the first object in the result will be the the most recent order, a value of 2 means that the first object in the result set will be the third most recent order. If not specified, defaults to 0. Can be used to filter results or for pagination. optional. |
Response
[
{
"Side": "Sell",
"OrderId": 6713,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 11,
"Account": 7,
"AccountName": "sample",
"OrderType": "Market",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1682663431785,
"ReceiveTimeTicks": 638182602317851821,
"LastUpdatedTime": 1682663431791,
"LastUpdatedTimeTicks": 638182602317910891,
"OrigQuantity": 0.01,
"QuantityExecuted": 0.01,
"GrossValueExecuted": 60.0,
"ExecutableValue": 0.0,
"AvgPrice": 6000.0,
"CounterPartyId": 0,
"ChangeReason": "Trade",
"OrigOrderId": 6713,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_user",
"IsQuote": false,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"InsideBid": 6000.0,
"InsideBidSize": 0.01,
"LastTradePrice": 6000.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Bid",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
},
{
"Side": "Sell",
"OrderId": 6709,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 11,
"Account": 7,
"AccountName": "sample",
"OrderType": "Market",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1682663089848,
"ReceiveTimeTicks": 638182598898484597,
"LastUpdatedTime": 1682663089923,
"LastUpdatedTimeTicks": 638182598899230197,
"OrigQuantity": 0.01,
"QuantityExecuted": 0.01,
"GrossValueExecuted": 60.0,
"ExecutableValue": 0.0,
"AvgPrice": 6000.0,
"CounterPartyId": 0,
"ChangeReason": "Trade",
"OrigOrderId": 6709,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_user",
"IsQuote": false,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"InsideBid": 6000.0,
"InsideBidSize": 0.01,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Bid",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
}
]
Returns an array of objects, each object represents an order. The call returns an empty array if there are no orders for the account.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each OMS. |
| Price | decimal. The price at which the buy or sell has been ordered. |
| Quantity | decimal. The quantity of the product to be bought or sold. |
| DisplayQuantity | decimal. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| Account | integer. ID of the of the account which the order belongs to. |
| AccountName | string. Name of the of the account which which the order belongs to. |
| OrderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current or the latest state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| LastUpdatedTime | long integer. Time stamp when the order was last updated, in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| LastUpdatedTimeTicks | long integer. Time stamp when the order was last updated, in Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | decimal. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | decimal. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| GrossValueExecuted | decimal. If the open order has been at least partially executed, this value shows the gross amount that has been executed. |
| ExecutableValue | decimal. Defaults to 0. |
| AvgPrice | decimal. The average executed price of the order. |
| CounterPartyId | integer. The ID of the account who is the counterparty for the trade if order is already executed, either partial or fully executed. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified. An order that is newly added to book will have NewInputAccepted value by default. |
| OrigOrderId | long integer. If the order is a replacement order, this is the ID of the original order. |
| OrigClOrdId | long integer. If the order is a replacement order, this is the client order ID or the original order. |
| EnteredBy | integer. The ID of the user who submitted the order. |
| Username | string. The username of the user who submitted the order. |
| IsQuote | boolean. If this order is a quote, the value for IsQuote is true, otherwise it is false. |
| InsideAsk | decimal. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | decimal. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | decimal. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | decimal. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | decimal. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancellation reason. |
| OrderFlag | string. One or more of: 1 NoAccountRiskCheck 2 AddedToBook 4 RemovedFromBook 8 PostOnly 16 Liquidation 32 ReverseMarginPosition |
| UseMargin | boolean. Margin is not yet supported so this always defaults to false. |
| StopPrice | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegPriceType | string. The type of price to peg the Stop to for Stop/Trailing orders. |
| PegOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegLimitOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| IpAddress | string. The IP address from where the order was submitted. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| OMSId | integer. The ID of the OMS. |
GetOrderHistory
Permissions: Operator, Trading
Call Type: Synchronous
Retrieves a history of orders for the specified search parameters.
For example, if depth = 200 and startIndex = 0, the history returns 200 unique orders into the past starting with the most recent (0) order. If depth = 200 and startIndex = 100, the history returns 200 unique orders into the past starting at 101st order in the past.
The owner of the trading venue determines how long to retain order history before archiving.
A user with Trading permission can retrieve orders history only for accounts it is associated with; a user with Operator permission can retrieve orders history for any user or account.
Request
POST /GetOrderHistory HTTP/1.1
Host: cexapi.wayex.com
aptoken: c5f917b9-f173-4c29-a615-1503d2e78023 //valid sessiontoken
Content-Type: application/json
Content-Length: 41
{
"OMSId": 1,
"AccountId": 7
}
| Key | Value |
|---|---|
| OMSId | Integer. The ID of the OMS on which the orders took place. If no other values are specified, the call returns the orders associated with the default account for the logged-in user on this OMS. required. |
| AccountId | Integer. The account ID that made the trades. A user with Trading permission must be associated with this account, although other users also can be associated with the account. required. |
| OrderState | string. The current state of the order. Can be used to filter results. If not specified all orders regardless of the order state will be returned. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 FullyExecuted. optional. |
| OrderId | long integer. ID for the order.Can be used to filter results. Can be used to filter for a specific orderid. There is a specific API call GetOrderHistoryByOrderId for filtering orders by OrderId. optional. |
| ClientOrderId | long integer. A user-assigned ID for the order (like a purchase-order number assigned by a company).Can be used to filter results. clientOrderId defaults to 0. optional. |
| OriginalOrderId | long integer. The original ID of the order. If specified, the call returns changed orders associated with this order ID. Can be used to filter results. optional. |
| OriginalClientOrderId | long integer. If the order has been changed, shows the original client order ID, a value that the client can create (much like a purchase order). Can be used to filter results. optional. |
| UserId | integer. The ID of the user whose account orders will be returned. If not specified, the call returns the orders of the logged-in user.Can be used to filter results. optional. |
| InstrumentId | long integer. The ID of the instrument named in the order. If not specified, the call returns orders for all instruments traded by this account. Can be used to filter results. optional. |
| StartTimestamp | long integer. Date and time at which to begin the orders history, in POSIX format. Can be used to filter results. optional. |
| EndTimestamp | long integer. Date and time at which to end the orders report, in POSIX format. Can be used to filter results. optional. |
| Depth | integer. In this case, the maximum number/count of orders to return, counting from the StartIndex if it is also specified. If not specified, returns 100 most recent orders; results can vary depending if other optional fields are defined such as StartIndex, StartTimestamp, and EndTimestamp. Can be used to filter results and for pagination. optional. |
| Limit | integer. Functions exactly the same as the Depth field. optional. |
| StartIndex | integer. A value of 0 means the first object in the result will be the the most recent order, a value of 2 means that the first object in the result set will be the third most recent order. If not specified, defaults to 0. Can be used to filter results or for pagination. optional. |
Response
[
{
"Side": "Sell",
"OrderId": 6713,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 11,
"Account": 7,
"AccountName": "sample",
"OrderType": "Market",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1682663431785,
"ReceiveTimeTicks": 638182602317851821,
"LastUpdatedTime": 1682663431791,
"LastUpdatedTimeTicks": 638182602317910891,
"OrigQuantity": 0.01,
"QuantityExecuted": 0.01,
"GrossValueExecuted": 60.0,
"ExecutableValue": 0.0,
"AvgPrice": 6000.0,
"CounterPartyId": 0,
"ChangeReason": "Trade",
"OrigOrderId": 6713,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_user",
"IsQuote": false,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"InsideBid": 6000.0,
"InsideBidSize": 0.01,
"LastTradePrice": 6000.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Bid",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
},
{
"Side": "Sell",
"OrderId": 6709,
"Price": 0.0,
"Quantity": 0.0,
"DisplayQuantity": 0.0,
"Instrument": 11,
"Account": 7,
"AccountName": "sample",
"OrderType": "Market",
"ClientOrderId": 0,
"OrderState": "FullyExecuted",
"ReceiveTime": 1682663089848,
"ReceiveTimeTicks": 638182598898484597,
"LastUpdatedTime": 1682663089923,
"LastUpdatedTimeTicks": 638182598899230197,
"OrigQuantity": 0.01,
"QuantityExecuted": 0.01,
"GrossValueExecuted": 60.0,
"ExecutableValue": 0.0,
"AvgPrice": 6000.0,
"CounterPartyId": 0,
"ChangeReason": "Trade",
"OrigOrderId": 6709,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_user",
"IsQuote": false,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"InsideBid": 6000.0,
"InsideBidSize": 0.01,
"LastTradePrice": 0.0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 0.0,
"PegPriceType": "Bid",
"PegOffset": 0.0,
"PegLimitOffset": 0.0,
"IpAddress": "69.10.61.175",
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
}
]
The call GetOrderHistory returns an array or objects, each object representin an order at its latest status; an order will only occupy 1 index or just 1 instance in the result. GetOrderHistory API does not return the full history of a specific order, there is another API that will give you just that: GetOrderHistoryByOrderId.
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each OMS. |
| Price | decimal. The price at which the buy or sell has been ordered. |
| Quantity | decimal. The quantity of the product to be bought or sold. |
| DisplayQuantity | decimal. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| Account | integer. ID of the of the account which the order belongs to. |
| AccountName | string. Name of the of the account which which the order belongs to. |
| OrderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current or the latest state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| LastUpdatedTime | long integer. Time stamp when the order was last updated, in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| LastUpdatedTimeTicks | long integer. Time stamp when the order was last updated, in Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | decimal. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | decimal. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| GrossValueExecuted | decimal. If the open order has been at least partially executed, this value shows the gross amount that has been executed. |
| ExecutableValue | decimal. Defaults to 0. |
| AvgPrice | decimal. The average executed price of the order. |
| CounterPartyId | integer. The ID of the account who is the counterparty for the trade if order is already executed, either partial or fully executed. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified. An order that is newly added to book will have NewInputAccepted value by default. |
| OrigOrderId | long integer. If the order is a replacement order, this is the ID of the original order. |
| OrigClOrdId | long integer. If the order is a replacement order, this is the client order ID or the original order. |
| EnteredBy | integer. The ID of the user who submitted the order. |
| Username | string. The username of the user who submitted the order. |
| IsQuote | boolean. If this order is a quote, the value for IsQuote is true, otherwise it is false. |
| InsideAsk | decimal. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | decimal. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | decimal. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | decimal. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | decimal. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancellation reason. |
| OrderFlag | string. One or more of: 1 NoAccountRiskCheck 2 AddedToBook 4 RemovedFromBook 8 PostOnly 16 Liquidation 32 ReverseMarginPosition |
| UseMargin | boolean. Margin is not yet supported so this always defaults to false. |
| StopPrice | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegPriceType | string. The type of price to peg the Stop to for Stop/Trailing orders. |
| PegOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegLimitOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| IpAddress | string. The IP address from where the order was submitted. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| OMSId | integer. The ID of the OMS. |
SendOrder
Permissions: Operator, Trading
Call Type: Asynchronous
Creates an order.
Anyone submitting an order should also subscribe to the various market data and event feeds, or call GetOpenOrders or GetOrderStatus to monitor the status of the order. If the order is not in a state to be executed, GetOpenOrders will not return it.
A user with Trading permission can create an order only for those accounts and instruments with which the user is associated; a user with elevated permission such as Operator can create/send an order for any account and instrument.
Request
POST /SendOrder HTTP/1.1
Host: cexapi.wayex.com
aptoken: 604f9459-163f-4114-8ecc-928597554747
Content-Type: application/json
Content-Length: 252
//Limit order
{
"InstrumentId": 9,
"OMSId": 1,
"AccountId": 9,
"TimeInForce": 1,
"ClientOrderId": 0,
"OrderIdOCO": 0,
"UseDisplayQuantity": false,
"Side": 0,
"Quantity": 1,
"OrderType": 2,
"PegPriceType": 3,
"LimitPrice": 31000,
}
//Market order
{
"InstrumentId": 9,
"OMSId": 1,
"AccountId": 9,
"TimeInForce": 1,
"ClientOrderId": 0,
"OrderIdOCO": 0,
"UseDisplayQuantity": false,
"Side": 0,
"OrderType": 1,
"PegPriceType": 3,
"Quantity": 0.5,
}
//Order by value: In a market order, a user can opt to input total value of the trade instead of putting the quantity which will then be automatically calculated: value/marketprice.
{
"InstrumentId": 9,
"OMSId": 1,
"AccountId": 9,
"TimeInForce": 1,
"ClientOrderId": 0,
"OrderIdOCO": 0,
"UseDisplayQuantity": false,
"Side": 0,
"OrderType": 1,
"PegPriceType": 3,
"Value": 10,
}
If OrderType=1 (Market), Side=0 (Buy), and LimitPrice is supplied, the Market order will execute up to the value specified
| Key | Value |
|---|---|
| InstrumentId | integer. The ID of the instrument being traded. required. |
| OMSId | integer. The ID of the OMS where the instrument is being traded. |
| AccountId | integer. The ID of the account the order will be placed for. required. |
| TimeInForce | integer. An integer that represents the period during which the new order is executable. One of: 0 Unknown (error condition) 1 GTC (good 'til canceled, the default) 2 OPG (execute as close to opening price as possible: not yet used, for future provision) 3 IOC (immediate or canceled) 4 FOK (fill-or-kill — fill immediately or kill immediately) 5 GTX (good 'til executed: not yet used, for future provision) 6 GTD (good 'til date: not yet used, for future provision) required. |
| ClientOrderId | long integer. A user-assigned ID for the order (like a purchase-order number assigned by a company). This ID is useful for recognizing future states related to this order. ClientOrderId defaults to 0. Duplicate client orderid of two open orders of the same account is not allowed, the incoming order with the same clientorderid will get rejected.optional. |
| OrderIdOCO | long integer. The order ID if One Cancels the Other — If this order is order A, OrderIdOCO refers to the order ID of an order B (which is not the order being created by this call). If order B executes, then order A created by this call is canceled. You can also set up order B to watch order A in the same way, but that may require an update to order B to make it watch this one, which could have implications for priority in the order book. See CancelReplaceOrder and ModifyOrder.. optional. |
| UseDisplayQuantity | boolean. If you enter a Limit order with a reserve(reserve order), you must set UseDisplayQuantity to true else, the quantity of your order will be 0, defaults to false. optional. |
| Side | integer. A number representing on of the following potential sides of a trade. One of: 0 Buy 1 Sell required. |
| Quantity | decimal. The quantity of the instrument being ordered. Not required if OrderType is Market(1) and as long as Value is defined. conditionally required. |
| OrderType | integer. A number representing the nature of the order. One of: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade. required. |
| PegPriceType | integer. Only applicable to TrailingStop and Stop orders, integer or a string that corresponds to the type of price that pegs the stop: 1 Last 2 Bid 3 Ask 4 Midpoint(Currently unsupported; for future provision) Defaults to Last(1) if not defined. optional. |
| LimitPrice | decimal. The price at which the order will be placed, applicable and required if OrderType is Limit(2) or StopLimit(4) or TrailingStopLimit(7). conditionally required. |
| StopPrice | decimal. Applicable to TrailingStop(Limit and Market) and Stop(Limit and Market) orders only; the price at which the order will get activated. Defaults to 0 if not defined. Is not required to be defined for TrailingStop order as this price will be determined automatically based on the TrailingAmount, PegPriceType and most importantly the movement of the price where the order is pegged(PegPriceType). conditionally required. |
| TrailingAmount | decimal. Applicable to TrailingStopLimit and TrailingStopMarket orders only; a number that will be either added to(buy side) or subtracted from(sell side) the price where the order is pegged(depends on the PegPriceType); the sum or the difference will be the StopPrice of the TrailingStop order. On the buy side, if the price where the order is pegged increases and never goes down below the value when the order was placed, the resulting StopPrice will be the sum of the price where the order is pegged during submission and the TrailingAmount; however, if the price where the order is pegged decreases, the StopPrice will change, it will be the sum of the whatever is the lowest value the pegged price will have and the TrailingAmount: the logic on the sell side is the opposite. conditionally required. |
| LimitOffset | decimal. Applicable to TrailingStopLimit only; a number that will be either added(buy side) or subtracted(sell side) to the StopPrice, the sum or the difference will be the LimitPrice of the order when it gets activated. conditionally required. |
| DisplayQuantity | integer If UseDisplayQuantity is set to true, you must set a value of this field greater than 0, else, order will not appear in the orderbook.optional. |
| Value | decimal The total value of the trade. Only applicable in a market order type: a user can opt to input a value instead of defining the quantity which will then be automatically calculated: value/marketprice.optional. |
Response
{
"status": "Accepted",
"errormsg": "",
"OrderId": 6500
}
//Possible error messages
//Order is rejected due to lack of funds
{
"status": "Rejected",
"errormsg": "Not_Enough_Funds",
"errorcode": 101
}
//Order is rejected due to duplicate Client_OrderId, it means that the order you are sending has the same Client_OrderId with your other working/open order.
{
"status": "Rejected",
"errormsg": "Invalid_ClientOrderId",
"errorcode": 101
}
| Key | Value |
|---|---|
| status | string. If the order is accepted by the system, it returns "Accepted," if not it returns "Rejected." Accepted Rejected |
| errormsg | string. Any error message the server returns. |
| OrderId | long integer. The ID assigned to the order by the server. This allows you to track the order. |
CancelReplaceOrder
Permissions: Operator,Trading
Call Type: Asynchronous
CancelReplaceOrder is a single API call that both cancels an existing order and replaces it with a new order. Canceling one order and replacing it with another also cancels the order’s priority in the order book. You can use ModifyOrder to preserve priority in the book but it only allows a reduction in order quantity.
Request
POST /CancelReplaceOrder HTTP/1.1
Host: cexapi.wayex.com
aptoken: 604f9459-163f-4114-8ecc-928597554747
Content-Type: application/json
Content-Length: 252
//Limit order to replace OrderId 123456
{
"OMSId":1,
"OrderIdToReplace":123456,
"ClientOrdId":0,
"OrderType":"Limit",
"Side":"Buy",
"AccountId":20,
"InstrumentId":9,
"LimitPrice":1.363,
"TimeInForce":1,
"Quantity":7322.24
}
//StopMarket order to replace OrderId 123456
{
"OMSId":1,
"OrderIdToReplace":123456,
"ClientOrdId":0,
"OrderType":"StopMarket",
"Side":"Buy",
"AccountId":20,
"InstrumentId":9,
"StopPrice":1.363,
"TimeInForce":1,
"Quantity":7322.24
}
//Different OrderTypes available
"OrderType": {
"Options": [
"Unknown",
"Market",
"Limit",
"StopMarket",
"StopLimit",
"TrailingStopMarket",
"TrailingStopLimit",
"BlockTrade"
]
},
//Different Sides available
"Side": {
"Options": [
"Buy",
"Sell",
"Short",
"Unknown"
]
},
//Different PegPriceTypes available
"PegPriceType": {
"Options": [
"Unknown",
"Last",
"Bid",
"Ask",
"Midpoint"
]
},
//Different TimeInForce available
"TimeInForce": {
"Options": [
"Unknown",
"GTC",
"OPG",
"IOC",
"FOK",
"GTX",
"GTD"
]
},
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS on which the order is being canceled and replaced by another order. required. |
| OrderIdToReplace | long integer. The ID of the order to replace with this order. required. |
| ClientOrderId | long integer. A user-assigned ID for the new, replacement order (like a purchase-order number assigned by a company). This ID is useful for recognizing future states related to this order. If unspecified, ClientOrderId defaults to 0. optional. |
| OrderType | string or integer. The type of the replacement order. One of: 0 Unknown 1 Market 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade The string value or the equivalent integer value can be used. required. |
| Side | string or integer. The side of the replacement order. One of: 0 Buy 1 Sell 2 Short(reserved for future use) 3 Unknown (error condition). The string value or the equivalent integer value can be used. required. |
| AccountId | integer. The ID of the account under which the original order was placed and the new order will be placed. If AccountId will not match the one on the order to be replaced, request will fail. required. |
| InstrumentId | integer. The ID of the instrument being traded. Must be identical with the instrument ID of the order to be replaced, else, request will fail. required. |
| UseDisplayQuantity | boolean. The display quantity is the quantity of a product shown to the market to buy or sell. A larger quantity may be wanted or available, but it may disadvantageous to display it when buying or selling. The display quantity is set when placing an order (using SendOrder or CancelReplaceOrder for instance). If you enter a Limit order with reserve, you must set useDisplayQuantity to true. conditionally required. |
| DisplayQuantity | decimal. The quantity of a product that is available to buy or sell that is publicly displayed to the market. Needs to be defined with a value greater than 0 if UseDisplayQuantity is set to true, otherwise new order will not be visible in the orderbook. conditionally required. |
| LimitPrice | deciaml. The price at which to execute the new order, if the new order is a limit order. conditionally required. |
| StopPrice | decimal. The price at which to execute the new order, if the order is a stop order. conditionally required. |
| ReferencePrice | decimal. The reference price of the instrument in the order. optional. |
| PegPriceType | string or integer. When entering a stop/trailing order, set PegPriceType to the type of price that pegs the stop. One of: 1 Last 2 Bid 3 Ask 4 Midpoint The string value or the equivalent integer value can be used. conditionally required. |
| TimeInForce | string or integer. The period during which the new order is executable. One of: 0 Unknown (error condition) 1 GTC (good 'til canceled, the default) 2 OPG (execute as close to opening price as possible: not yet used, for future provision) 3 IOC (immediate or canceled) 4 FOK (fill or kill — fill the order immediately, or cancel it immediately) 5 GTX (good 'til executed: not yet used, for future provision) 6 GTD (good 'til date: not yet used, for future provision) The string value or the equivalent integer value can be used. required. |
| OrderIdOCO | long integer. One Cancels the Other — If the order being canceled in this call is order A, and the order replacing order A in this call is order B, then OrderIdOCO refers to an order C that is currently open. If order C executes, then order B is canceled. You can also set up order C to watch order B in this way, but that will require an update to order C. optional. |
| Quantity | decimal. The amount of the order (either buy or sell). Not explicitly required but defaults to 0 when not defined, so it makes sense to be set greater than 0. required. |
Response
{
"ReplacementOrderId": 123457,
"ReplacementClOrdId": 0,
"OrigOrderId": 123456,
"OrigClOrdId": 0
}
The response returns the new replacement order ID and echoes back any replacement client ID you have supplied, along with the original order ID and the original client order ID.
| Key | Value |
|---|---|
| replacementOrderId | integer. The order ID assigned to the replacement order by the server. |
| replacementClOrdId | long integer. Echoes the contents of the clientOrderId value from the request. |
| origOrderId | integer. Echoes orderIdToReplace, which is the original order you are replacing. |
| origClOrdId | long integer. Provides the client order ID of the original order (not specified in the requesting call). |
CancelOrder
Permissions: Operator, Trading
Call Type: Synchronous
Cancels a specific open order that has been placed but has not yet been fully executed. Only cancels one order at a time specific to the orderid defined in the request.
A user with Trading permission can cancel an order only for an account it is associated with; a user with Operator permission can cancel an order for any account.
Request
POST /CancelOrder HTTP/1.1
Host: cexapi.wayex.com
aptoken: 604f9459-163f-4114-8ecc-928597554747
Content-Type: application/json
Content-Length: 57
{
"OMSId": 1,
"OrderId": 6500,
"AccountId": 9
}
The OMS ID and the Order ID precisely identify the order you wish to cancel, the Order ID is unique across an OMS but there is still a need to identify the account owning the order.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS where the order exists. required. |
| AccountId | integer. The ID of the account under which the order was placed. required. |
| OrderId | long integer. The order to be canceled. required. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
The response to CancelOrder verifies that the call was received, not that the order has been canceled successfully. Individual event updates to the user show order cancellation. To verify that an order has been canceled, call GetOrderStatus or GetOpenOrders.
| Key | Value |
|---|---|
| result | boolean. Returns true if the call to cancel the order has been successfully received, otherwise returns false. |
| errormsg | string. A successful receipt of a call to cancel an order returns null; the errormsg parameter for an unsuccessful call to cancel an order returns one of the following messages: Not Authorized (errorcode 20) Invalid Request (errorcode 100) Operation Failed (errorcode 101) Server Error (errorcode 102) Resource Not Found (errorcode 104) Operation Not Supported (errorcode 106) |
| errorcode | integer. A successfully received call to cancel an order returns 0. An unsuccessfully received call to cancel an order returns one of the errorcodes shown in the errormsg list. |
| detail | string. Message text that the system may send. The contents of this parameter are usually null. |
GetOpenOrders
Permissions: Operator,Trading,AccountReadOnly
Call Type: Synchronous
Retrieves the Open Orders, excludes Block Trades and Quotes, for the given accountId. Time in POSIX format X 1000 (milliseconds since 1 January 1970). Optionally include InstrumentId to filter by Instrument.
Request
POST /GetOpenOrders HTTP/1.1
Host: cexapi.wayex.com
aptoken: 604f9459-163f-4114-8ecc-928597554747
Content-Type: application/json
Content-Length: 43
{
"OMSId": 1,
"AccountId": 9
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS to which the user belongs. A user will belong only to one OMS. required. |
| AccountId | integer. The ID of the account which you are getting open orders for. required. |
| InstrumentId | integer. The ID of a specific instrument, can be used to filter results. optional. |
Response
[
{
"Side": "Buy",
"OrderId": 6598,
"Price": 39000,
"Quantity": 1,
"DisplayQuantity": 1,
"Instrument": 1,
"Account": 9,
"AccountName": "AnotherName",
"OrderType": "StopMarket",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 1681114594150,
"ReceiveTimeTicks": 638167113941496303,
"LastUpdatedTime": 1681114594155,
"LastUpdatedTimeTicks": 638167113941554842,
"OrigQuantity": 1,
"QuantityExecuted": 0,
"GrossValueExecuted": 0,
"ExecutableValue": 0,
"AvgPrice": 0,
"CounterPartyId": 0,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": 6598,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_user",
"IsQuote": false,
"InsideAsk": 26000,
"InsideAskSize": 1,
"InsideBid": 25000,
"InsideBidSize": 1,
"LastTradePrice": 26000,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "0",
"UseMargin": false,
"StopPrice": 39000,
"PegPriceType": "Ask",
"PegOffset": 0,
"PegLimitOffset": 0,
"IpAddress": null,
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
},
{
"Side": "Buy",
"OrderId": 6627,
"Price": 2,
"Quantity": 1,
"DisplayQuantity": 1,
"Instrument": 1,
"Account": 9,
"AccountName": "AnotherName",
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 1681207997025,
"ReceiveTimeTicks": 638168047970250300,
"LastUpdatedTime": 1681207997026,
"LastUpdatedTimeTicks": 638168047970264465,
"OrigQuantity": 1,
"QuantityExecuted": 0,
"GrossValueExecuted": 0,
"ExecutableValue": 0,
"AvgPrice": 0,
"CounterPartyId": 0,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": 6627,
"OrigClOrdId": 0,
"EnteredBy": 6,
"UserName": "sample_user",
"IsQuote": false,
"InsideAsk": 26000,
"InsideAskSize": 1,
"InsideBid": 2,
"InsideBidSize": 1,
"LastTradePrice": 25000,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "AddedToBook",
"UseMargin": false,
"StopPrice": 0,
"PegPriceType": "Ask",
"PegOffset": 0,
"PegLimitOffset": 0,
"IpAddress": null,
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
},
{
"Side": "Buy",
"OrderId": 6507,
"Price": 31000,
"Quantity": 0.01,
"DisplayQuantity": 0.01,
"Instrument": 9,
"Account": 9,
"AccountName": "AnotherName",
"OrderType": "Limit",
"ClientOrderId": 1,
"OrderState": "Working",
"ReceiveTime": 1678976987086,
"ReceiveTimeTicks": 638145737870859306,
"LastUpdatedTime": 1679025072387,
"LastUpdatedTimeTicks": 638146218723867613,
"OrigQuantity": 1,
"QuantityExecuted": 0,
"GrossValueExecuted": 0,
"ExecutableValue": 0,
"AvgPrice": 0,
"CounterPartyId": 0,
"ChangeReason": "UserModified",
"OrigOrderId": 6507,
"OrigClOrdId": 1,
"EnteredBy": 6,
"UserName": "sample_user",
"IsQuote": false,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0,
"InsideBid": 31000,
"InsideBidSize": 1,
"LastTradePrice": 0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OrderFlag": "AddedToBook",
"UseMargin": false,
"StopPrice": 0,
"PegPriceType": "Ask",
"PegOffset": 0,
"PegLimitOffset": 0,
"IpAddress": null,
"IPv6a": 0,
"IPv6b": 0,
"ClientOrderIdUuid": null,
"OMSId": 1
}
]
| Key | Value |
|---|---|
| Side | string. The side of a trade. One of: 0 Buy 1 Sell |
| OrderId | long integer. The ID of the open order. The OrderID is unique in each OMS. |
| Price | decimal. The price at which the buy or sell has been ordered. |
| Quantity | decimal. The quantity of the product to be bought or sold. |
| DisplayQuantity | decimal. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve. |
| Instrument | integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available. |
| Account | integer. ID of the of the account which the order belongs to. |
| AccountName | string. Name of the of the account which which the order belongs to. |
| OrderType | string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade |
| ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied. |
| OrderState | string. The current state of the order. Will always be Working as this API is getting open orders. |
| ReceiveTime | long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| ReceiveTimeTicks | long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| LastUpdatedTime | long integer. Time stamp when the order was last updated, in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone). |
| LastUpdatedTimeTicks | long integer. Time stamp when the order was last updated, in Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer. |
| OrigQuantity | decimal. If the open order has been changed or partially filled, this value shows the original quantity of the order. |
| QuantityExecuted | decimal. If the open order has been at least partially executed, this value shows the amount that has been executed. |
| GrossValueExecuted | decimal. If the open order has been at least partially executed, this value shows the gross amount that has been executed. |
| ExecutableValue | decimal. Defaults to 0. |
| AvgPrice | decimal. The average executed price of the order. |
| CounterPartyId | integer. The ID of the account who is the counterparty for the trade if order is already executed, either partial or fully executed. |
| ChangeReason | string. If the order has been changed, this string value holds the reason. One of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified. An order that is newly added to book will have NewInputAccepted value by default. |
| OrigOrderId | long integer. If the order is a replacement order, this is the ID of the original order. |
| OrigClOrdId | long integer. If the order is a replacement order, this is the client order ID or the original order. |
| EnteredBy | integer. The ID of the user who submitted the order. |
| Username | string. The username of the user who submitted the order. |
| IsQuote | boolean. If this order is a quote, the value for IsQuote is true, otherwise it is false. |
| InsideAsk | decimal. If this order is a quote, this value is the Inside Ask price. |
| InsideAskSize | decimal. If this order is a quote, this value is the quantity of the Inside Ask quote. |
| InsideBid | decimal. If this order is a quote, this value is the Inside Bid price. |
| InsideBidSize | decimal. If this order is a quote, this value is the quantity of the Inside Bid quote. |
| LastTradePrice | decimal. The last price that this instrument traded at. |
| RejectReason | string. If this open order has been rejected, this string holds the reason for the rejection. |
| IsLockedIn | boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false. |
| CancelReason | string. If this order has been canceled, this string holds the cancellation reason. |
| OrderFlag | string. One or more of: 1 NoAccountRiskCheck 2 AddedToBook 4 RemovedFromBook 8 PostOnly 16 Liquidation 32 ReverseMarginPosition |
| UseMargin | boolean. Margin is not yet supported so this always defaults to false. |
| StopPrice | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegPriceType | string. The type of price to peg the Stop to for Stop/Trailing orders. |
| PegOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| PegLimitOffset | decimal. Only applicable to trailing/stop orders. Defaults to 0.0 if order is another type. |
| IpAddress | string. The IP address from where the order was submitted. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| IPv6a | UInt64. The IPv6 where the order was submitted from. Currently not being used, for future provision. Defaults to 0. |
| OMSId | integer. The ID of the OMS. |
GetAccountTrades
Permissions: Operator,Trading,AccountReadOnly
Call Type: Synchronous
Requests the details on up to 200 past trade executions for a single specific account and OMS, starting at index i, where i is an integer identifying a specific execution in reverse order; that is, the most recent execution has an index of 0, and increments by one as trade executions recede into the past.
Users with Trading or AccountReadOnly permission may access trade information only for accounts with which they are associated; users with Operator permission may access trade information for any account.
The operator of the trading venue determines how long to retain an accessible trading history before archiving.
Request
POST /GetAccountTrades HTTP/1.1
Host: cexapi.wayex.com
aptoken: d350c7a3-f63c-4938-ade8-d68b326e9298
Content-Type: application/json
Content-Length: 61
{
"OMSId": 1,
"AccountId": 7,
"Depth": 2
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS to which the user belongs. A user will belong to only one OMS. required. |
| AccountId | integer. The ID of the account. If not specified, if authenticated user has the default permissions, its default account's trades will be returned, else if the authenticated user has elevated permissions, trades of any account will be returned. optional. |
| StartIndex | integer. The starting index into the history of trades, beginning from 0 (the most recent trade). optional. |
| Count or Depth | integer. The number of trades to return. The system can return up to 200 trades. optional. |
| InstrumentId | integer. The ID of the instrument for which account trades will be returned, filter parameter. optional. |
| TradeId | integer. The ID of a specific trade, filter parameter. optional. |
| OrderId | integer. The ID of a specific order, filter parameter. optional. |
| StartTimeStamp | long integer. Filter parameter. optional. |
| EndTimeStamp | long integer. Filter parameter. optional. |
| ExecutionId | integer. Filter parameter. optional. |
Response
[
{
"OMSId": 1,
"ExecutionId": 1831,
"TradeId": 916,
"OrderId": 6559,
"AccountId": 7,
"AccountName": "sample",
"SubAccountId": 0,
"ClientOrderId": 0,
"InstrumentId": 2,
"Side": "Buy",
"OrderType": "Limit",
"Quantity": 0.02,
"RemainingQuantity": 0.0,
"Price": 23436.0,
"Value": 468.72,
"CounterParty": "9",
"OrderTradeRevision": 1,
"Direction": "NoChange",
"IsBlockTrade": false,
"Fee": 0.0004,
"FeeProductId": 4,
"OrderOriginator": 0,
"UserName": "",
"TradeTimeMS": 1681203988297,
"MakerTaker": "Maker",
"AdapterTradeId": 0,
"InsideBid": 23436.0,
"InsideBidSize": 0.0,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"IsQuote": false,
"CounterPartyClientUserId": 1,
"NotionalProductId": 1,
"NotionalRate": 1.0,
"NotionalValue": 468.72,
"NotionalHoldAmount": 0,
"TradeTime": 638168007882966478
},
{
"OMSId": 1,
"ExecutionId": 1829,
"TradeId": 915,
"OrderId": 6557,
"AccountId": 7,
"AccountName": "sample",
"SubAccountId": 0,
"ClientOrderId": 0,
"InstrumentId": 2,
"Side": "Buy",
"OrderType": "Limit",
"Quantity": 0.02,
"RemainingQuantity": 0.0,
"Price": 23436.0,
"Value": 468.72,
"CounterParty": "9",
"OrderTradeRevision": 1,
"Direction": "NoChange",
"IsBlockTrade": false,
"Fee": 0.0004,
"FeeProductId": 4,
"OrderOriginator": 0,
"UserName": "",
"TradeTimeMS": 1681203988296,
"MakerTaker": "Maker",
"AdapterTradeId": 0,
"InsideBid": 23436.0,
"InsideBidSize": 0.0,
"InsideAsk": 79228162514264337593543950335,
"InsideAskSize": 0.0,
"IsQuote": false,
"CounterPartyClientUserId": 1,
"NotionalProductId": 1,
"NotionalRate": 1.0,
"NotionalValue": 468.72,
"NotionalHoldAmount": 0,
"TradeTime": 638168007882963921
}
]
The response is an array of objects, each element of which represents a trade by the account.
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS to which the account belongs. |
| ExecutionId | integer. The ID of this account's side of the trade. Every trade has two sides. |
| TradeId | integer. The ID of the overall trade. |
| OrderId | long integer. The ID of the order causing the trade (buy or sell). |
| AccountId | integer. The ID of the account that made the trade (buy or sell). |
| AccountName | string. The Name of the account that made the trade (buy or sell). |
| SubAccountId | integer. Not currently used; reserved for future use. Defaults to 0. |
| ClientOrderId | long integer. An ID supplied by the client to identify the order (like a purchase order number). The clientOrderId defaults to 0 if not supplied. |
| InstrumentId | integer. The ID of the instrument being traded. An instrument comprises two products, for example Dollars and Bitcoin. |
| Side | string. One of the following potential sides of a trade: 0 Buy 1 Sell |
| OrderType | string. One of the following potential sides of a trade: Market Limit BlockTrade StopMarket StopLimit TrailingStopLimit StopMarket TrailingStopMarket |
| Quantity | decimal. The unit quantity of this side of the trade. |
| RemainingQuantity | decimal. The number of units remaining to be traded by the order after this execution. This number is not revealed to the other party in the trade. This value is also known as "leave size" or "leave quantity." |
| Price | decimal. The unit price at which the instrument traded. |
| Value | decimal. The total value of the deal. The system calculates this as: unit price X quantity executed. |
| CounterParty | string. The ID of the other party in a block trade. Usually, IDs are stated as integers; this value is an integer written as a string. |
| OrderTradeRevision | integer. The revision number of this trade; usually 1. |
| Direction | string. The effect of the trade on the instrument's market price. One of: 0 No change 1 Uptick 2 DownTick |
| IsBlockTrade | boolean. A value of true means that this trade was a block trade; a value of false that it was not a block trade. |
| Fee | decimal. Any fee levied against the trade by the Exchange. |
| FeeProductId | integer. The ID of the product in which the fee was levied. |
| OrderOriginator | integer. The ID of the user who initiated the trade. |
| UserName | integer. The UserName of the user who initiated the trade. |
| TradeTimeMS | long integer. The date and time that the trade took place, in milliseconds and POSIX format. All dates and times are UTC. |
| MakerTaker | string. One of the following potential liquidity provider of a trade: Maker Taker |
| AdapterTradeId | integer. The ID of the adapter of the overall trade. |
| InsideBid | decimal. The best (highest) price level of the buy side of the book at the time of the trade. |
| InsideBidSize | decimal. The quantity of the best (highest) price level of the buy side of the book at the time of the trade. |
| InsideAsk | decimal. The best (lowest) price level of the sell side of the book at the time of the trade. |
| InsideAskSize | decimal. The quantity of the best (lowest) price level of the sell side of the book at the time of the trade. |
| CounterPartyClientUserId | integer. Indicates counterparty source of trade (OMS, Remarketer, FIX) |
| NotionalProductId | integer. Notional product the notional value was captured in |
| NotionalRate | decimal. Notional rate from base currency at time of trade |
| NotionalValue | decimal. Notional value in base currency of venue at time of trade |
| TradeTime | long integer. The date and time that the trade took place, in C# Ticks. All dates and times are UTC. |
Ticker
Permissions: Public
Call Type: Synchronous
Ticker endpoint provide a 24-hour pricing and volume summary for each market pair and each market type (spot, perpetuals, physical futures, options) available on the exchange for CMC integration.
Request
POST /Ticker HTTP/1.1
Host: cexapi.wayex.com
No field is required in the request payload.
Response
{
"BTC_AUD": {
"base_id": 1,
"quote_id": 0,
"last_price": 29000,
"base_volume": 0.222,
"quote_volume": 6425.0
},
"ETH_AUD": {
"base_id": 1027,
"quote_id": 0,
"last_price": 1970,
"base_volume": 0.0,
"quote_volume": 0.0
}
}
| Key | Value |
|---|---|
| base_id | integer. The unified cryptoasset id of the base product of the instrument. |
| quote_id | integer. The quote id of the instrument. |
| last_price | decimal. The last traded price of the instrument. |
| base_volume | decimal. The current base volume of the instrument. |
| quote_volume | decimal. The current quote volume of the instrument. |
OrderBook
Permissions: Public
Call Type: Synchronous
The OrderBook endpoint is to provide a complete level 2 order book (arranged by best asks/bids) with full depth returned for a given market pair for CMC integration. Parameters can also be supplied in the request payload.
Request
POST /OrderBook HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 52
//No need to set Depth if Level is set to 1
{
"Market_Pair": "BTCAUD",
"Level": 1
}
////Level 2, you need to set Depth to a number higher than 1 else you will only see best bid and best ask
{
Market_Pair: "BTCAUD",
Depth: 10,
Level: 2,
}
| Key | Value |
|---|---|
| Market_Pair | string The instrument symbol, instrument id is not accepted. required. |
| Depth | integer Depth of the orderbook you want to see, this only applicable if Level parameter is set to 2. Depth will always be 1 if this is not set or if Level is set to 1. optional. |
| Level | integer Either 1 or 2. 1 mean you only want to see the best bid and best ask, 2 means you want to see other levels of the book, number of bids and ask you will see depends on the Depth set, if Depth is not set and Level is set to 2, best bid and best ask will only be the ones to be returned.If Level is not set, default is 1. optional. |
Response
//Level 1
{
"timestamp": 1679548364728,
"bids": [
[
2, //Quantity
28900 //Price
]
],
"asks": [
[
0.5, //Quantity
29000 //Price
]
]
}
//level 2, Depth 10, only 2 bids existing, only 1 ask existing
{
"timestamp": 1679548299447,
"bids": [
[
2, //Quantity
28900 //Price
],
[
1,
28700
]
],
"asks": [
[
0.5,
29000
]
]
}
Returns a JSON object with fields timestamp, bids and asks.
| Key | Value |
|---|---|
| timestamp | long integer Unix timestamp in milliseconds, equivalent to the current timestamp when the response was returned. |
| bids | array The quantity(decimal) and price(decimal) per level which someone is willing to buy. |
| asks | array The quantity(decimal) and price(decimal) per level which someone is willing sell. |
Trades
Permissions: Public
Call Type: Synchronous
Returns trades for a specific market pair or instrument. Only returns the 100 most recent trades.
Request
POST /Trades HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 33
{
"market_pair": "BTCAUD"
}
| Key | Value |
|---|---|
| market_pair | string The market pair or instrument symbol. required. |
Response
[
{
trade_id: 1572,
price: 31000,
base_volume: 0.001,
quote_volume: 31.0,
timestamp: "2023-05-05T04:47:58.917Z",
type: "sell",
},
{
trade_id: 1573,
price: 31599,
base_volume: 0.001,
quote_volume: 31.599,
timestamp: "2023-05-05T04:48:25.327Z",
type: "buy",
}
];
| Key | Value |
|---|---|
| trade_id | integer The ID of the trade execution. |
| price | decimal The price at which the trade was executed. |
| base_volume | decimal The traded quantity of the base product/currency. |
| quote_volume | decimal The traded quantity of the quote product/currency. |
| timestamp | string The exact date and time when the trade was executed, in UTC. |
| type | string The side of the trade, either sell or buy. |
GetEarliestTickTime
Permissions: Level1MarketData, Operator
Call Type: Synchronous
Gets the earliest ticker time possible for a specific instrument or market pair.
Request
POST /GetEarliestTickTime HTTP/1.1
Host: hostname goes here..
Content-Type: application/json
aptoken: 239260f0-dd79-439b-85e2-a5a24fcd9158 //valid session token, can be acquired during HTTP authentication
Content-Length: 54
{
"OMSId": 1,
"InstrumentId": 1
}
| Key | Value |
|---|---|
| InstrumentId | integer. The id of the instrument, symbol is not accepted.If you don't specify this, response will have the current timestamp which is not valid. required. |
| OMSId | integer. ID of the OMS where the pair or instrument is being traded. required. |
Response
[1651148820000];
Returns an array with exactly 1 element which is the equivalent timestamp in milliseconds of the earliest ticker data for the specific instrument in the request.
GetL2Snapshot
Permissions: Public
Call Type: Synchronous
Provides a current Level 2 snapshot of a specific instrument trading on an OMS to a user-determined market depth. The Level 2 snapshot allows the user to specify the level of market depth information on either side of the bid and ask.
Request
POST /GetL2Snapshot HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 63
{
"OMSId": 1,
"InstrumentId": 1,
"Depth": 100
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| InstrumentId | integer. The ID of the instrument that is the subject of the snapshot. required. |
| Depth | integer. Maximum number of bids and asks that can be included in the results. If set to 10, there can be maximum of 10 bids and 10 asks in the results. required. |
Response
[
[
26, // MDUpdateId
1, // Number of Unique Accounts
1679559223042, //ActionDateTime in Posix format X 1000
0, // ActionType 0 (New), 1 (Update), 2(Delete)
29000, // LastTradePrice
1, // Number of Orders
28700, //Price
1, // ProductPairCode
0.5, // Quantity
0, // Side 0 means buy and it is on the bid side
],
[
26,
2,
1679559223042,
0,
29000,
2,
29000,
1,
0.52,
1, // Side 1 means sell and it is on the ask side
],
][
// This is how the response is sent:
[0, 1, 123, 0, 0.0, 0, 0.0, 0, 0.0, 0]
];
The response is an array of elements for one specific instrument, the number of elements corresponding to the market depth specified in the Request. It is sent as an uncommented, comma-delimited list of numbers. The example is commented. The Level2UpdateEvent contains the same data, but is sent by the OMS whenever trades occur. To receive Level2UpdateEvents, a user must subscribe to Level2UpdateEvents.
| Key | Value |
|---|---|
| MDUpdateID | integer. Market Data Update ID. This sequential ID identifies the order in which the update was created. |
| Number of Unique Accounts | integer. Number of accounts that placed orders. |
| ActionDateTime | long integer.. ActionDateTime identifies the time and date that the snapshot was taken or the event occurred, in POSIX format X 1000 (milliseconds since 1 January 1970). |
| ActionType | integer. L2 information provides price data. This value shows whether this data is: 0 new 1 update 2 deletion |
| LastTradePrice | decimal. The price at which the instrument was last traded. |
| Number of Orders | integer. Number of orders in the GetL2Snapshot. |
| Price | decimal. Bid or Ask price for the Quantity (see Quantity below). |
| ProductPairCode | integer. ProductPairCode is the same value and used for the same purpose as InstrumentID. The two are completely equivalent. InstrumentId 47 = ProductPairCode 47. |
| Quantity | decimal. Quantity available at a given Bid or Ask price (see Price above). |
| Side | integer. One of: 0 Buy means it is on the bid side 1 Sell means it is on the ask side 2 Short (reserved for future use) 3 Unknown (error condition) |
GetLevel1
Permissions: Trading, Public
Call Type: Synchronous
Provides a current Level 1 snapshot (best bid, best offer and other data such lasttradedprice) of a specific instrument trading on an OMS. The Level 1 snapshot does not allow the user to specify the level of market depth information on either side of the bid and ask.
Request
POST /GetLevel1 HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 27
{
"OMSId": 1
"InstrumentId": 1
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. required. |
| InstrumentId | integer. The ID of the instrument whose Level 1 market snapshot will be taken. required. |
Response
{
"OMSId": 1,
"InstrumentId": 1,
"BestBid": 28700,
"BestOffer": 29000,
"LastTradedPx": 29000,
"LastTradedQty": 0.001,
"LastTradeTime": 1679466290437,
"SessionOpen": 28000,
"SessionHigh": 29000,
"SessionLow": 28000,
"SessionClose": 29000,
"Volume": 0.001,
"CurrentDayVolume": 0.222,
"CurrentDayNotional": 6425.0,
"CurrentDayNumTrades": 5,
"CurrentDayPxChange": 1000,
"Rolling24HrVolume": 0.0,
"Rolling24HrNotional": 0.0,
"Rolling24NumTrades": 0,
"Rolling24HrPxChange": 0,
"TimeStamp": "1679466290440",
"BidQty": 0.5,
"AskQty": 0.5,
"BidOrderCt": 0,
"AskOrderCt": 0,
"Rolling24HrPxChangePercent": 0
}
| Key | Value |
|---|---|
| OMSId | integer. The ID of the OMS. |
| InstrumentId | integer. The ID of the instrument being tracked. |
| BestBid | decimal. The current best bid for the instrument. |
| BestOffer | decimal. The current best offer for the instrument. |
| LastTradedPx | decimal. The last-traded price for the instrument. |
| LastTradedQty | decimal. The last-traded quantity for the instrument. |
| LastTradeTime | long integer. The time of the last trade, in POSIX format. |
| SessionOpen | decimal. Opening price. In markets with openings and closings, this is the opening price for the current session; in 24-hour markets, it is the price as of UTC Midnight. |
| SessionHigh | decimal. Highest price during the trading day, either during a session with opening and closing prices or UTC midnight to UTC midnight. |
| SessionLow | decimal. Lowest price during the trading day, either during a session with opening and closing prices or UTC midnight to UTC midnight. |
| SessionClose | decimal. The closing price. In markets with openings and closings, this is the closing price for the current session; in 24-hour markets, it is the price as of UTC Midnight. |
| Volume | decimal. The last-traded quantity for the instrument, same value as LastTradedQty |
| CurrentDayVolume | decimal. The unit volume of the instrument traded either during a session with openings and closings or in 24-hour markets, the period from UTC Midnight to UTC Midnight. |
| CurrentDayNumTrades | integer. The number of trades during the current day, either during a session with openings and closings or in 24-hour markets, the period from UTC Midnight to UTC Midnight. |
| CurrentDayPxChange | decimal. Current day price change, either during a trading session or UTC Midnight to UTC midnight. |
| CurrentNotional | decimal. Current day quote volume - resets at UTC Midnight. |
| Rolling24HrNotional | decimal. Rolling 24 hours quote volume. |
| Rolling24HrVolume | decimal. Unit volume(quantity traded, in the product 1 or in the base currency denomination) of the instrument during the past 24 hours, regardless of time zone. Recalculates continuously. |
| Rolling24HrNumTrades | integer. Number of trades during the past 24 hours, regardless of time zone. Recalculates continuously. |
| Rolling24HrPxChange | decimal. Price change during the past 24 hours, regardless of time zone. Recalculates continuously. |
| TimeStamp | string. The time this information was provided, in POSIX format. |
| BidQty | decimal. The quantity currently being bid. |
| AskQty | decimal. The quantity currently being asked. |
| BidOrderCt | integer. The count of bid orders. |
| AskOrderCt | integer. The count of ask orders. |
| Rolling24HrPxChangePercent | decimal. Percent change in price during the past 24hours regardles of the timezone. Recalculates continuously. |
GetEnums
Permissions: Public
Call Type: Synchronous
Get Order Object Enum Definitions
Request
POST /GetEnums HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
{
}
No request payload required.
Response
[
{
"Class": "Order",
"Property": "OrderState",
"Enums": [
{
"Name": "Working",
"Description": "Order is in non-terminal state either on the order book or not activated yet if a stop order",
"Number": 1
},
{
"Name": "Rejected",
"Description": "Order is in a terminal state and has been rejected by the matching engine",
"Number": 2
},
{
"Name": "Canceled",
"Description": "Order is in a terminal state and has been cancelled by the oms or by the user",
"Number": 3
},
{
"Name": "Expired",
"Description": "Order is in a terminal state and has been expired by the matching engine",
"Number": 4
},
{
"Name": "FullyExecuted",
"Description": "Order is in a terminal state and has been fully executed by the matching engine",
"Number": 5
}
]
}
]
| Key | Value |
|---|---|
| Class | integer. The class name. Since GetEnums is solely for Orders currently, the class name will always be Order. |
| Property | integer. The property name, since GetEnums is solely for Orders currently, property name will always be OrderState. |
| Enums | array of objects. The actual enum values for Orders. Name - string The name of the order state enum. Description - string The description of the order state enum. Number - integer The number of the order state enum. |
Withdraw
ConfirmWithdraw
Permissions: Public
Call Type: Synchronous
Confirms a withdrawal, transitions a withdraw ticket from Pending2Fa to Confirmed2Fa status.
Request
POST /ConfirmWithdraw HTTP/1.1
Host: cexapi.wayex.com
Content-Type: application/json
Content-Length: 80
{
"UserId": 1,
"VerifyCode": "57791f11-c7f1-4be3-b098-94e04091928e"
}
| Key | Value |
|---|---|
| UserId | integer. ID of the user for which the withdraw will be confirmed. required. |
| VerifyCode | string. GUID being generated by Wayex and being sent to the email address of the user. required. |
Response
{
"result": true
}
| Key | Value |
|---|---|
| result | boolean. A successful request returns true; and unsuccessful request (an error condition) returns false. |
| errormsg | string. The error message. Only shows if there is an error. |
CreateWithdrawTicket
Permissions: Operator, Withdraw
Call Type: Synchronous
Initiates the withdrawal of funds(any product type) from an account
Request
POST /CreateWithdrawTicket HTTP/1.1
Host: cexapi.wayex.com
aptoken: 9c0faeb9-4d29-4eb8-aca7-b36a9b46923c
Content-Type: application/json
Content-Length: 329
{
"OMSId":1,
"AccountId":9,
"ProductId":3,
"Amount":0.001,
"TemplateForm": "{\"key\":\"value\"}",
"TemplateType": "ExternalAddress",
"AccountProviderId":7
}
| Key | Value |
|---|---|
| OMSId | integer The ID of the OMS where the account belongs to. required. |
| AccountId | integer The ID of the account from which the withdraw amount of the specific asset/product will be debited. |
| ProductId | integer The ID of the asset or product for which the withdraw amount will reflect as debit. required. |
| Amount | decimal The actual amount to be withdrawn. Amount must be greater than 0. required. |
| TemplateForm | string An object serialized as string consisting information such as destionation of funds. The fields in the object are disclosed by Wayex later. Needs to be properly serialized as a string. required. |
| TemplateType | string The withdraw form template type. Will be provided by Wayex.required. |
| AccountProviderId | string The ID of the account provider that will handle the withdraw. optional. |
Response
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": "27976f52-2197-451c-b443-aa11aa2c1e76"
}
| Key | Value |
|---|---|
| result | boolean. A successful request returns true; and unsuccessful request (an error condition) returns false. |
| errormsg | string. A successful request returns null; the errormsg parameter for an unsuccessful request returns one of the following messages: Not Authorized (errorcode 20), Invalid Request (errorcode 100), Operation Failed (errorcode 101), Server Error (errorcode 102), Resource Not Found (errorcode 104) |
| errorcode | integer. A successful request returns 0. An unsuccessful request returns one of the errorcodes shown in the errormsg list. |
| detail | string. Additional details: the RequestCode of the newly created withdraw ticket if request is successful, some additional details about the error if request failed. |