On this page

latest contributor to this doc

Last Edit:

@smk762

Best Orders

API-v2best_orders

The best_orders method returns the best priced trades available on the orderbook. There are two options for the request, either volume or number. If request is made by volume, the returned results will show the best prices for trades that can fill the requested volume. If request is made by number, the returned results will show a list of the best prices, number pairs long (e.g. top 5 best priced orders). For coins with segwit, they may appear twice in the output (once for each address). E.g. LTC and LTC-segwit

The response of this method can contain coins that are not activated on the Komodo DeFi Framework API instance. Activation will be required to proceed with the trade.

ParameterTypeRequiredDefaultDescription
actionstring-A standard ActionEnum enum. Whether to buy or sell the selected coin.
coinstring-The ticker of the coin to get best orders.
exclude_mineboolfalseIf true, the users orders will be excluded from the response.
request_byobject-A standard RequestBy object.

ParameterTypeDescription
ordersobject (map)The ticker -> array of standard [OrderData](/en/docs/komodo-defi-framework/api/common_structures/orders/#order-data) objects map.
original_tickerslist (string)Tickers included in response when orderbook_ticker is configured for the queried coin in coins file.

Best Orders by Number

POST
best_orders
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "best_orders",
  "mmrpc": "2.0",
  "params": {
    "coin": "DGB",
    "action": "buy",
    "request_by": {
      "type": "number",
      "value": 100
    }
  }
}

Best Orders by Number (Exclude Own)

POST
best_orders
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "best_orders",
  "mmrpc": "2.0",
  "params": {
    "coin": "DGB",
    "action": "buy",
    "exclude_mine": true,
    "request_by": {
      "type": "number",
      "value": 100
    }
  }
}

Best Orders by Volume

POST
best_orders
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "best_orders",
  "mmrpc": "2.0",
  "params": {
    "coin": "BTC",
    "action": "buy",
    "request_by": {
      "type": "volume",
      "value": 0.01
    }
  }
}

ParameterTypeDescription
InvalidRequeststringReturned if the request type or action is invalid (e.g., number value must be integer, or type/action is not allowed).
CoinIsWalletOnlystringReturned if the coin is wallet only and cannot be traded.
P2PErrorstringReturned if there is a connection problem.