Cross specific API functions

Orders

Cross Add Order

Adds an order to the crossing network

POST /v0/add_order

Name Type Description Example Required
cancelAbove string max price at which the order should be filled, will be canceled if oracle price exceeds this "22000" No
cancelBelow string min price at which the order should be filled, will be canceled if oracle price goes lower than this "18000" No
customerOrderId string an order ID that the customer can pass in for their own reference "abc123" No
expirationUnix long when the placed order will expire and be automatically cancelled, in seconds from the unix epoch. Must be less than a year in the future. A value of 0 is ignored. 1665515317 No
orderCategory string the order category "CN" Yes
pair https://enclave-markets.notion.site/Cross-REST-API-4326701d5c0048f7b9eb51ac15e711ce an encapsulated subtype see type description Yes
side string the type of order the customer would like to place "SELL" Yes
size string If side is “BUY”, this is the amount of quote currency to spend. If side is “SELL”, this is the amount of base currency to sell.

For BTC/USD for example, if you place a buy order of size 1, that means you will be buying BTC, and spending $1 to get it. If you place a sell order of size 1, that means you will sell 1 BTC.

Note: In Enclave Cross, there is no price submitted on the order and all orders happen at the oracle price. Because of this, the size specifies how much of the currency you will be giving up to acquire the other currency. This is different than typical limit order books. | "0.1" | Yes |

CurrencyPair

Name Type Description Example Required
base string the base coin of the currency pair "AVAX" Yes
quote string the quote coin of the currency pair "ETH" Yes

Request:

{
  "cancelAbove": "22000",
  "cancelBelow": "18000",
  "customerOrderId": "abc123",
  "expirationUnix": 1665515317,
  "orderCategory": "CN",
  "pair": {
    "base": "AVAX",
    "quote": "ETH"
  },
  "side": "SELL",
  "size": "0.1"
}

Encapsulated in generic response wrapper:

Name Type Description Example Required
accountId string the ID associated with the customer account "5577006791947779410" Yes
customerOrderId string the optional ID provided by the customer "abc123" No
exchangedSize string the opposite size after fees in the fills "3" Yes
filledSize string the filled size of the order "7.5" Yes
internalOrderId string the internal id of the order "1436105356947779827" Yes
isCancelled boolean whether the order has been manually canceled, price has gone outside allowed range, or order has expired false Yes
isFilled boolean whether the order has been fully filled false Yes
orderCategory string the category of the order [CN] "CN" Yes
pair https://enclave-markets.notion.site/Cross-REST-API-4326701d5c0048f7b9eb51ac15e711ce an encapsulated subtype see type description Yes
remainingSize string the remaining size of the order to fill "2.5" Yes
side string the type of the order [BUY, SELL] "SELL" Yes
size string the size of the order "10" Yes
updatedAt dateTime the lastest time the order was updated "2022-11-15T16:18:12.049289984Z" Yes

CurrencyPair

Name Type Description Example Required
base string the base coin of the currency pair "AVAX" Yes
quote string the quote coin of the currency pair "ETH" Yes

Response:

{
  "result": {
    "accountId": "5577006791947779410",
    "customerOrderId": "abc123",
    "exchangedSize": "3",
    "filledSize": "7.5",
    "internalOrderId": "1436105356947779827",
    "isCancelled": false,
    "isFilled": false,
    "orderCategory": "CN",
    "pair": {
      "base": "AVAX",
      "quote": "ETH"
    },
    "remainingSize": "2.5",
    "side": "SELL",
    "size": "10",
    "updatedAt": "2022-11-15T16:18:12.049289984Z"
  },
  "success": true
}

Cancel Order

Cancels an order

POST /v0/cancel_order

Requires authentication: true

Name Type Description Example Required
internalOrderId string The order ID returned on order creation "5577006791947779410" No
customerOrderId string The order ID passed by the user on placement "5577006791947779410" No

Cannot use both internal ID and customer ID in a request

Request (using internal order ID):

{
  "internalOrderId": "1436105356947779827"
}

Request (using customer order ID):

{
  "customerOrderId": "abc123"
}