Crypto to crypto¶
Crypto to crypto is a direction where the customer gives one coin and receives another. For example: USDT in, ETH out; BTC in, USDT out; one coin in, another coin out.
When it applies¶
It applies to any direction where the coin in and the coin out are different:
- a stablecoin in (USDT or another), a coin out (ETH, BTC, and so on);
- a coin in, a different coin out;
- a coin in, USDT or another stablecoin out.
If the customer gives and receives the same stablecoin, with no change of coin, that is an ordinary direction, not crypto to crypto.
Where the payment goes¶
On a crypto-to-crypto direction the customer’s payment goes to the Coins wallet automatically. USDT does too, even when the organization is set to accept USDT on-chain.
That payment is the liquidity used to buy the coin the customer should receive and to send it with auto-payout.
What to set¶
On this direction in the exchanger, both the merchant and the auto-payout must be OnChain Wallet, set for this direction.
- Merchant — OnChain Wallet, the one that takes payment for this direction.
- Auto-payout — OnChain Wallet, for the coin and network the customer receives on this direction.
If the direction has a different merchant, a different auto-payout, or either of them from another direction, the payment and the payout will not match.
Exchange rates¶
On a crypto-to-crypto direction the exchanger must quote a rate that matches how OnChain Wallet values the Coins deposit in USDT and caps the auto-payout.
Where rates come from¶
OnChain Wallet refreshes USDT conversion rates on a schedule from market quotes for supported coins. The same up-to-date set is exposed through the merchant API so the exchanger and the wallet use the same numbers.
Endpoint¶
GET {Base URL}/api/conversion-rates
- Base URL — the same URL as in the OnChain Wallet merchant settings (the one used
for
POST /generate-disposable-address, balance, and withdrawals). - Authentication — not required for this request.
Example response:
{
"rates": {
"ETH_USDT": { "rate": "2491.4196" },
"BNB_USDT": { "rate": "737.10505" },
"USDT_USDT": { "rate": "1" }
}
}
Each key is {TICKER}_USDT. The rate field is how many USDT one unit of that ticker
is worth. USDT_USDT is always 1.
If a ticker is missing from rates, OnChain Wallet does not quote that coin yet — do
not use it on a crypto-to-crypto direction until it appears.
For TON, the rate key uses ticker TON (OnChain Wallet maps exchange symbol GRAM
to TON where needed).
Supported coins¶
In the merchant and in auto-payout, set the network and ticker from this list. Each side of the direction has its own pair: for example, USDT on TRC20 in and ETH on ERC20 out.
Open the network and use that ticker in both places.