Trading

All endpoints in this section require authentication

Order types

Market — an order that the Client makes through Order Book to buy or sell Symbol immediately at the best price currently available. The Price field should be missing if the order type is Market. Please contact our support or your account-manager if you need market order type or additional order types.

Limit — an order placed by Client through Order Book to buy or sell an amount of current trading pair at a specified price or better. Both quantity and price fields should be filled if the order type is Limit. Because the limit order is not a market order, it may not be executed if the price set by the Client cannot be met during the period of time, in which the order is left open.
 After being placed, Limit orders can be:

  1. Fully executed immediately

  2. Not executed immediately, and left open to be fully of partially executed, or cancelled

  3. Partially executed immediately and have open outstanding amount waiting to be fully or partially executed, or cancelled.

  4. Fill-or-Kill - cancelled completely if not executed immediately.

Stop— a stop order is used to trigger a market sell when the market drops to your trigger price or used to trigger a market buy if the market rises to your trigger price. This is often used as a stop-loss order if the market is moving in an unfavourable direction. Stop orders will fully execute as a market order once the trigger price is reached.

Example: If the current market price is 50 000, the trader in a long position might want to sell if the price drops to 49 900 to avoid further losses. A stop sell at 49 900 will be used in this case.

Example: If the current market price is 50 000, the trader in a short position might want to buy if the price reaches 50 100 to avoid further losses. A stop buy at 50 100 will be used in this case.

Stop-Limit— a stop-limit order triggers a limit order. With a stop-limit, the trader sets a stop price at which the order is triggered and a limit price at which the order may be filled. Once the stop of a stop-limit order is triggered, the limit order is automatically placed.

Example: If a trader would like to buy once the market price reaches 50 000, but not pay more than 50 100, then a stop price of 50 000 and limit price of 51 000 will be specified at the same time using a stop-limit order. If the market price reaches 50 000, the order is triggered and will match the best available asks up to 50 100. If the market price moves to 50 101 or above, then the order may go partially unfilled due to the limit price.

Get trades

Description

This endpoint retrieves your executed trades with its price, volume, and direction. Trades are sorted in reverse creation order.

HttpRequest

GET https://trade.nebulaecn.com/api/v2/backend/market/trades

Request Parameters

Response Content

Cancel an order

Description

Submit cancel request, cancels order from orderbook.

HttpRequest

POST https://trade.nebulaecn.com/api/v2/trading/market/orders/cancel/{id|uuid}

Responses

Cancel orders

Description

Submit cancel request, cancels all your orders from orderbook.

HttpRequest

POST https://trade.nebulaecn.com/api/v2/trading/market/orders/cancel

Request Parameters (JSON)

Responses

Example

curl -X POST https://trade.nebulaecn.com/api/v2/trading/market/orders/cancel/1 \
-H 'Content-Type: application/json'
curl -X POST https://trade.nebulaecn.com/api/v2/trading/market/orders/cancel/b47d2527-5a0c-11ea-822c-1831bf9834b0 \
-H 'Content-Type: application/json'

Create an order

Description

Submit a new order to API. Notice that while the response from the server is ok, the order can still be rejected by the matching engine. You should wait the confirmation from the websocket to be sure that your order has been added to the orderbook.

HttpRequest

POST https://trade.nebulaecn.com/api/v2/trading/market/orders

Request Parameters (JSON)

Response Content

Example Request

curl -X POST https://trade.nebulaecn.com/api/v2/trading/market/orders \
  --data '{"market":"btcusd", "amount":"1.0","type":"limit", "side":"sell", "price":"1"}' \
  -H 'Content-Type: application/json'

Example Answer (JSON)

{
 "uuid":"b436163d-5c73-11ea-be71-1831bf9834b0",
 "side":"sell",
 "type":"limit",
 "market_id":"btcusd",
 "volume":"1",
 "price":"1",
 "state":"pending",
 "created_at":1583146260
 }

Create a list of orders

Description

Bulk api to create a list of orders in one request. The default limit is set to 100 orders for one request, this might be configured by support.

HttpRequest

POST https://trade.nebulaecn.com/api/v2/trading/market/bulk/orders

Request Parameters (JSON)

Responses

Example

curl -X POST https://trade.nebulaecn.com/api/v2/trading/market/bulk/orders \
  --data '[{"market":"btcusd", "amount":"1.0","type":"limit", "side":"sell", "price":"1"}, {"market":"btcusd", "amount":"1.0","type":"limit", "side":"sell", "price":"1"}]' \
-H 'Content-Type: application/json'
[{"uuid":"b76aef45-5c73-11ea-be71-1831bf9834b0","side":"sell","type":"limit","market_id":"btcusd","volume":"1","price":"1","state":"pending","created_at":1583146265},{"uuid":"b76afa8b-5c73-11ea-be71-1831bf9834b0","side":"sell","type":"limit","market_id":"btcusd","volume":"1","price":"1","state":"pending","created_at":1583146265}]

Cancel orders by UUID

Description

Bulk api to cancel orders.

HttpRequest

DELETE https://trade.nebulaecn.com/api/v2/trading/market/bulk/orders

Request Parameters (JSON)

Responses

Example

curl -X DELETE https://trade.nebulaecn.com/api/v2/trading/market/bulk/orders \
 --data '["580d891d-5c8b-11ea-a012-1831bf9834b0", "580d891d-5c8b-11ea-a012-1831bf9834b0"]' \
-H 'Content-Type: application/json'
"orders.cancel.accepted"

Cancel orders by ID

Description

Bulk api to cancel orders.

HttpRequest

DELETE https://trade.nebulaecn.com/api/v2/trading/market/bulk/orders_by_id

Request Parameters (JSON)

Responses

Example

curl -X DELETE https://trade.nebulaecn.com/api/v2/trading/market/bulk/orders_by_id \
--data '[1, 2, 3, 4]' \
-H 'Content-Type: application/json'
"orders.cancel.accepted"

Get orders

Description

Get your orders, result is paginated.

HttpRequest

GET https://trade.nebulaecn.com/api/v2/backend/market/orders

Request Parameters

Response Content

Get specified order

Description

Get information of specified order.

HttpRequest

GET https://trade.nebulaecn.com/api/v2/backend/market/orders/{id}

Request Parameters

Response Content

Last updated