Knowledge base
Overview
Available APIs Trading — WebSocket and REST Send new orders, cancel and modify existing orders Receive push notifications about status of orders, positions, balance changes, margin requirements (WS only) Retrieve......
Demo environment
Demo environment is located here: https://trading.demo.xena.io/ This is a completely dedicated environment that allows both testing integration and paper trading. To use the demo account, sign up, verify your email......
Common (static data)
Endpoints Environment REST base path Production https://api.xena.exchange/public Demo https://api.demo.xena.io/public Currencies GET {basePath}/currencies Field Possible values Description ticker string Short name of the currency title string Full name of the currency......
Trading API
TABLE OF CONTENTS Endpoints Authentication Keeping connection alive Client Order ID and Order ID Comments Retrieve status Websocket push notifications Status of a particular order Active orders Completed orders Orders......
Market Data API
TABLE OF CONTENTS Endpoints Websocket API Market watch Order book Candles Trades Current server time Endpoints Environment WS REST Production wss://api.xena.exchange/market-data/ws https://api.xena.exchange/market-data/ Demo wss://api.demo.xena.io/market-data/ws https://api.demo.xena.io/market-data/ Websocket API Establish the connection......
Transfers API
TABLE OF CONTENTS Endpoint Authentication Requesting an account list Retrieving deposit address Obtaining and renewing deposit addresses Retrieving balance information Retrieving list of trusted addresses Creating withdrawal requests Retrieving a......
Managing API keys
To create new keys for the API, sign in to your XENA account and navigate to the API Keys section. Each key grants access to one or two scopes: Trading......
Authentication
Connection to private APIs (Trading and Transfers) requires API keys. A key consists of two fields: the API Key (ID of the key) and the API Secret (the private key for the ECSDA......
WebSockets
Keeping connection alive (Heartbeats) The Logon (A) message, that you will receive from the server after successful authentication, will contain the heartbeat interval. The server expects that it receives at least one......
Serialization and Data Types
TABLE OF CONTENTS General rules Enumerations decimal ulong timestamp ExecInst (18) OrdStatus (39) OrdType (40) Side (54) TimeInForce (59) General rules Web socket messages use serialization based on FIX code......
Order status
Orders pass through several statuses during their lifecycle: The platform sends users updates regarding any change in an order's status. Users of the web-trading terminal can see these updates in......
Rate limits
The rate of requests to the trading API is limited. The following limits apply: Request typeRequests per secondRequests per minuteRequests per hour New orders 50 1000 30k Order cancellations 200......
Heartbeat (0)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M 0 Samples WS REST {"35":"0"} {"msgType":"0"} ...
ApplicationHeartbeat (XAH)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M XAH GrpId 5001 O string (40) HeartBtInt 1008 O int Timeout for the group in seconds (default is......
Logon (A)
TABLE OF CONTENTS Sent by client (Trading API) Sent by server (Trading API) Sent by server (Market data API) Sent by client (Trading API) Field name (REST) Field tag (WS)......
NewOrderSingle (D)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M D Account 1 M ulong Account ID ClOrdId 11 M string (40) Symbol 55 M string OrdType 40......
OrderStatusRequest (H)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M H Account 1 M ulong ClOrdID 11 O string (40) One of these fields must be provided OrderID......
ExecutionReport (8)
Please note, that the fields that require server-side enrichment (such as quantity, margin, SLTP, etc.) are not provided in the Execution Reports with ExecType == PendingXXX. All other execution reports......
OrderMassStatusRequest (AF)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M AF Account 1 M ulong MassStatusReqID 584 O string (40) If provided, will be returned by the server......
OrderMassStatusResponse (U8)
Field name (REST) Field tag (WS) Possible values Description MsgType H / 35 M U8 Account 1 M ulong ExecutionReports 1268 M Array of Execution Report (8) Orders falling under the......
RequestForPositions (AN)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M AN PosReqId 710 O string (40) Optional Request Id. If provided, it will be returned in the MassPositionReport Account......
MassPositionReport (MAP)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M MAP PosReqId 710 O string Request ID, if provided by the client Account 1 M ulong TransactTime 60......
PositionReport (AP)
TABLE OF CONTENTS Payment RelatedTrade Field name (REST) Field tag (WS) Possible values Description MsgType 35 M D Account 1 M ulong PositionId 1 M ulong TransactTime 60 M timestamp......
TradeCaptureReportRequest (AD)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M AD Account 1 M ulong TradeRequestID 568 O string (40) If submitted, will be returned in the MassTradeCaptureReport......
MassTradeCaptureReport (U9)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M U9 Account 1 M ulong ExecutionReports 1268 M Array of Execution Reports Trades satisfying the filter criteria TradeRequestID 568......
AccountStatusSnapshotRequest (XAA)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M XAA Account 1 M ulong AccountStatusRequestId 42513 O string (40) If provided, will be returned in the status report......
AccountStatusReportSnapshot (XAR) and AccountStatusReportIncrementalRefresh (XAF)
The only difference between these two messages is that the snapshot contains balances of all currencies, while the incremental refresh contains only records about the changed balance. In both cases......
MarginRequirementsReport (CJ)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M CJ Account 1 M ulong AccountStatusRequestId 42513 C string Populated in case the snapshot is generated in response......
MarginAmount component
MarginAmount Field name (REST) Field tag (WS) Possible values Description MarginAmt 1645 M decimal Margin amount MarginAmtType 1644 M 7 — CoreMargin (maintenance margin) 11 — InitialMargin MarginAmtCcy 1646 M......
OrderCancelRequest (F)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M F ClOrdId 11 M string (40) ID of the OrderCancelRequest OrigClOrdId 41 C string (40) One of these......
OrderCancelReject (9)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M D Account 1 M ulong Symbol 55 M string ClOrdId 11 M string ClOrdId of the cancel (cancel/replace)......
OrderMassCancelRequest (q)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M q ClOrdId 11 M string (40) ClOrdId of the request MassCancelRequestType 530 M 1 — CancelOrdersForASecurity 7 —......
OrderMassCancelReport (r)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M r ClOrdId 11 M string ClOrdId of the mass cancel request MassActionReportID 1369 M string MassCancelResponse 531 M......
OrderCancelReplaceRequest (M)
Please note, that it’s required to send all fields, but not only those affected by the change. For example, if you want to modify ExecInst of a stop order, you......
PositionMaintenanceRequest (AL)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M AL PosReqId 710 M string (40) ClOrdId of the request PosTransType 709 M 20 — Collapse PosMaintAction 712......
PositionMaintenanceReport (AM)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M AM PosReqId 710 M string ClOrdId of the request submitted by the client PosTransType 709 M 20 —......
MarketDataRequest (V)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M V MDStreamId 1500 M string Name of the stream SubscriptionRequestType 263 M 1 — SnapshotAndUpdates (use to subscribe)......
MarketDataSnapshotFullRefresh (W) and MarketDataIncrementalRefresh (X)
TABLE OF CONTENTS MDEntry Order book Trades Candles Market watch Field name (REST) Field tag (WS) Possible values Description MsgType 35 M W (snapshot) or X (increment) MDStreamId 1500 M......
MarketDataRequestReject (Y)
Field name (REST) Field tag (WS) Possible values Description MsgType 35 M Y MDStreamID 1500 M string RejectText 1328 M string Samples WS REST ...