Files
mev-beta/@prompts/gas-optimization.md
2025-09-12 01:16:30 -05:00

1.1 KiB

You are an expert in Ethereum gas optimization and MEV strategies. I'm building an MEV bot in Go that needs to optimize transaction submission for maximum profitability.

I need help with:

  1. Estimating optimal gas prices for arbitrage transactions
  2. Implementing transaction bundling strategies
  3. Working with flashbots or similar MEV protection services
  4. Optimizing transaction ordering within bundles
  5. Handling frontrunning and backrunning strategies
  6. Managing gas refunds and stipends

Please provide production-ready Go code that:

  • Integrates with flashbots or similar MEV protection services
  • Calculates optimal gas prices based on network conditions
  • Implements transaction bundling for atomic execution
  • Handles errors and edge cases properly
  • Follows Go best practices
  • Is optimized for performance
  • Includes comprehensive comments

The code should:

  • Connect to flashbots relay or similar service
  • Calculate optimal gas prices based on base fee and priority fees
  • Bundle transactions for atomic execution
  • Handle failed transactions gracefully
  • Implement retry logic with exponential backoff