Shows average rate for token pair
srv_xchange token_pair rate average
-net <net_name>
-token_from <token_ticker>
-token_to <token_ticker>
CLI Example
Command syntax:
srv_xchange token_pair rate average
-net <net_name>
-token_from <token_ticker>
-token_to <token_ticker>
Options:
-net - name of the Cellframe Network. The list of networks can be found in the <Config_dir> \ etc \ network folder or received by The Cellframe-Node-CLI using command - net list
-token_from - kind of token is being sold
-token_to - kind of token is being bought
Example:
Command:
cellframe-node-cli srv_xchange token_pair rate average
-net KelVPN
-token_from KEL
-token_to CELL
Response:
Average rate: 0.762800000000000001
Last rate: 1.0 Last rate time: Wed Feb 28 09:55:46 2024 (1709114146)
JSON-RPC Example
Command:
curl -X POST http://rpc.cellframe.net/connect -d '{"method":"srv_xchange", "params":["srv_xchange;token_pair;-net;KelVPN;rate;average;-token_from;KEL;-token_to;CELL"], "id":"1"}'
Response:
{
"type": 0,
"result": "Average rate: 0.762800000000000001 \n\rLast rate: 1.0 Last rate time: Wed Feb 28 09:55:46 2024 (1709114146)",
"errors": null,
"id": 1
}