If you want to see the documentation of the other apis, click on the button below:
In the examples described in this documentation, we use NodeJs and ws lib.
• Install the latest stable version of NodeJs on: https://nodejs.org/en/download/
• Open Terminal (Mac), Cmd (Windows) or Bash (Linux) and enter the command:
In the same folder you will save the scripts exemplified below
| npm install ws |
ref link: https://www.npmjs.com/package/ws
You can download the example directly from the repository on GitHub:
With NodeJs:
| //Instantiate Websocket module const WebSocket=require('ws');
//WebSocketAPI Address //Setup WebSocket client Address |
The Rate Limit of the WS API is divided into three topics, these being connection, concurrent connection and messages.
| # | Common | Partners | Block time |
| Connections per period | 1 connection per second | 3 connections per second | 1s |
| Connections concurrent | 10 connections concurrent | 20 connections concurrent | N/A |
| Messages per period | 750 messages per 60s | 2100 messages per 60s | 60s |
Object in JSON-formatted format used as a frame to send and receive data:
var messageFrame={Object in JSON-formatted format which contains mandatory (and different) fields for sending data to the triggered endpoint.
Each endpoint has a specific package, see payload format in documentation.
| //Example of building the payload for the *getL2Snapshot* endpoint var payload={ 'OMSId': 1, |
Set the Open event to handle the connection return.
Each endpoint has a specific package, see payload format in documentation.
| //Event Open Connection ws.on('open', function open(){ console.log('Conected'); |
Set event to receive socket message:
| //Event Receiving Message ws.on('message', function incoming(data){ //data contains the response payload |
Define event for error handling:
| //Event Error Message ws.on('error', function(){ console.log('Error'); |
Define event handle connection termination:
| //Event Close Message ws.on('close', function close(){ console.log('Connection Closed'); |
To send data to the server you must use the “messageFrame” object described above, use the “n” field to inform the Endpoint to trigger and the “o” field to send the payload.
| //Indicate to which endpoint it will be sent. messageFrame.n='WebAuthenticateUser' //Add the payload for the indicated endpoint ws.send(JSON.stringify(messageFrame), function ack(error){ //If you find errors, send }); |
Data sent, if no error is returned, the message ends in the message event.
Endpoints PRIVATE need authentication to be accessed.
AuthenticateUser authenticates a user in current WebSession using APIKEY previously defined.
You need to call it to use methods that require an active SessionToken.
AuthenticateUser can be called whenever authentication is required.
Request:
| { 'APIKey': 'APIKey', 'Signature': 'Signature', 'UserId': 'UserId', 'Nonce': 'Nonce', } >>> Obs. 1: Nonce=Date.now(); |
Return when authentication succeeds:
| { 'Authenticated': true 'SessionToken': 'SessionToken' 'UserId': 123 } |
Unsuccessful authentication:
| { 'Authenticated': false } |
PUBLIC - AuthenticateUser
Accepts the following message:
AuthenticateUser a user using the API Key and signature.
Retry example
{
"Authenticated": false,
"Requires2FA": true,
"TwoFAToken": null,
"TwoFAType": "Google",
"User": {
"UserId": "1234542342",
"UserName": "User Test",
"Email": "[email protected]",
"EmailVerified": true,
"AccountId": "12342332",
"Use2FA": true
}
}
PRIVATE - CancelAllOrders
Accepts the following message:
Cancels all open matching orders for the specified instrument.
Reply example
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": ""
}
PRIVATE - CancelOrder
Accepts the following message:
Cancels an open order that has been placed but has not yet been fully executed.
A user with Trading permission can cancel an order only for an account with which he is associated; a user with Operator permission can cancel an order for any account.
Reply example
{
"result": true,
"errormsg": "",
"errorcode": 0,
"detail": ""
}
PRIVATE - GetAccountInfo
Accepts the following message:
Returns detailed information about one specific account and existing on a specific Order Management System.
Reply example
{
"omsid": 0,
"accountId": 0,
"accountName": "",
"accountHandle": "",
"firmId": "",
"firmName": "",
"accountType": {
"Options": [
"Asset",
"Liability",
"ProfitLoss"
]
},
"feeGroupID": 0,
"parentID": 0,
"riskType": {
"Options": [
"Unknown",
"Normal",
"NoRiskCheck",
"NoTrading"
]
},
"verificationLevel": 0,
"feeProductType": {
"Options": [
"BaseProduct",
"SingleProduct"
]
},
"feeProduct": 0,
"refererId": 0,
"loyaltyProductId": 0,
"loyaltyEnabled": false,
"marginEnabled": false,
"liabilityAccountId": 0,
"lendingAccountId": 0,
"profitLossAccountId": 0
}
PRIVATE - GetAccountPositions
Accepts the following message:
Retrieves a list of positions (balances) for a specific user account running under a specific Order Management System. The trading day runs from UTC Midnight to UTC Midnight.
Users with Trading or AccountReadOnly permission must specify an account ID with which they're associated on the Order Management System. Users with Operator permission can specify other accounts.
Reply example
[
{
"omsId": 1,
"accountId": 4,
"productSymbol": "BTC",
"productId": 1,
"amount": 0,
"hold": 0,
"pendingDeposits": 0,
"pendingWithdraws": 0,
"totalDayDeposits": 0,
"totalMonthDeposits": 0,
"totalYearDeposits": 0,
"totalYearDepositNotional": 0,
"totalDayWithdraws": 0,
"totalMonthWithdraws": 0,
"totalYearWithdraws": 0,
"totalYearWithdrawNotional": 0,
"notionalHoldAmount": 0,
"notionalRate": 0,
"totalDayDepositNotional": 0,
"totalMonthDepositNotional": 0,
"totalDayWithdrawNotional": 0,
"totalMonthWithdrawNotional": 0
},
{
"omsId": 1,
"accountId": 4,
"productSymbol": "USD",
"productId": 2,
"amount": 0,
"hold": 0,
"pendingDeposits": 0,
"pendingWithdraws": 0,
"totalDayDeposits": 0,
"totalMonthDeposits": 0,
"totalYearDeposits": 0,
"totalYearDepositNotional": 0,
"totalDayWithdraws": 0,
"totalMonthWithdraws": 0,
"totalYearWithdraws": 0,
"totalYearWithdrawNotional": 0,
"notionalHoldAmount": 0,
"notionalRate": 0,
"totalDayDepositNotional": 0,
"totalMonthDepositNotional": 0,
"totalDayWithdrawNotional": 0,
"totalMonthWithdrawNotional": 0
}
]
PRIVATE - GetAccountTrades
Accepts the following message:
Requests the details on up to 200 past trade executions for a single specific account and Order Management System, 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.
Only the last three months can be listed in the trades search.
Reply example
[
{
"OMSId": 0,
"ExecutionId": 0,
"TradeId": 0,
"OrderId": 0,
"AccountId": 0,
"SubAccountId": 0,
"InstrumentId": 0,
"Side": "Buy",
"OrderType": "Limit",
"Quantity": 0,
"RemainingQuantity": 0,
"Price": 0,
"Value": 0,
"CounterParty": "",
"Direction": "No change",
"IsBlockTrade": false,
"Fee": 0,
"FeeProductId": 0,
"UserName": "",
"TradeTimeMS": 0,
"MakerTaker": "Maker",
"InsideBid": 0,
"InsideBidSize": 0,
"InsideAsk": 0,
"InsideAskSize": 0,
"IsQuote": false,
"TradeTime": 0
}
]
PRIVATE - GetDepositTickets
Accepts the following message:
Retrieves deposit tickets.
Reply example
{
"viewer": {
"sn": "M5B72BO46AAAA",
"ref": "729602682189999",
"email": "[email protected]",
"uuid": "940a7698-552e-4c1c-9ee4-ed116f09999",
"name": "Name Surname Surname",
"deposits": [
{
"amount": 100,
"createdAt": "2020-06-17T11:21:51.389-03:00",
"currency": {
"code": "xrp",
"isCrypto": true,
"isFiat": false,
"name": "Ripple",
"precision": 6
},
"ref": "4741053231764111",
"rejectedReason": "cannot lock funds (amount: 100)",
"state": "DONE",
"updatedAt": "2020-06-29T15:34:49.769-03:00",
"remoteFileUrl": "https://s3.amazonaws.com/live-foxbit-kyc/foxbit.com.br/1234-1234-0.png",
"fundExtra": "TESTENET",
"fundUid": "rfSN7sAEmSm6w91wtv4Ha393mUsP8yAAAA",
"blockchainUrl": "https://stellar.expert/explorer/public/tx/aaaaa",
"transactionId": "C290EA63EB6A1FEF123E90664384C800B3B5E543527E78AD91E34DCBAAAAAA"
}
]
}
}
PUBLIC - GetInstrument
Accepts the following message:
Retrieves an instruments. An instrument is a pair of exchanged products (or fractions of them) such as US dollars and BitCoin.
Reply example
{
"OMSId": 0,
"InstrumentId": 0,
"Symbol": "",
"Product1": 0,
"Product1Symbol": "",
"Product2": 0,
"Product2Symbol": "",
"InstrumentType": 0,
"VenueInstrumentId": 0,
"VenueId": 0,
"SortIndex": 0,
"SessionStatus": 0,
"PreviousSessionStatus": "",
"SessionStatusDateTime": "0001-01-01T00:00:00",
"SelfTradePrevention": false,
"QuantityIncrement": 0,
"PriceIncrement": 0,
"MinimumQuantity": 0,
"MinimumPrice": 0.01,
"VenueSymbol": "BTC/BRL",
"IsDisable": false,
"MasterDataId": 0,
"PriceCollarThreshold": 0,
"PriceCollarPercent": 0,
"PriceCollarEnabled": false,
"PriceFloorLimit": 0,
"PriceFloorLimitEnabled": false,
"PriceCeilingLimit": 0,
"PriceCeilingLimitEnabled": false,
"CreateWithMarketRunning": true,
"AllowOnlyMarketMakerCounterParty": false
}
PUBLIC - GetInstruments
Accepts the following message:
Retrieves a list of instruments available on the exchange. An instrument is a pair of exchanged products (or fractions of them) such as US dollars and BitCoin.
Reply example
[
{
"OMSId": 0,
"InstrumentId": 0,
"Symbol": "",
"Product1": 0,
"Product1Symbol": "",
"Product2": 0,
"Product2Symbol": "",
"InstrumentType": 0,
"VenueInstrumentId": 0,
"VenueId": 0,
"SortIndex": 0,
"SessionStatus": 0,
"PreviousSessionStatus": "",
"SessionStatusDateTime": "0001-01-01T00:00:00",
"SelfTradePrevention": false,
"QuantityIncrement": 0,
"PriceIncrement": 0,
"MinimumQuantity": 0,
"MinimumPrice": 0.01,
"VenueSymbol": "BTC/BRL",
"IsDisable": false,
"MasterDataId": 0,
"PriceCollarThreshold": 0,
"PriceCollarPercent": 0,
"PriceCollarEnabled": false,
"PriceFloorLimit": 0,
"PriceFloorLimitEnabled": false,
"PriceCeilingLimit": 0,
"PriceCeilingLimitEnabled": false,
"CreateWithMarketRunning": true,
"AllowOnlyMarketMakerCounterParty": false
}
]
PUBLIC - GetOpenOrders
Accepts the following message:
Returns an array of 0 or more orders that have not yet been filled (open orders) for a single account on a specific Order Management System. The call returns an empty array if an account has no open orders.
A user with Trading or AccountReadOnly permission must be associated with the account named by AccountId; a user with Operator permissoin can get open orders for any account.
Reply example
[
{
"Side": "",
"OrderId": 0,
"Price": 0,
"Quantity": 0,
"DisplayQuantity": 0,
"Instrument": 0,
"Account": 0,
"AccountName": "",
"orderType": "",
"ClientOrderId": 0,
"OrderState": "",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"LastUpdatedTime": 1663786062818,
"LastUpdatedTimeTicks": 637993828628180000,
"OrigQuantity": 0,
"QuantityExecuted": 0,
"GrossValueExecuted": 0,
"ExecutableValue": 0,
"AvgPrice": 0,
"CounterPartyId": 0,
"ChangeReason": "",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"UserName": "",
"IsQuote": false,
"InsideAsk": 0,
"InsideAskSize": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"LastTradePrice": 0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0,
"OrderFlag": "",
"UseMargin": false,
"StopPrice": 0,
"PegPriceType": 0,
"PegOffset": 0,
"PegLimitOffset": 0,
"InstantAmount": null,
"InstantAmountExecuted": null
}
]
PRIVATE - GetOrderHistory
Accepts the following message:
Returns a complete list of all orders, both open and executed, for a specific account on the specified Order Management System.
The account named in the request must be associated with the calling user.
Reply example
[
{
"Side": "Buy",
"OrderId": 0,
"Price": 0,
"Quantity": 0,
"DisplayQuantity": 0,
"Instrument": 0,
"Account": 0,
"OrderType": "Unknown",
"ClientOrderId": 0,
"OrderState": "Unknown",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"OrigQuantity": 0,
"QuantityExecuted": 0,
"AvgPrice": 0,
"CounterPartyId": 0,
"ChangeReason": "Unknown",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"IsQuote": false,
"InsideAsk": 0,
"InsideAskSize": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"LastTradePrice": 0,
"RejectReason": "",
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 0
}
]
PRIVATE - GetOrderStatus
Accepts the following message:
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.
Reply example
{
"Side": "Buy",
"OrderId": 0,
"Price": 0,
"Quantity": 0,
"DisplayQuantity": 0,
"Instrument": 0,
"Account": 0,
"AccountName": "",
"OrderType": "Limit",
"ClientOrderId": 0,
"OrderState": "Working",
"ReceiveTime": 0,
"ReceiveTimeTicks": 0,
"LastUpdatedTime": null,
"LastUpdatedTimeTicks": null,
"OrigQuantity": 0,
"QuantityExecuted": 0,
"GrossValueExecuted": 0,
"ExecutableValue": 0,
"AvgPrice": 0,
"CounterPartyId": 0,
"ChangeReason": "NewInputAccepted",
"OrigOrderId": 0,
"OrigClOrdId": 0,
"EnteredBy": 0,
"UserName": "",
"IsQuote": false,
"InsideAsk": null,
"InsideAskSize": null,
"InsideBid": null,
"InsideBidSize": null,
"LastTradePrice": 0,
"IsLockedIn": false,
"CancelReason": "",
"OMSId": 1,
"OrderFlag": "Unknown",
"UseMargin": false,
"StopPrice": 0,
"PegPriceType": "Unknown",
"PegOffset": 0,
"PegLimitOffset": 0,
"InstantAmount": null,
"InstantAmountExecuted": null
}
PUBLIC - get-products
Accepts the following message:
Returns an array of products and currencies available on the exchange. A product is an asset that is tradable or paid out.
Reply example
[
{
"OMSId": 1,
"ProductId": 1004,
"Product": "FXMUSICS01",
"ProductFullName": "FXMUSICS01",
"ProductType": "CryptoCurrency",
"decimalPlaces": 2,
"tickSize": 0.01,
"noFees": false
}
]
PUBLIC - GetL2Snapshot
Accepts the following message:
Provides a current Level 2 snapshot of a specific instrument trading on an Order Management System 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.
Depth in this call is 'depth of market', the number of buyers and sellers at greater or lesser prices in the order book for the instrument.
Reply example
[
[
0,
1,
123,
0,
0,
0,
0,
0,
0,
0
]
]
PUBLIC - GetTickerHistory
Accepts the following message:
Requests a ticker history (high, low, open, close, volume, bid, ask, ID) of a specific instrument from a given date to the present. 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.
Reply example
[
[
1671451200000,
228.9,
228.9,
228.9,
228.9,
0,
150,
228.9,
1,
1671451140000
],
[
1671451260000,
228.9,
228.9,
228.9,
228.9,
0,
150,
228.9,
1,
1671451200000
]
]
PRIVATE - GetTradesHistory
Accepts the following message:
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.
Caution: You must coordinate StartIndex, Depth, StartTimeStamp, and EndTimeStamp to retrieve the historical information you need. As the diagram shows, it is possible to specify values (for example, EndTimeStamp and Depth) that can exclude information you may want (the red areas).
Note: In this call, “Depth” refers not to the depth of the order book, but to the count of trades to report. The owner of the trading venue determines how long to retain order history before archiving.
Reply example
[
{
"OMSId": 0,
"ExecutionId": 0,
"TradeId": 0,
"OrderId": 0,
"AccountId": 0,
"AccountName": "",
"SubAccountId": 0,
"ClientOrderId": 0,
"InstrumentId": 0,
"Side": "Buy",
"OrderType": "Limit",
"Quantity": 0,
"RemainingQuantity": 0,
"Price": 0,
"Value": 0,
"CounterParty": "",
"OrderTradeRevision": 0,
"Direction": 0,
"IsBlockTrade": false,
"Fee": 0,
"FeeProductId": 0,
"OrderOriginator": 0,
"UserName": "",
"TradeTimeMS": 0,
"MakerTaker": "Maker",
"AdapterTradeId": 0,
"InsideBid": 0,
"InsideBidSize": 0,
"InsideAsk": 0,
"InsideAskSize": 0,
"IsQuote": 0,
"TradeTime": 0
}
]
PRIVATE - GetUserInfo
Accepts the following message:
Returns an object with the user data.
Reply example
{
"AccountId": 8719289677238762,
"DateTimeCreated": "2020-05-18T16:43:16.646Z",
"Email": "[email protected]",
"EmailVerified": true,
"Locked": false,
"Use2FA": false,
"UserId": 8719289677238762,
"UserName": "[email protected]"
}
PRIVATE - GetUserPermissions
Accepts the following message:
Returns the permissions for use.
Reply example
{
"output": [
"Trading",
"Deposit",
"Withdraw"
]
}
PRIVATE - GetWithdrawTickets
Accepts the following message:
Returns a limited array of withdrawal tickets from the specified Order Management System and account.
GetWithdrawTickets is usable with Operator and Trading permissions. It returns tickets from a logged account.
Reply example
{
"viewer": [
{
"AccountId": 8896771987272362,
"AssetId": 2,
"TemplateFormType": null,
"CreatedTimestamp": "2022-01-01T12:00:00.000Z",
"AssetName": "R$",
"Amount": 11,
"TicketNumber": 3835049411532886,
"Status": "FullyProcessed",
"LastUpdateTimestamp": "2022-01-01T12:30:00.000Z",
"FeeAmt": 10.099,
"TemplateForm": {
"language": "pt",
"fullName": "Member Name",
"bankNumber": "111",
"branchNumber": "1111",
"checkDigit1": null,
"bankAccountNumber": "11111",
"checkDigit2": "1",
"typeOfAcct": "Corrente"
},
"WithdrawTransactionDetails": "{\"TxId\":null}",
"WithdrawInfo": null
},
{
"AccountId": 8896771987272362,
"AssetId": 1,
"TemplateFormType": null,
"CreatedTimestamp": "2022-01-01T12:30:00.000Z",
"AssetName": "BTC",
"Amount": 0.5,
"TicketNumber": 6475565438197139,
"Status": "FullyProcessed",
"LastUpdateTimestamp": "2022-01-01T13:00:00.000Z",
"FeeAmt": 0.0004,
"TemplateForm": {
"TemplateType": "BitcoinRPCWithdraw",
"Comment": "BTC#DJZOO",
"ExternalAddress": "tb1ql0287w6gw4lhmuw80sndt2elx9ucw4pj5lntxt"
},
"WithdrawTransactionDetails": "{\"TxId\":null}",
"WithdrawInfo": {
"AccountProviderName": "Bitcoin",
"TXId": null,
"FromAddress": "",
"ToAddress": "tb1ql0287w6gw4lhmuw80sndt2elx9ucw4pj5lntxt",
"Comments": "https://blockchain.com/pt/btc/tx/"
}
}
]
}
PUBLIC - Logout
Accepts the following message:
LogOut ends the current websocket session.
Reply example
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
PRIVATE - SendOrder
Accepts the following message:
Creates an order.
Anyone submitting an order should also subscribe to the various market data and event feeds, or call GeOpenOrders 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.
Reply example
{
"status": "Accepted",
"errormsg": "",
"OrderId": 123
}
PRIVATE - SubscribeAccountEvents
Accepts the following message:
Subscribes the user to notifications about the status of account-level events: orders, trades, position updates, deposits, and withdrawals for a specific account on the Order Management System (OMS). The subscription reports all events associated with a given account; there is no filter at the call level to subscribe to some events and not others.
Reply example
{
"Subscribe": true
}
PUBLIC - SubscribeLevel1
Accepts the following message:
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.
Reply example
{
"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,
"Rolling24HrNotional": 0,
"Rolling24HrVolume": 4319.63870783,
"Rolling24NumTrades": 10585,
"Rolling24HrPxChange": -0.4165607307408487,
"TimeStamp": "1534862990358"
}
PUBLIC - SubscribeLevel1Markets
Accepts the following message:
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 Markets 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.
Reply example
[
{
"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,
"Rolling24HrNotional": 0,
"Rolling24HrVolume": 4319.63870783,
"Rolling24NumTrades": 10585,
"Rolling24HrPxChange": -0.4165607307408487,
"TimeStamp": "1534862990358"
}
]
PUBLIC - SubscribeLevel2
Accepts the following message:
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.
Reply example
[
[
0,
1,
123,
0,
0,
0,
0,
0,
0,
0
]
]
PUBLIC - SubscribeTicker
Accepts the following message:
Subscribes a user to a Ticker Market Data Feed for a specific instrument and interval. SubscribeTicker sends a response object as described below, and then periodically returns a TickerDataUpdateEvent that matches the content of the response object.
Only a user with Operator permission can issue a Level1MarketData permission using the call AddUserMarketDataPermission.
Reply example
[
[
1501603632000,
2700.33,
2701.268701,
2687.01,
2687.01,
24.86100992,
0,
2870.95,
1
],
[
1501604532000,
2792.73,
2667.95,
2687.01,
2700.81,
242.61340767,
0,
2871,
0
]
]
PUBLIC - SubscribeTrades
Accepts the following message:
Subscribes an authenticated user to the Trades Market Data Feed for a specific instrument. Each trade has two sides: Buy and Sell.
SubscribeTrades returns the response documented here for your immediate information, then periodically sends the OrderTradeEvent documented in SubscribeAccountEvents. Only a user with Operator permission can issue the permission Level1MarketData using the call AddUserMarketDataPermission.
Reply example
[
[
63,
1,
0.001,
9346,
"184",
"192",
1588191985835,
0,
1,
false,
0
]
]
PUBLIC - UnsubscribeLevel1
Accepts the following message:
Unsubscribes the user from a Level 1 Market Data Feed subscription.
Retry example
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
PUBLIC - UnsubscribeLevel2
Accepts the following message:
Unsubscribes the user from a Level 2 Market Data Feed subscription.
Retry example
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
PUBLIC - UnsubscribeTicker
Accepts the following message:
Unsubscribes the user from a Ticker Market Data Fee.
Reply example
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}
PUBLIC - UnsubscribeTrades
Accepts the following message:
Unsubscribes the user from a Trades Market Data Feed.
Retry example
{
"result": true,
"errormsg": null,
"errorcode": 0,
"detail": null
}