Open ACK-J opened 2 years ago
Is it something that you could calculate on your side from existing info? Or there is some piece of information missing that should be exposed by the explorer?
There is very little documentation or understanding surrounding how the "base fee" is calculated, it seems there are a lot of moving parts. I've been trying to figure it out for myself to write a blog post to help others. If the block explorer automatically did this, I think it would also help people understand more about the fee paid in a transaction, relational to the base they had to pay.
I think there is certain information needed that needs to be calculated for each block, but I am not certain. Also I have a 0.2 xmr bounty outstanding for anyone who makes it possible to get the base transaction fee of an arbitrary block on-chain, its not a lot of xmr but its something.
Monero daemon has RPC get_dynamic_base_fee_estimate
which is use by monero wallet:
https://github.com/monero-project/monero/blob/master/src/wallet/wallet2.cpp#L7338
If that would help, I could expose that?
Yea that would work! But would this work for past blocks or just for the newest one?
I think its for the current ones only.
Would you know how to make it work for any arbitrary block? My problem is that I need to know the average "base transaction fee" over a 100,000 block period starting at block #2566273.
At the moment I'm not sure. Would have too look into it in more depth. Maybe you could ask on reddit if there is some easy way?
Have you check the json api for the explorer: https://github.com/moneroexamples/onion-monero-blockchain-explorer#apinetworkinfo
It returns fee_per_kb
which is estimate of a fee per kb (10 blocks).
Yea it looks like it makes an RPC call to get it, I don't think it would allow me to return the fee_per_kb of an arbitrary block :/ https://github.com/moneroexamples/onion-monero-blockchain-explorer/blob/aa96ce2927c050fabe17154a3bdfb09be83a632f/src/MempoolStatus.cpp#L239-L241
Its only based on current blocks. Is there any API in monero itself to get a fee estimate for any block?
I dont believe so, but I wish there was one
Would you be able to expose the get_dynamic_base_fee_estimate
wallet2 function as an API endpoint? This way sites like moneroj.net
can track it from now on.
This is a selfish request as I am creating a chart at the moment which needs this information and there is no historical source which I can pull the data from. I will recalculate the values myself but it would be really cool if the XMR block explorer advertised the base transaction fee for the block, even if it was an estimate.
https://www.getmonero.org/2017/12/11/A-note-on-fees.html
https://github.com/monero-project/monero/blob/master/tests/unit_tests/fee.cpp