# get_trade_fee (deprecated)

get_trade_fee coin

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.

TIP

This function is deprecated. Please consider using trade_preimage v2.0 instead.

Note

To send QRC20 Maker/Taker payment, you may need to allow the Etomic Swap (opens new window) smart contract to withdraw amounts from your account using the approve (opens new window) call. In the worst case, you should call the approve twice (reduce allowance to 0 and set it to a required value) before the erc20Payment (opens new window) is called.

Gas Limit 100000 and Gas Price 40 are sufficient for one smart contract call.

As a result, the value returned by the get_trade_fee for a QRC20 token includes gas fee 3 * 100000 * 40 = 12000000 that can be used in the worst case.

# Arguments

Structure Type Description
coin string the name of the coin for the requested trade fee

# Response

Structure Type Description
result object an object containing the relevant information
result.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)
result.amount string (numeric) the approximate fee amount to be paid per swap transaction in decimal representation
result.amount_rat rational the approximate fee amount to be paid per swap transaction in rational representation
result.amount_fraction fraction the approximate fee amount to be paid per swap transaction in fraction representation

# 📌 Examples

# Command (BTC)

curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"get_trade_fee\",\"coin\":\"BTC\"}"

# Command (ETH)

curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"get_trade_fee\",\"coin\":\"ETH\"}"

# Command (ERC20)

curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"get_trade_fee\",\"coin\":\"BAT\"}"