best_orders
best_orders coin action volume
The best_orders method returns the best price orders that can fill the volume for all existing pairs with selected coin.
Arguments
| Structure | Type | Description |
|---|---|---|
| coin | string | the ticker of the coin to get best orders |
| action | string | whether to buy or sell the selected coin |
| volume | string | the amount of coin user is willing to buy or sell |
Response
| Structure | Type | Description |
|---|---|---|
| result | object (map) | A map of standard OrderDataV1 objects (by ticker) |
where order entry has the following structure
📌 Examples
Command
POST best_orders
{
"userpass": "RPC_UserP@SSW0RD",
"method": "best_orders",
"coin": "BTC",
"action": "buy",
"volume": "1"
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "best_orders",
"coin": "BTC",
"action": "buy",
"volume": "1"
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "best_orders",
"coin": "BTC",
"action": "buy",
"volume": "1"
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "best_orders",
"coin": "BTC",
"action": "buy",
"volume": "1"
};
const response = await fetch("http://127.0.0.1:7783", {
method: "POST",
body: JSON.stringify(payload),
});
console.log(await response.json()); <?php
$payload = <<<'JSON'
{
"userpass": "RPC_UserP@SSW0RD",
"method": "best_orders",
"coin": "BTC",
"action": "buy",
"volume": "1"
}
JSON;
$ch = curl_init("http://127.0.0.1:7783");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
echo $response; package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{"userpass":"RPC_UserP@SSW0RD","method":"best_orders","coin":"BTC","action":"buy","volume":"1"}`)
resp, err := http.Post("http://127.0.0.1:7783", "application/json", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
} require 'net/http'
require 'json'
require 'uri'
uri = URI("http://127.0.0.1:7783")
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "best_orders",
"coin": "BTC",
"action": "buy",
"volume": "1"
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response (success)
{
"result": {
"MARTY": [
{
"coin": "MARTY",
"address": "RMaprYNUp8ErJ9ZAKcxMfpC4ioVycYCCCc",
"price": "1",
"price_rat": [
[1, [1]],
[1, [1]]
],
"price_fraction": {
"numer": "1",
"denom": "1"
},
"maxvolume": "2",
"max_volume_rat": [
[1, [2]],
[1, [1]]
],
"max_volume_fraction": {
"numer": "2",
"denom": "1"
},
"min_volume": "0.00777",
"min_volume_rat": [
[1, [777]],
[1, [100000]]
],
"min_volume_fraction": {
"numer": "777",
"denom": "100000"
},
"pubkey": "037310a8fb9fd8f198a1a21db830252ad681fccda580ed4101f3f6bfb98b34fab5",
"age": 1618306280,
"zcredits": 0,
"uuid": "09a61d61-9352-42f3-ae64-03e832aca07f",
"is_mine": false,
"base_confs": 1,
"base_nota": false,
"rel_confs": 2,
"rel_nota": false,
"base_max_volume": "2",
"base_max_volume_fraction": {
"numer": "2",
"denom": "1"
},
"base_max_volume_rat": [
[1, [2]],
[1, [1]]
],
"base_min_volume": "0.00777",
"base_min_volume_fraction": {
"numer": "777",
"denom": "100000"
},
"base_min_volume_rat": [
[1, [777]],
[1, [100000]]
],
"rel_max_volume": "2",
"rel_max_volume_fraction": {
"numer": "2",
"denom": "1"
},
"rel_max_volume_rat": [
[1, [2]],
[1, [1]]
],
"rel_min_volume": "0.00777",
"rel_min_volume_fraction": {
"numer": "777",
"denom": "100000"
},
"rel_min_volume_rat": [
[1, [777]],
[1, [100000]]
]
},
{
"coin": "MARTY",
"address": "RB8yufv3YTfdzYnwz5paNnnDynGJG6WsqD",
"price": "0.9090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909090909091",
"price_rat": [
[1, [10]],
[1, [11]]
],
"price_fraction": {
"numer": "10",
"denom": "11"
},
"base_confs": 1,
"base_nota": false,
"rel_confs": 2,
"rel_nota": false,
"maxvolume": "56210.95940853",
"max_volume_rat": [
[1, [3278717685, 1308]],
[1, [100000000]]
],
"max_volume_fraction": {
"numer": "5621095940853",
"denom": "100000000"
},
"min_volume": "0.0001",
"min_volume_rat": [
[1, [1]],
[1, [10000]]
],
"min_volume_fraction": {
"numer": "1",
"denom": "10000"
},
"pubkey": "0315d9c51c657ab1be4ae9d3ab6e76a619d3bccfe830d5363fa168424c0d044732",
"age": 1618306280,
"zcredits": 0,
"uuid": "7b5fc790-cbe1-4714-812c-2e307818f258",
"is_mine": false,
"base_max_volume": "61832.055349383",
"base_max_volume_fraction": {
"numer": "61832055349383",
"denom": "1000000000"
},
"base_max_volume_rat": [
[1, [1706156167, 14396]],
[1, [1000000000]]
],
"base_min_volume": "0.00011",
"base_min_volume_fraction": {
"numer": "11",
"denom": "100000"
},
"base_min_volume_rat": [
[1, [11]],
[1, [100000]]
],
"rel_max_volume": "56210.95940853",
"rel_max_volume_fraction": {
"numer": "5621095940853",
"denom": "100000000"
},
"rel_max_volume_rat": [
[1, [3278717685, 1308]],
[1, [100000000]]
],
"rel_min_volume": "0.0001",
"rel_min_volume_fraction": {
"numer": "1",
"denom": "10000"
},
"rel_min_volume_rat": [
[1, [1]],
[1, [10000]]
]
}
],
"OOT": [
{
"coin": "OOT",
"address": "RMaprYNUp8ErJ9ZAKcxMfpC4ioVycYCCCc",
"price": "0.01",
"price_rat": [
[1, [1]],
[1, [100]]
],
"price_fraction": {
"numer": "1",
"denom": "100"
},
"base_confs": 1,
"base_nota": false,
"rel_confs": 2,
"rel_nota": false,
"maxvolume": "1140445.56120275",
"max_volume_rat": [
[1, [526976459, 1062]],
[1, [4000000]]
],
"max_volume_fraction": {
"numer": "4561782244811",
"denom": "4000000"
},
"min_volume": "0.00777",
"min_volume_rat": [
[1, [777]],
[1, [100000]]
],
"min_volume_fraction": {
"numer": "777",
"denom": "100000"
},
"pubkey": "037310a8fb9fd8f198a1a21db830252ad681fccda580ed4101f3f6bfb98b34fab5",
"age": 1618306280,
"zcredits": 0,
"uuid": "8ea62e1d-0df5-4807-9ee6-c6367ac4e8ce",
"is_mine": false,
"base_max_volume": "114044556.120275",
"base_max_volume_fraction": {
"numer": "4561782244811",
"denom": "40000"
},
"base_max_volume_rat": [
[1, [526976459, 1062]],
[1, [40000]]
],
"base_min_volume": "0.777",
"base_min_volume_fraction": {
"numer": "777",
"denom": "1000"
},
"base_min_volume_rat": [
[1, [777]],
[1, [1000]]
],
"rel_max_volume": "1140445.56120275",
"rel_max_volume_fraction": {
"numer": "4561782244811",
"denom": "4000000"
},
"rel_max_volume_rat": [
[1, [526976459, 1062]],
[1, [4000000]]
],
"rel_min_volume": "0.00777",
"rel_min_volume_fraction": {
"numer": "777",
"denom": "100000"
},
"rel_min_volume_rat": [
[1, [777]],
[1, [100000]]
]
}
]
},
"original_tickers": {
"BTC": ["BTC-segwit"]
}
}