On this page

latest contributor to this doc

Last Edit:

@gcharang

Order Common Structures

structuresorders_common_structures

Parameter* = requiredTypeDescription
id*
string
Protocol id.
img*
string
Link to protocol image.
img_color*
string
Link to protocol image color.
title*
string
Protocol title.

Parameter* = requiredTypeDescription
from_token_address*
string
From-token contract address.
name*
string
Liquidity source name.
part*
numeric
Protocol part.
to_token_address*
numeric
To-token contract address.

Parameter* = requiredTypeDescription
address*
string
Token contract address.
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.
name*
string
Token name.
symbol*
string
Token symbol.
tags*
list of string
Token tags.

Parameter* = requiredTypeDescription
data*
string
Transaction data
from*
string
From address
gas*
numeric
Gas
gas_price*
float
Gas price
to*
string
To address
value*
numeric
Transaction value

Parameter* = requiredTypeDescription
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

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"
  }
}

Parameter* = requiredTypeDescription
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.
{
  "conf_settings": {
    "base_confs": 2,
    "base_nota": true,
    "rel_confs": 5,
    "rel_nota": false
  }
}

Parameter* = requiredTypeDescription
data
array of strings
Optional. A list of order uuids (to match for Orders type) or pubkeys of nodes (to match for Pubkeys type)
Type
string
default: Any
Optional, defaults to Any. Any to match with any other order; Orders to select specific uuids; Pubkeys to select specific nodes
    "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"
      ]
    }

Parameter* = requiredTypeDescription
address_data*
string
The actual address text for sending and receiving funds.
address_type*
string
Generally Transparent, but may be Shielded for supporting coins.
{
  "address_type": "Transparent",
  "address_data": "DEsCggcN3WNmaTkF2WpqoMQqx4JGQrLbPS"
}

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

Parameter* = requiredTypeDescription
address
object
Optional. A standard OrderAddress object.
base_max_volume
object
Optional. A standard NumericFormatsValue object representing the maximum base volume.
base_max_volume_aggr
object
Optional. 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.
base_min_volume
object
Optional. A standard NumericFormatsValue object representing the minimum base volume.
coin
string
Optional. The ticker of the coin
conf_settings
object
Optional. A standard ConfSettings object.
is_mine
bool
Optional. Whether the order is placed by me
price
object
Optional. A standard NumericFormatsValue object representing the coin price.
pubkey
string
Optional. The pubkey of the offer provider
rel_max_volume
object
Optional. A standard NumericFormatsValue object representing the maximum rel volume.
rel_max_volume_aggr
object
Optional. 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.
rel_min_volume
object
Optional. A standard NumericFormatsValue object representing the minimum rel volume.
uuid
string
Optional. The uuid of order

Parameter* = requiredTypeDescription
available_amount*
string
Funds available for order to be matched against, taking into account current spendable balance and max_volume
base*
string
base currency
cancellable*
boolean
true if order is in a state which it can be cancelled. false if not (e.g. swap is in progress)
conf_settings*
object
Confirmation / Notarisation settings for order
created_at*
number
Timestamp of order creation
matches*
list
UUIDS of matching orders
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
price*
number
order price as decimal number
price_rat*
rational number
order price as rational number
rel*
string
rel currency
started_swaps*
list
UUIDS of swaps started
updated_at*
number
Timestamp of last order update
uuid*
string
UUID of this order
base_orderbook_ticker
string
Optional. 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.
cancellation_reason
string
Optional. Cancelled indicates order was withdrawn by user. Fulfilled indicates order was swapped successfully. TimedOut indicates a taker order with type FillOrKill expired before matching.
rel_orderbook_ticker
string
Optional. 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.
{
  "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"
}

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

Parameter* = requiredTypeDescription
address
object
Optional. A standard OrderAddress object.
base_max_volume
object
Optional. A standard NumericFormatsValue object representing the maximum base volume.
base_max_volume_aggr
object
Optional. 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.
base_min_volume
object
Optional. A standard NumericFormatsValue object representing the minimum base volume.
coin
string
Optional. The ticker of the coin
conf_settings
object
Optional. A standard ConfSettings object.
is_mine
bool
Optional. Whether the order is placed by me
price
object
Optional. A standard NumericFormatsValue object representing the coin price.
pubkey
string
Optional. The pubkey of the offer provider
rel_max_volume
object
Optional. A standard NumericFormatsValue object representing the maximum rel volume.
rel_max_volume_aggr
object
Optional. 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.
rel_min_volume
object
Optional. A standard NumericFormatsValue object representing the minimum rel volume.
uuid
string
Optional. The uuid of order

Parameter* = requiredTypeDescription
base*
string
base coin 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
order_type*
string
Type of the order; "Maker" or "Taker"
price*
number (decimal)
price of the order
rel*
string
rel coin of the order
status*
string
status of the Order
uuid*
string
uuid of the order
volume*
number (decimal)
volume of the order
Was_taker*
number
1 if the order was a "Taker" order that got converted to "Maker", 0 otherwise

Parameter* = requiredTypeDescription
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

If your order includes UTXO coins activated via electrum, and connection to its servers is lost, your order will automatically cancel and will need to be recreated once the connection is restored.

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"
    }
  }

Parameter* = requiredTypeDescription
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.

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
}

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

Parameter* = requiredTypeDescription
asks*
array of [decimal]
Array of ask price levels
bids*
array of [decimal]
Array of bid price levels
pair*
string
Trading pair name

Used within PairDepth objects to represent ask and bid counts.

Parameter* = requiredTypeDescription
asks*
number
The number of asks for this trading pair
bids*
number
The number of bids for this trading pair
{
  "pair": ["DOC", "MARTY"],
  "depth": {
    "asks": 2,
    "bids": 6
  }
}