agentsclimarketplace

Skill 12 gas optimization

Skill vaquarkhan/web3-agent-skills/skills/skill-12-gas-optimization

Production-grade Agent Skills for Web3 AI agents: 15 workflows, 6 MCP servers, DeFi/NFT/compliance guardrails, and VS Code/JetBrains installers.

Install
npx -y skills add vaquarkhan/web3-agent-skills --skill skill-12-gas-optimization

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Optimizes transaction gas via EIP-1559 fee prediction, nonce management, private transaction submission, and EIP-4844 blob fee handling. Use when estimating fees, fixing stuck transactions, or submitting MEV-sensitive txs.

SKILL.md

2.1 KB, as published. Nobody here has run it

Gas Optimization

When to Use

  • Estimating transaction costs before execution
  • Managing nonces for sequential or parallel txs
  • Submitting private transactions (Flashbots, MEV-Share)
  • Handling EIP-4844 blob transactions (L2 data availability)
  • Recovering stuck transactions (speed up / cancel)

Prerequisites

  • MCP: blockchain-rpc-server
  • Skill-15 for private tx routing on mainnet swaps

EIP-1559 Fee Strategy

maxPriorityFeePerGas = baseFee * 0.1 (min 1 gwei on Ethereum)
maxFeePerGas = baseFee * 2 + maxPriorityFeePerGas
  1. Fetch eth_feeHistory for last 10 blocks
  2. Use 75th percentile of priority fees
  3. On L2s (Arbitrum, Base, Optimism): use L1 data fee + L2 execution fee

Nonce Management

  • Query eth_getTransactionCount with pending tag
  • Use nonce manager for parallel txs (increment locally, track pending)
  • Cancel: send 0 ETH self-transfer with same nonce, +20% gas
  • Speed up: resubmit with same nonce, +15% maxFeePerGas

Private Transactions

NetworkMethod
EthereumFlashbots Protect RPC, MEV-Share
PolygonFastlane private RPC
Base/ArbitrumSequencer private orderflow (limited)

Use private submission for swaps, liquidations, and any MEV-exposed operation.

Blob Fees (EIP-4844)

For rollup batch submissions or blob-carrying txs:

blobGasPrice = getBlobBaseFee()
totalBlobCost = blobGasUsed * blobGasPrice

Monitor excessBlobGas in block header for fee spikes.

L2 Gas Notes

ChainGas TokenNotes
ArbitrumETHL1 calldata cost dominates
OptimismETHL1 fee + L2 fee split
BaseETHOP Stack, similar to Optimism
PolygonPOLLow base fees, occasional spikes

References

  • references/fee-oracles.md — RPC methods and fallback APIs

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.