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.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
action | string | ✓ | - | A standard ActionEnum enum. Whether to buy or sell the selected coin. |
coin | string | ✓ | - | The ticker of the coin to get best orders. |
exclude_mine | bool | ✗ | false | If true , the users orders will be excluded from the response. |
request_by | object | ✓ | - | A standard RequestBy object. |
Parameter | 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. |
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
}
}
}
Parameter | Type | Description |
---|---|---|
InvalidRequest | string | Returned if the request type or action is invalid (e.g., number value must be integer, or type/action is not allowed). |
CoinIsWalletOnly | string | Returned if the coin is wallet only and cannot be traded. |
P2PError | string | Returned if there is a connection problem. |