HowTo: The best rate for the TON Crystal
← back

Getting the best rate for selling TON Crystal for USDT

Query:

https://api.chatex.com/v1/exchange/orders?pair=usdt/ton_crystal&limit=1

Response

[
    {
        "id": 68104,
        "pair": "usdt/ton_crystal",
        "created_at": "2020-12-10T23:56:08.703475Z",
        "updated_at": "2020-12-11T11:54:42.169502Z",
        "rate": "1.02",
        "amount": "0.061801",
        "status": "ACTIVE"
    }
]

The response contains the list of available orders with one element only (as your remember we used limit parameter in the request).

The parameter rate contains a ratio between 1 USDT and 1 TON Crystal:
1 USDT = rate * TON Crystal
1 TON Crystal = 1/rate * USDT

In this example the best rate for selling 1 TON Crystal for USDT:
1 TON Crystal = 1 / 1.02 USDT = 0.9803921569 USDT = 0.980392 USDT
1 USDT = 1.02 TON Crystal

Note:
USDT contains 6 significant decimals. All extra digits you can ignore.
You can get coin information by request to /v1/coins/usdt endpoint.

Getting the best rate for buying TON Crystal for USDT

Query:

https://api.chatex.com/v1/exchange/orders?pair=ton_crystal/usdt&limit=1

Response

[
    {
        "id": 68523,
        "pair": "ton_crystal/usdt",
        "created_at": "2020-12-11T12:11:29.43853Z",
        "updated_at": "2020-12-11T12:11:29.43853Z",
        "rate": "0.9997",
        "amount": "644.340633239",
        "status": "ACTIVE"
    }
]

The response contains the list of available orders with one element only (as your remember we used limit parameter in the request).

The parameter rate contains a ratio between 1 USDT and 1 TON Crystal:
1 USDT = rate * TON Crystal
1 TON Crystal = 1/rate * USDT

In this example the best rate for selling 1 TON Crystal for USDT:
1 TON Crystal = 0.9997 USDT
1 USDT = 1/0.9997 TON Crystal = 1.00030009 TON Crystal

Note:
TON Crystal contains 9 significant decimals. All extra digits you can ignore.
You can get coin information by request to /v1/coins/ton_crystal endpoint.