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:
The |
|
The |
|
The |
|
The |
|
OHLCV 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. |
|
This is full order book depth stream. |
|
This is faster full order book depth stream (update time 100ms). |
|
The |
|
The 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. |
|
The |
The full order book is available through this endpoint:
/v4/order/public/book | Get 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/create | Create a new order. |
To track the current status of orders, please use WebSocket API:
User Order Update | The 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 Stream | The 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 Update | The 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/active | Get a list of client open orders by pair. |
/v4/order/private/history | Get a list of client orders by pair. |
/v4/trade/private/history | Get a list of trades by pair. |
/v4/order/private/details | Get order details by order id. |
/v4/order/private/{id} /trades | Get all the trades, associated with the order id. |
If you need to cancel an order, please use the appropriate endpoints:
/v4/order/private/cancel | Cancel an open order. |
/v4/order/private/cancel/multi | Cancel several open orders at once. |
Updated 5 days ago