get_trade_fee
get_trade_fee coin (deprecated)
The get_trade_fee method returns the approximate amount of the miner fee that is paid per swap transaction.
This amount should be multiplied by 2 and deducted from the volume on buy/sell calls when the user is about to trade the entire balance of the selected coin. This aspect is currently under development.
Arguments
| Structure | Type | Description |
|---|---|---|
| coin | string | the name of the coin for the requested trade fee |
Response
| Structure | Type | Description |
|---|---|---|
| coin | string | the fee is paid from the user’s balance of this coin. This coin name may differ from the requested coin. For example, ERC20 fees are paid by ETH (gas) |
| amount | string (numeric) | the approximate fee amount to be paid per swap transaction in decimal representation |
| amount_rat | rational | the approximate fee amount to be paid per swap transaction, represented as a standard RationalValue object |
| amount_fraction | fraction | the approximate fee amount to be paid per swap transaction, represented as a standard FractionalValue object |
📌 Examples
Command (BTC)
POST get_trade_fee
{
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "BTC"
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "BTC"
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "BTC"
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "BTC"
};
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": "get_trade_fee",
"coin": "BTC"
}
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":"get_trade_fee","coin":"BTC"}`)
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": "get_trade_fee",
"coin": "BTC"
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response
{
"result": {
"amount": "0.00042049",
"amount_fraction": {
"denom": "100000000",
"numer": "42049"
},
"amount_rat": [
[1, [42049]],
[1, [100000000]]
],
"coin": "BTC"
}
} Command (ETH)
POST get_trade_fee
{
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "ETH"
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "ETH"
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "ETH"
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "ETH"
};
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": "get_trade_fee",
"coin": "ETH"
}
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":"get_trade_fee","coin":"ETH"}`)
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": "get_trade_fee",
"coin": "ETH"
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response
{
"result": {
"amount": "0.00594",
"amount_fraction": {
"denom": "50000",
"numer": "297"
},
"amount_rat": [
[1, [297]],
[1, [50000]]
],
"coin": "ETH"
}
} Command (ERC20)
POST get_trade_fee
{
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "BAT"
} curl --url "http://127.0.0.1:7783" --data '{
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "BAT"
}' import requests
import json
url = "http://127.0.0.1:7783"
payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "BAT"
}
response = requests.post(url, json=payload)
print(json.dumps(response.json(), indent=2)) const payload = {
"userpass": "RPC_UserP@SSW0RD",
"method": "get_trade_fee",
"coin": "BAT"
};
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": "get_trade_fee",
"coin": "BAT"
}
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":"get_trade_fee","coin":"BAT"}`)
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": "get_trade_fee",
"coin": "BAT"
}
response = Net::HTTP.post(uri, payload.to_json, 'Content-Type' => 'application/json')
puts JSON.pretty_generate(JSON.parse(response.body)) Show Response
Response
{
"result": {
"amount": "0.00594",
"amount_fraction": {
"denom": "50000",
"numer": "297"
},
"amount_rat": [
[1, [297]],
[1, [50000]]
],
"coin": "ETH"
}
}