On this page

latest contributor to this doc

Last Edit:

@gcharang

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.

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

To send QRC20 Maker/Taker payment, you may need to allow the Etomic Swap smart contract to withdraw amounts from your account using the approve 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 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.

StructureTypeDescription
coinstringthe name of the coin for the requested trade fee

StructureTypeDescription
coinstringthe 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)
amountstring (numeric)the approximate fee amount to be paid per swap transaction in decimal representation
amount_ratrationalthe approximate fee amount to be paid per swap transaction, represented as a standard RationalValue object
amount_fractionfractionthe approximate fee amount to be paid per swap transaction, represented as a standard FractionalValue object

POST
get_trade_fee
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "get_trade_fee",
  "coin": "BTC"
}

POST
get_trade_fee
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "get_trade_fee",
  "coin": "ETH"
}

POST
get_trade_fee
{
  "userpass": "RPC_UserP@SSW0RD",
  "method": "get_trade_fee",
  "coin": "BAT"
}