Sending max Network token without error

Hi, i’m facing a boring issue with send all of my ether from an addres to another

the wallet should automatically calculate the cost of the gas and remove it from the maximum set amount of the network coin set in order to have a smooth user experience in this case,

at the moment the wallet sets the maximum number of coins in the wallet but when you go to make the transaction it does not start because the gas is calculated afterwards

Thanks in advance

1 Like

This is the standard in most of the defi wallets, afaik. It is not possible to know the gas before the transaction is submitted to the blockchain. Thus, you must have funds in the wallet to pay the gas. The fee cannot be deducted from the on-chain transaction because transactions are immutable.

It works differently in some cefi exchanges, because the transactions are performed off-chain and in many cases the fees are a fixed percentage.

1 Like

Becouse Cost of Transaction is a dynamic variable.
I quote from etherscan(since BAT is an Ethereum token ).

" Although a transaction includes a limit, any gas not used in a transaction is returned to the user (i.e. max fee - (base fee + tip) is returned)."
For more info you can go here and have a better look:

And here is an “estimator” that explains a bit better how this work:

DISCLAIMER i am not the owner or affiliate of the mentioned websites, i just use them as credible sources.

sorry for the inaccuracy, I’m talking about native coins of the network
as you say you can’t know the exact commission amount but you can predict it at least for simple transactions by using a gas pricing service and the eth_estimateGas rpc call, just like the metamask does for native currencies (if you’ve used it before) when you enter the “max” value for a native currency the wallet calculates the maximum amount that can be sent in a transaction after a commission price prediction and puts it into the entered amount, the result is that if the predicted price is lower than the real , the interface will warn you in a later step, but if it is greater than or equal the transaction will proceed without friction;

I think it can be a very good thing if I’m not mistaken, otherwise sorry in advance

I clearly understand your thoughts, and i didn t moved my assets from my older wallet to a new one until i find the proper and stable that satisfy my needs(i keep always -/+100$ as my margin when i conduct, si in case i cover my needs at the moment).
And yes, to respond directly to your question, i would like to see as well when i conduct any transaction to be in easy and simple step without worrying about the “behind the scene” mechanism. It may be work in progress for a non custodial wallet.

It’s true you can’t know for certain the amount of gas required but other wallets like Metamask can predict it quite accurately and adjust automatically without big margin error. We should have that feature too. Automatic fee calculations.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.