Trading API

Trading session using APIv4 and WebSocket API

Example. Trading session using APIv4 and WebSocket API

Standard limits for requests are 300 requests per minute for all endpoints (for PRO accounts - 1200 requests per minute). To minimize the number of requests per minute, we highly recommend using WebSocket API along with APIv4. Getting up-to-date information about the markets and your orders via WebSocket API allows you to spend the APIv4 limit only to create and cancel orders.

With our websocket server, you may receive almost instant updates for events you are interested in. Available sockets are divided to few categories: Market Streams, User Data Streams and Currencies Rate Stream.

You can get market information using WebSocket API:

Individual Symbol Ticker StreamThe <symbol>@ticker is a real-time data stream that provides updates on the latest trading price and other market data for a specific trading pair.
Individual Symbol Mini Ticker StreamThe <symbol>@miniTicker is a real-time data stream that provides updates on the latest trading price and other market data for a specific trading pair in a compact format.
All Market Tickers StreamThe arrTicker stream contains an array of Ticker objects, each representing a different trading pair on the exchange.
All Market Mini Tickers StreamThe arrMiniTicker stream contains an array of MiniTicker objects, each representing a different trading pair on the exchange.
OHLCVOHLCV is an acronym that stands for Open, High, Low, Close, and Volume and refers to a type of chart used to represent the price movement of a financial asset.
The <symbol>@ohlcv stream provides a continuous feed of the most recent OHLCV data for the specified trading pair. This data can be used to track the price movement of the trading pair over time and identify trends or patterns in the data and build charts for visualisation.
Diff. Depth StreamThis is full order book depth stream.
Fast diff. Depth StreamThis is faster full order book depth stream (update time 100ms).
Individual Symbol Trade StreamThe <symbol>@trade stream provides real-time updates for the latest trades executed for a specific trading pair. Each trade update includes information such as the trade ID, the price at which the trade was executed, the quantity of the asset traded, the timestamp of the trade, etc.
Individual Symbol Aggregated Trade StreamThe aggregated trade stream differs from the regular trade stream in that it provides summarized information for multiple trades executed at the same price and time, instead of individual updates for each trade. The stream also includes a trade ID representing the first and last trade executed in the aggregation, which can be used to reference the aggregated trades.
Rates StreamThe rates stream provides real-time updates for changes to a currencies rate. Each update includes information about changes reference currencies (for now they are USD, UAH, BTC, EUR) for each asset.

The full order book is available through this endpoint:

/v4/order/public/bookGet a list of order prices by pair.

Once you have received market information and have decided to open an order, please use the appropriate endpoint:

/v4/order/private/createCreate a new order.

To track the current status of orders, please use WebSocket API:

User Order UpdateThe order stream provides real-time updates for changes to a user's order. Each update includes information about the order, such as the order ID, the symbol, the order side (buy or sell), the order type (limit, market, etc.), the order status (open, filled, cancelled, etc.), and the price and quantity of the order.
New User Trade StreamThe trade stream provides real-time updates for new trades executed by a user. Each update includes information about the trade, such as the trade ID, the pair, the trade side (buy or sell), the price and quantity of the trade, the timestamp of the trade, etc.

You can also use WebSocket API to track balance changes in real time:

Account/Balance UpdateThe accounts stream provides real-time updates for changes to a user's account balances. Each update includes information about the account balance, such as the asset and the available and blocked balance on it.

To get the order history, please use the appropriate endpoints:

/v4/order/private/activeGet a list of client open orders by pair.
/v4/order/private/historyGet a list of client orders by pair.
/v4/trade/private/historyGet a list of trades by pair.
/v4/order/private/detailsGet order details by order id.
/v4/order/private/{id}/tradesGet all the trades, associated with the order id.

If you need to cancel an order, please use the appropriate endpoints:

/v4/order/private/cancelCancel an open order.
/v4/order/private/cancel/multiCancel several open orders at once.