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.
| Structure | Type | Description |
|---|---|---|
| coin | string | The ticker of the coin to get best orders |
| action | string | Whether to buy or sell the selected coin |
| exclude_mine | bool | Defaults to false. If true, the users orders will be excluded from the response. |
| request_by | object | A standard RequestBy object. |
| Structure | Type | Description |
|---|---|---|
| orders | object (map) | the ticker -> array of standard [OrderData](/en/docs/komodo-defi-framework/api/common_structures/orders/#order-data) objects map |
| original_tickers | list (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
}
}
}