[Question]: Elrond explorer fee calculation
silvestrst-crypto opened this issue · comments
Please write the desired question
I appreciate that this is probably not a correct repository to ask this question, but I can't seem to find the explorer repository.
svt@[15.02.2023 14:30:32]: .../~$ echo "0.000000001 * 1068000" | bc -l
.001068000
used_gas * gas_fee
doesn't seem to add-up to the same value as the transaction fee.
Is this a bug in the explorer, or I am misunderstanding the details of the fee calculation?
Code of Conduct
- I agree to follow this project's Code of Conduct
Hello! Your assumption is correct, but there is a little catch. In the fee calculation, there is also a fee deduction for SC calls. The parameter is called GasPriceModifier
and can be checked here: https://github.com/multiversx/mx-chain-mainnet-config/blob/master/economics.toml#L47 .
This means that the fee of each SC call will result in 100 times less fee.
Please have a look over the explanation for ESDT transfers fees here: https://docs.multiversx.com/tokens/esdt-tokens#transfers-fee . The mechanism is the same, just the function's required gas is different.
Hope this answers your question.
Ahh, I missed that. Thank you @bogdan-rosianu !
Do you think it would be useful to add the modifier value to the explorer output?
Yes. We'll think of a solution, since it's not easy to provide a "full formula" for each individual transaction. But at least an Info tooltip that explains the 100x fee deduction would be helpful 👍 . Thanks for pointing this out