Replies: 1 comment
-
|
I am assuming you are looking to calculate the cost of this UserOp using a Paymaster on Ethereum Mainnet to sponsor its gas given your previous discussions. To sponsor this UserOperation given the current gas prices, the final estimated max cost is approximately 0.0096 ETH. This total includes a standard safety multiplier applied by the paymaster. Here's a clear breakdown of the calculation. Calculation BreakdownThe total cost is determined by first calculating a base cost from the UserOperation's gas values and then applying the paymaster's sponsorship policy. Step 1: Calculate the Total Gas LimitThe total gas limit is the sum of all gas-related fields in the operation. This includes estimates for the paymaster's own gas usage.
Formula: Step 2: Calculate the Base CostThe base cost is the total gas limit multiplied by the Formula: Paymaster Safety MultiplierTo protect against network gas price volatility and ensure a transaction is mined successfully, paymasters often charge for more gas than the strict base cost. For sponsoring a single transaction on Ethereum Mainnet, Candide's Paymaster roughly applies a 2x safety multiplier. Final Estimated CostApplying this 2x multiplier to the base cost gives the final amount needed to sponsor the UserOperation. Formula: The calculations we've been doing are for the maximum potential cost. This is the amount your account must be able to cover for the transaction to be considered valid by the network. However, the final charge is based only on the gas actually consumed during execution, which is almost always lower than the limit. The unused portion of the gas cost is never spent. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How much will it cost to make this transaction? in Eth ?
Beta Was this translation helpful? Give feedback.
All reactions