Open gamagire opened 2 years ago
This is an example of what I received in the eth_callBundle
endpoint:
{
"coinbaseDiff": "21993659553843018",
"ethSentToCoinbase": "21993659553647165",
"fromAddress": "", // removed
"gasFees": "195853",
"gasPrice": "112296771322",
"gasUsed": 195853,
"toAddress": "", // removed
"txHash": "0x436a9d8091a17637f7d2c6f0421bf2d13c8a0a64891c1fef7d02a7620e5b53a2",
"value": "0x"
}
It looks like gasPrice is calculated: ethSentToCoinbase / gasUsed:
21993659553647165 / 195853 = 112296771321.58897
Blocknumber: 14636777 Note: my txn is also EIP-1559
gasFees
matches the product of maxPriorityFee
* gasUsed
(I sent a maxPriorityFee = 1wei)ethSentToCoinbase
matches what I transferred to block.coinbase
btw, I found on the last version of mev-geth that gasPrice
is actually coinbaseDiff
divided by gasUsed
:
jsonResult["gasPrice"] = new(big.Int).Div(coinbaseDiffTx, big.NewInt(int64(receipt.GasUsed))).String()
we can also see that:
jsonResult["ethSentToCoinbase"] = new(big.Int).Sub(coinbaseDiffTx, gasFeesTx).String()
and gasFees
(variable gasFeesTx
) is the total tip paid to the miner through gas fees (I guess you can also call this priority fee)
so coinbaseDiff
is the sum of ethSentToCoinbase
plus gasFees
Source: https://github.com/flashbots/mev-geth/blob/v1.10.17-mev0.6.1/internal/ethapi/api.go#L2391
gasPricePaidBySearcher here is the priority fee -- it's already 'above' the base fee so subtracting base gas makes it go negative...