On this page

latest contributor to this doc

Last Edit:

@gcharang

best_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.

StructureTypeDescription
coinstringThe ticker of the coin to get best orders
actionstringWhether to buy or sell the selected coin
exclude_mineboolDefaults to false. If true, the users orders will be excluded from the response.
request_byobjectA standard RequestBy object.

StructureTypeDescription
ordersobject (map)the ticker -> array of standard [OrderData](/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

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

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

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