💼B2B solutions

Hedgehog v2 Gas Fees Hedging Architecture

The architecture of gas fees hedging involves several key components and processes designed to allow users and paymasters to hedge their operations effectively. This can be used to automate strategies that offer predictable and manageable gas fees in various transactions.

1. Actors and Components

  • AA Users: These are the users interacting with the system through Account Abstraction (AA) wallets.

  • Bundler: The entity responsible for handling and executing user operations.

  • Entry Point: The contract acting as the main interface for user operations.

  • Paymaster: A contract that can cover gas fees for transactions, allowing for gasless transactions.

  • BFEE Hedge Pricing Model: A model used to determine the pricing for hedging gas fees using the BFEE token.

2. Operational Flow

For Users:

  1. Send Operations (sendOps): Users initiate operations through their AA wallets, which are sent to the Bundler.

  2. Handle Operations (handleOps): The Bundler processes these operations.

  3. Validate Operation (validateOp): The operations are validated to ensure they meet required criteria.

  4. Execute Operation (executeOp): Validated operations are executed.

  5. BFEE Token Transactions:

  • Sell BFEE: Upon execution, the system can sell BFEE tokens as part of the hedging strategy.

  • Buy/Mint BFEE: The system can also buy or mint BFEE tokens as necessary to maintain the hedge.

For Paymasters:

  1. Gasless Transactions: Paymasters can hedge while facilitating gasless transactions for users.

  2. Send Operations (sendOps): Similar to users, paymasters send operations to the Bundler.

  3. Handle Operations (handleOps): The Bundler processes these operations.

  4. Validate Operation (validateOp): Operations are validated.

  5. Validate Paymaster Operation (validate paymasterOp): Additional validation specific to paymaster operations.

  6. Execute Operation (executeOp): Validated operations are executed.

  7. BFEE Token Transactions:

  • ETH Refund: Paymasters receive ETH refunds for covered transactions.

  • Sell BFEE: The system can sell BFEE tokens during execution to hedge gas fees.

  • Buy BFEE: The system can buy BFEE tokens to maintain the hedge.

3. Key Processes

  • Hedging Mechanism: By using the BFEE Hedge Pricing Model, the system can dynamically adjust the buying and selling of BFEE tokens to hedge against fluctuating gas prices. This model helps stabilize costs for users and paymasters, making gas fees more predictable.

  • Gasless Transactions: Paymasters play a crucial role in enabling gasless transactions by covering the gas fees and later receiving ETH refunds. This makes the user experience smoother and reduces the burden of managing gas fees directly.

4. Interaction Flow

  1. User Initiates Transaction: Through their AA wallet, a user sends a transaction which enters the system via the Entry Point.

  2. Bundler Processes Transaction: The Bundler handles and validates the transaction.

  3. Execute and Hedge: The transaction is executed, and the system adjusts its BFEE holdings to hedge against gas fee volatility.

  4. Paymaster Role: For gasless transactions, the paymaster covers the initial gas fee and later gets reimbursed in ETH while participating in the BFEE hedging process.

This architecture effectively decouples the user experience from gas fee volatility, leveraging the BFEE token and a robust hedging strategy to provide more predictable and manageable costs for both users and paymasters.

Last updated