Order Common Structures

orders_common_structuresstructuresorders_common_structures

1inchProtocolImage

Parameter Type Required Description
id string Protocol id.
title string Protocol title.
img string Link to protocol image.
img_color string Link to protocol image color.

1inchProtocolInfo

Parameter Type Required Description
name string Liquidity source name.
part numeric Protocol part.
from_token_address string From-token contract address.
to_token_address numeric To-token contract address.

1inchTokenInfo

Parameter Type Required Description
address string Token contract address.
symbol string Token symbol.
name string Token name.
decimals numeric Number of digits after decimal point for the token amount.
eip2612 boolean Is Eip-2612 supported.
is_fot boolean Is FoT token.
logo_uri string Token logo uri.
tags list of string Token tags.

1inchTxFields

Parameter Type Required Description
from string From address
to string To address
data string Transaction data
value numeric Transaction value
gas_price float Gas price
gas numeric Gas

CancelBy

Parameter Type Required Description
Type string All to cancel all orders; Pair to cancel all orders for specific coin pairs; Coin to cancel all orders for a specific coin
data object Optional. additional data the cancel condition; present with Pair and Coin types
data.base string Optional. base coin of the pair; Pair type only
data.rel string Optional. rel coin of the pair; Pair type only
data.ticker string Optional. order is cancelled if it uses ticker as base or rel; Coin type only
Show Examples

To cancel all orders for a specific coin:

{
  "type": "Coin",
  "data": {
    "ticker": "DOC"
  }
}

To cancel all orders for a specific pair:

{
  "type": "Pair",
  "data": {
      "base": "DOC",
      "rel": "MARTY"
  }
}

ConfSettings

Parameter Type Required Description
base_confs number Number of required confirmations on the base coin's blockchain for a transaction to complete an atomic swap event.
base_nota bool Whether dPoW notarization is required on the base coin's blockchain for a transaction to complete an atomic swap event.
rel_confs number Number of required confirmations on the rel coin's blockchain for a transaction to complete an atomic swap event.
rel_nota bool Whether dPoW notarization is required on the rel coin's blockchain for a transaction to complete an atomic swap event.
Show Example
{
  "conf_settings": {
    "base_confs": 2,
    "base_nota": true,
    "rel_confs": 5,
    "rel_nota": false
  }
}

MatchBy

Parameter Type Required Default Description
Type string Any Optional, defaults to Any. Any to match with any other order; Orders to select specific uuids; Pubkeys to select specific nodes
data array of strings Optional. A list of order uuids (to match for Orders type) or pubkeys of nodes (to match for Pubkeys type)
Show Examples
    "match_by": {
      "type": "Pubkeys",
      "data": [
        "0261eef15cbc141f555aff1aa40fb21de17a0a9e6897eee18c14c6032586b456b3",
        "036879df230663db4cd083c8eeb0f293f46abc460ad3c299b0089b72e6d472202c"        
      ]
    }

Match by order uuids:

    "match_by": {
      "type": "Orders",
      "data": [
        "6f65968f-e3c6-4978-98c5-5cec2bb5aa5b",
        "07ce08bf-3db9-4dd8-a671-854affc1b7a3"
      ]
    }

OrderAddress

Parameter Type Required Description
address_type string Generally Transparent, but may be Shielded for supporting coins.
address_data string The actual address text for sending and receiving funds.
Show Example
{
  "address_type": "Transparent",
  "address_data": "DEsCggcN3WNmaTkF2WpqoMQqx4JGQrLbPS"
}

OrderDataV1

Parameter Type Required Description
coin string The ticker of the coin
address string The address offering the trade
price string (decimal) The price the user is willing to buy or sell per one unit of the coin from request
price_rat rational The price represented as a standard RationalValue object.
price_fraction object The price represented as a standard FractionalValue object.
maxvolume string (decimal) The maximum amount of base the offer provider is willing to sell
max_volume_rat rational The max volume represented as a standard RationalValue object.
max_volume_fraction object The max volume represented as a standard FractionalValue object.
min_volume string (decimal) The minimum amount of base coin the offer provider is willing to sell
min_volume_rat rational The min volume represented as a standard RationalValue object.
min_volume_fraction object The min volume represented as a standard FractionalValue object.
pubkey string The pubkey of the offer provider
age number The age of the offer (in seconds)
zcredits number The zeroconf deposit amount (deprecated)
netid number The id of the network on which the request is made
uuid string The uuid of order
is_mine bool Whether the order is placed by me
base_max_volume string (decimal) The maximum amount of base coin the offer provider is willing to buy or sell
base_max_volume_rat rational The base_max_volume represented as a standard RationalValue object.
base_max_volume_fraction object The base_max_volume represented as a standard FractionalValue object.
base_min_volume string (decimal) The minimum amount of base coin the offer provider is willing to buy or sell
base_min_volume_rat rational The base_min_volume represented as a standard RationalValue object.
base_min_volume_fraction object The base_min_volume represented as a standard FractionalValue object.
base_confs number The confirmations settings of base coin set by the offer provider
base_nota bool The notarisation settings of base coin set by the offer provider
rel_max_volume string (decimal) The maximum amount of rel coin the offer provider is willing to buy or sell
rel_max_volume_rat rational The rel_max_volume max volume represented as a standard RationalValue object.
rel_max_volume_fraction object The rel_max_volume max volume represented as a standard FractionalValue object.
rel_min_volume string (decimal) The minimum amount of rel coin the offer provider is willing to buy or sell
rel_min_volume_rat rational The rel_min_volume represented as a standard RationalValue object.
rel_min_volume_fraction object The rel_min_volume represented as a standard FractionalValue object.
rel_confs number The confirmations settings of rel coin set by the offer provider
rel_nota bool The notarisation settings of rel coin set by the offer provider
original_tickers list (string) Tickers included in response when orderbook_ticker is configured for the queried coin in coins file

OrderDataV2

Parameter Type Required Description
coin string The ticker of the coin
address object A standard OrderAddress object.
price object A standard NumericFormatsValue object representing the coin price.
base_min_volume object A standard NumericFormatsValue object representing the minimum base volume.
base_max_volume object A standard NumericFormatsValue object representing the maximum base volume.
base_max_volume_aggr object Orderbook (v2) only. A standard NumericFormatsValue object representing the maximum aggregated base amount at the specified price. The sum of max base volumes of the current order and all orders with a worse price.
rel_min_volume object A standard NumericFormatsValue object representing the minimum rel volume.
rel_max_volume object A standard NumericFormatsValue object representing the maximum rel volume.
rel_max_volume_aggr object Orderbook (v2) only. A standard NumericFormatsValue object representing the maximum aggregated rel amount at the specified price. The sum of max rel volumes of the current order and all orders with a worse price.
pubkey string The pubkey of the offer provider
uuid string The uuid of order
is_mine bool Whether the order is placed by me
conf_settings object A standard ConfSettings object.

OrderStatusData

Parameter Type Required Description
base string base currency
rel string rel currency
price number order price as decimal number
price_rat rational number order price as rational number
max_base_vol number Maximum trade volume
max_base_vol_rat rational number Maximum trade volume as rational number
min_base_vol number Minimum trade volume
min_base_vol_rat rational number Minimum trade volume as rational number
created_at number Timestamp of order creation
updated_at number Timestamp of last order update
matches list UUIDS of matching orders
started_swaps list UUIDS of swaps started
uuid string UUID of this order
conf_settings object Confirmation / Notarisation settings for order
base_orderbook_ticker string The ticker of the base currency if orderbook_ticker is configured for the base currency in coins file. If not defined, will return a null value.
rel_orderbook_ticker string The ticker of the rel currency if orderbook_ticker is configured for the rel currency in coins file. If not defined, will return a null value.
cancellable boolean true if order is in a state which it can be cancelled. false if not (e.g. swap is in progress)
cancellation_reason string Cancelled indicates order was withdrawn by user. Fulfilled indicates order was swapped successfully. TimedOut indicates a taker order with type FillOrKill expired before matching.
available_amount string Funds available for order to be matched against, taking into account current spendable balance and max_volume
Show Examples
{
  "available_amount": "1",
  "base": "DOC",
  "cancellable": true,
  "created_at": 1568808684710,
  "matches": {
    "60aaacca-ed31-4633-9326-c9757ea4cf78": {
      "connect": {
        "dest_pub_key": "c213230771ebff769c58ade63e8debac1b75062ead66796c8d793594005f3920",
        "maker_order_uuid": "fedd5261-a57e-4cbf-80ac-b3507045e140",
        "method": "connect",
        "sender_pubkey": "5a2f1c468b7083c4f7649bf68a50612ffe7c38b1d62e1ece3829ca88e7e7fd12",
        "taker_order_uuid": "60aaacca-ed31-4633-9326-c9757ea4cf78"
      },
      "connected": {
        "dest_pub_key": "5a2f1c468b7083c4f7649bf68a50612ffe7c38b1d62e1ece3829ca88e7e7fd12",
        "maker_order_uuid": "fedd5261-a57e-4cbf-80ac-b3507045e140",
        "method": "connected",
        "sender_pubkey": "c213230771ebff769c58ade63e8debac1b75062ead66796c8d793594005f3920",
        "taker_order_uuid": "60aaacca-ed31-4633-9326-c9757ea4cf78"
      },
      "last_updated": 1560529572571,
      "request": {
        "action": "Buy",
        "base": "DOC",
        "base_amount": "1",
        "dest_pub_key": "0000000000000000000000000000000000000000000000000000000000000000",
        "method": "request",
        "rel": "MARTY",
        "rel_amount": "1",
        "sender_pubkey": "5a2f1c468b7083c4f7649bf68a50612ffe7c38b1d62e1ece3829ca88e7e7fd12",
        "uuid": "60aaacca-ed31-4633-9326-c9757ea4cf78"
      },
      "reserved": {
        "base": "DOC",
        "base_amount": "1",
        "dest_pub_key": "5a2f1c468b7083c4f7649bf68a50612ffe7c38b1d62e1ece3829ca88e7e7fd12",
        "maker_order_uuid": "fedd5261-a57e-4cbf-80ac-b3507045e140",
        "method": "reserved",
        "rel": "MARTY",
        "rel_amount": "1",
        "sender_pubkey": "c213230771ebff769c58ade63e8debac1b75062ead66796c8d793594005f3920",
        "taker_order_uuid": "60aaacca-ed31-4633-9326-c9757ea4cf78"
      }
    }
  },
  "max_base_vol": "1",
  "max_base_vol_rat": [
    [1, [1]],
    [1, [1]]
  ],
  "min_base_vol": "0",
  "min_base_vol_rat": [
    [0, []],
    [1, [1]]
  ],
  "price": "1",
  "price_rat": [
    [1, [1]],
    [1, [1]]
  ],
  "rel": "AVAX",
  "started_swaps": ["60aaacca-ed31-4633-9326-c9757ea4cf78"],
  "uuid": "ea77dcc3-a711-4c3d-ac36-d45fc5e1ee0c"
}

OrderDataV1

Parameter Type Required Description
coin string The ticker of the coin
address string The address offering the trade
price string (decimal) The price the user is willing to buy or sell per one unit of the coin from request
price_rat rational The price represented as a standard RationalValue object.
price_fraction object The price represented as a standard FractionalValue object.
maxvolume string (decimal) The maximum amount of base the offer provider is willing to sell
max_volume_rat rational The max volume represented as a standard RationalValue object.
max_volume_fraction object The max volume represented as a standard FractionalValue object.
min_volume string (decimal) The minimum amount of base coin the offer provider is willing to sell
min_volume_rat rational The min volume represented as a standard RationalValue object.
min_volume_fraction object The min volume represented as a standard FractionalValue object.
pubkey string The pubkey of the offer provider
age number The age of the offer (in seconds)
zcredits number The zeroconf deposit amount (deprecated)
netid number The id of the network on which the request is made
uuid string The uuid of order
is_mine bool Whether the order is placed by me
base_max_volume string (decimal) The maximum amount of base coin the offer provider is willing to buy or sell
base_max_volume_rat rational The base_max_volume represented as a standard RationalValue object.
base_max_volume_fraction object The base_max_volume represented as a standard FractionalValue object.
base_min_volume string (decimal) The minimum amount of base coin the offer provider is willing to buy or sell
base_min_volume_rat rational The base_min_volume represented as a standard RationalValue object.
base_min_volume_fraction object The base_min_volume represented as a standard FractionalValue object.
base_confs number The confirmations settings of base coin set by the offer provider
base_nota bool The notarisation settings of base coin set by the offer provider
rel_max_volume string (decimal) The maximum amount of rel coin the offer provider is willing to buy or sell
rel_max_volume_rat rational The rel_max_volume max volume represented as a standard RationalValue object.
rel_max_volume_fraction object The rel_max_volume max volume represented as a standard FractionalValue object.
rel_min_volume string (decimal) The minimum amount of rel coin the offer provider is willing to buy or sell
rel_min_volume_rat rational The rel_min_volume represented as a standard RationalValue object.
rel_min_volume_fraction object The rel_min_volume represented as a standard FractionalValue object.
rel_confs number The confirmations settings of rel coin set by the offer provider
rel_nota bool The notarisation settings of rel coin set by the offer provider
original_tickers list (string) Tickers included in response when orderbook_ticker is configured for the queried coin in coins file

OrderDataV2

Parameter Type Required Description
coin string The ticker of the coin
address object A standard OrderAddress object.
price object A standard NumericFormatsValue object representing the coin price.
base_min_volume object A standard NumericFormatsValue object representing the minimum base volume.
base_max_volume object A standard NumericFormatsValue object representing the maximum base volume.
base_max_volume_aggr object Orderbook (v2) only. A standard NumericFormatsValue object representing the maximum aggregated base amount at the specified price. The sum of max base volumes of the current order and all orders with a worse price.
rel_min_volume object A standard NumericFormatsValue object representing the minimum rel volume.
rel_max_volume object A standard NumericFormatsValue object representing the maximum rel volume.
rel_max_volume_aggr object Orderbook (v2) only. A standard NumericFormatsValue object representing the maximum aggregated rel amount at the specified price. The sum of max rel volumes of the current order and all orders with a worse price.
pubkey string The pubkey of the offer provider
uuid string The uuid of order
is_mine bool Whether the order is placed by me
conf_settings object A standard ConfSettings object.

OrderSummaryData

Parameter Type Required Description
uuid string uuid of the order
order_type string Type of the order; "Maker" or "Taker"
base string base coin of the order
rel string rel coin of the order
price number (decimal) price of the order
volume number (decimal) volume of the order
created_at number unix timestamp in milliseconds, indicating the order creation time
last_updated number unix timestamp in milliseconds, indicating the time the order was last updated
Was_taker number 1 if the order was a "Taker" order that got converted to "Maker", 0 otherwise
status string status of the Order

OrderType

Parameter Type Required Description
Type string There are two types from which to choose: GoodTillCancelled and FillOrKill. The GoodTillCancelled order is automatically converted to a maker order if the order is not matched in 30 seconds, and this maker order stays in the orderbook until explicitly cancelled. On the other hand, a FillOrKill order is cancelled if it is not matched within 30 seconds. The default type is GoodTillCancelled
Show Examples

GoodTillCancelled orders will remain on the orderbook until they are exhausted or explicitly cancelled.

  {
    "order_type": {
      "type": "GoodTillCancelled"
    }
  }

FillOrKill orders will be automatically cancelled if they are not matched within 60 seconds.

  {
    "order_type": {
      "type": "FillOrKill"
    }
  }

RequestBy

Parameter Type Required Description
type integer Defines whether requesting by volume or by number.
value numeric string If type is volume, the amount of coin (defined in the parent object) the user is willing to buy or sell. If type is number, the number of best price trades to return.
Show Example

Filter response to return the best trades for up to 20 of the coin defined in the parent object:

{
  "request_by": {
    "type": "volume",
    "value": 20
  }
}

Filter response to return the 10 best priced trades:

{
  "type": "number",
  "value": 10
}

PairDepth

Used in orderbook_depth responses to represent the depth information for a trading pair.

Parameter Type Required Description
pair string Trading pair name
asks array of [decimal] Array of ask price levels
bids array of [decimal] Array of bid price levels

DepthInfo

Used within PairDepth objects to represent ask and bid counts.

Parameter Type Required Description
asks number The number of asks for this trading pair
bids number The number of bids for this trading pair
Show Example
{
  "pair": ["DOC", "MARTY"],
  "depth": {
    "asks": 2,
    "bids": 6
  }
}