-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trade_preimage shows too high fee for ERC20 #853
Comments
@cipig thank you for creating the issue! |
Haven't thought about
at least that's what etherscan says: https://etherscan.io/tx/0x42cb2b7ef835c977dce32fcd2bf01cd4c630714d1ad59c8b996bbcf0c987c0ab |
It definitely would be great to improve gas calculation estimations. Raw calculations with Artem shown that it's probably possible to reduce it ~3 times |
the BEP20 tx also spend less Gas than the limit... from a taker that spent BTC-BEP20 MakerPayment:
https://bscscan.com/tx/0x729275e04c8e81b67ec2ab883632f769d10d8ffc89f0a2ffd2170c65ac020c1b |
Would like to revive this one @sergeyboyko0791 @tonymorony Adding a sidechain BTC can now show fees 100% higher than the reality: Would be nice if trade_preimage can return best/worst case scenario, so I can use max_taker_vol with best case scenario by default - here I need atleast 40$ of RBTC to be able to place a swap due to trade_preimage calculation Note that this sidechain on taker side is also affected by #884 |
It's a really big difference in fees. It happens due to the hardcoded |
what do you mean by "reality" here? please note that contract execution transactions usually take (at least afaik) much more gas than usual transfer (withdrawal ones) |
Yes here an approve call is 50000 gas (0.22$) on this chain, but even 9$ estimation ia far from what we really pay https://explorer.rsk.co/tx/0x1106176fde939f3ea44700592b70ce10f7ba8cfcef34e8ab63ff658669f0d6b0 |
we can now set gas limits for each token in part since #2137 |
It's still high for L2 coins/tokens, so I will keep this open until the L2 issue is resolved. |
the swap 7df52cbe-4123-4414-8fec-3e51e6916533.txt payed 0.0103168912 Ether for TakerPayment https://etherscan.io/tx/0x4a8726d0de70cb17ff7c979ab3dd432e4d42b29b133482e663d246908e7b78a8 of 55 UNI with gas price 107.8 Gwei
but when i call
curl -s --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"trade_preimage\",\"base\":\"UNI\",\"rel\":\"KMD\",\"max\":true,\"swap_method\":\"sell\"}"
it shows me atmand https://ethgasstation.info/json/ethgasAPI.json shows atm
not sure which gas price is used by mm2, but it's max 40% higher than what was payed in 7df52cbe-4123-4414-8fec-3e51e6916533 (107.8 gwei) and that was only 0.0103168912 ETH while trade_preimage shows 0.0477862 ETH
strange is also that the swap JSON from 7df52cbe-4123-4414-8fec-3e51e6916533 contains
while in reality only 0.0103168912 was payed for TakerPayment in that swap
the fee_to_send_taker_fee from trade_preimage seems correct though, 7df52cbe-4123-4414-8fec-3e51e6916533 payed 0.0056782638 Ether in https://etherscan.io/tx/0x42cb2b7ef835c977dce32fcd2bf01cd4c630714d1ad59c8b996bbcf0c987c0ab at 102.3 Gwei and trade_preimage shows me atm
The text was updated successfully, but these errors were encountered: