Trade Data API

Execute trades on exchanges through HTS

All the trade endpoints require a signature

Execute

Place spot order

Required input:

  • accountGuid: the guid of the account

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • price : the price on which the order is placed. Use 0 for market order.

  • amount : the amount of the order is the base currency.

  • timeout : order timeout in seconds (optional)

  • templateGuid : the guid of the template executed (optional).

  • userGuid : custom guid (optional)

Returns:

The executing template guid.

Example URL:

http://127.0.0.1:8050/PlaceSpotBuyOrder?accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&priceSourceName=Bittrex&primaryCoin=BTC&secondaryCoin=USDT&price=100&amount=1
http://127.0.0.1:8050/PlaceSpotSellOrder?accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&priceSourceName=Bittrex&primaryCoin=BTC&secondaryCoin=USDT&price=100&amount=1

Place margin/leverage order

Required input:

  • accountGuid : the guid of the account

  • primaryCoin : primary coin of the market.

  • secondaryCoin : secondary coin of the market.

  • contractName : contract name of the market

  • price : the price on which the order is placed. Use 0 for market order.

  • amount : the amount of the order is the base currency.

  • leverage : the leverage of the order.

  • timeout : order timeout in seconds (optional)

  • templateGuid : the guid of the template executed (optional).

  • userGuid : custom guid (optional)

Returns:

The executing template guid.

Example URL:

http://127.0.0.1:8050/PlaceLeverageEnterLongOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100&amount=1&leverage=1
http://127.0.0.1:8050/PlaceLeverageEnterShortOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100000&amount=1&leverage=1
http://127.0.0.1:8050/PlaceLeverageExitLongOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100&amount=1&leverage=1
http://127.0.0.1:8050/PlaceLeverageExitShortOrder?accountGuid=55c658c6-aa81-4f08-9e24-e0db446d11cb&primaryCoin=XBT&secondaryCoin=USD&contractName=XBTUSD&price=100000&amount=1&leverage=1

Cancel

Cancel template

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

A boolean indicating if the cancel is started.

Example URL:

http://127.0.0.1:8050/CancelTemplate?templateGuid=ea25296b-2c83-4e88-b0ff-680394a22f0f

Cancel order

Required input:

  • accountGuid : the account guid on which the order is active.

  • orderGuid : the order returned in GetOpenOrders()

Returns:

`EnumOrderStatus`

Example URL:

http://127.0.0.1:8050/CancelOrder?accountGuid=43b1c5f8-31d4-45c0-9163-81b1443146b4&orderGuid=ea25296b-2c83-4e88-b0ff-680394a22f0f

Status

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

`EnumOrderStatus`

Example URL:

http://127.0.0.1:8050/GetTemplateStatus?templateGuid=02264ffa-ac1f-4976-8228-8227a1a09298

Get Template Associated Order Guids

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

List with order guids

Example URL:

http://127.0.0.1:8050/GetTemplateAssociatedOrderGuids?templateGuid=02264ffa-ac1f-4976-8228-8227a1a09298

Get Template Associated Orders

Required input:

  • templateGuid : the guid of the template which is returned by the place order endpoint. This is not the same as the open order id in GetOpenOrders()

Returns:

List with orders

Example URL:

http://127.0.0.1:8050/GetTemplateAssociatedOrders?templateGuid=02264ffa-ac1f-4976-8228-8227a1a09298

Last updated