Base Gas for Openclaw

Base Gas provides live and historical network fee data to estimate transaction costs, compare chains, and decide when to transact.

memosr
v1.0.0
Oct 18, 2026
0
71
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install base-gas

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install base-gas using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Base Gas?

Base Gas gives AI agents access to live and historical gas data for Base mainnet through x402-protected endpoints. It returns gas prices in gwei and estimated transaction costs in ETH and USD, helping users evaluate transfers, swaps, NFT mints, contract deployments, and other on-chain work.

Beyond current prices, the skill can compare Base with OP Mainnet, Arbitrum, and Ethereum, assess whether gas is cheap or expensive relative to recent history, and identify potentially cheaper hours for transactions. Openclaw Skills users can apply these insights to transaction planning and on-chain workload budgets while checking data coverage before paying for historical queries.

Base Gas Use Cases

  • Check Base gas prices before submitting a transaction.
  • Estimate costs for an ETH or ERC-20 transfer, NFT mint, Uniswap swap, or contract deployment using an operation-specific gas limit.
  • Determine whether current gas is cheap, normal, expensive, or flat compared with a selected historical window.
  • Compare estimated fees across Base, OP Mainnet, Arbitrum, and Ethereum.
  • Find out whether waiting or scheduling a batch transaction is likely to save money.
  • Check historical data coverage before making a paid history or cheapest-window request.
  • Budget gas for recurring transactions or on-chain agent workloads.

How Base Gas Works

  1. Check GET /health first to review free history-coverage details, including the number of samples and hours covered.
  2. Choose the endpoint for the question: /gas for current fees, /gas/compare for cross-chain estimates, /gas/history for trends, or /gas/cheapest-window for hourly averages.
  3. If estimating a specific operation, provide its gasLimit; otherwise, the estimate defaults to 21,000 gas units.
  4. Fetch the endpoint with npx agentcash@latest fetch. Paid endpoints use x402; payment settles on Base mainnet in USDC.
  5. Interpret the returned fee and cost fields. For history, use the supplied verdict and verdictNote; for hourly planning, check hasDailyCycle and follow the recommendation.
  6. Make the transaction or schedule it based on the estimate, historical context, data coverage, and whether the potential savings are meaningful.

Base Gas Setup

The skill requires npx. For installation and wallet setup, consult the skill's referenced rules/getting-started.md; those details are not included in the supplied SKILL.md. Check the free health endpoint before paying for historical data, then use AgentCash to fetch paid routes.

# Check history coverage for free
curl -s https://base-gas-x402-production.up.railway.app/health

# Fetch the current Base gas estimate
npx agentcash@latest fetch https://base-gas-x402-production.up.railway.app/gas

# Estimate an operation using a custom gas limit
npx agentcash@latest fetch "https://base-gas-x402-production.up.railway.app/gas?gasLimit=180000"

Paid requests settle in USDC on Base mainnet (eip155:8453). Endpoint prices are published in the service's /openapi.json document.

Base Gas Data Schema & Taxonomy

The skill reads data from the Base Gas x402 service at https://base-gas-x402-production.up.railway.app. It does not describe local files generated by the skill; responses are structured endpoint data.

Endpoint Purpose Key response data
GET /health Free history coverage check samples, hoursCovered, oldestSample, newestSample, sampleIntervalSeconds, retentionHours, durable, lastError, and nextSteps
GET /gas Current Base fees and operation estimate baseFeePerGas, low/medium/high priorityFeePerGas, gasPrice, estimatedTransferCost, blockNumber, and fetchedAt
GET /gas/compare Cross-chain fee comparison chains ranked cheapest first, cheapest, baseRank, baseVsEthereum, and unavailable
GET /gas/history Historical trend for a 1–168-hour window samples, summary (min, max, average, median), currentGasPrice, verdict, verdictNote, and spreadPercent
GET /gas/cheapest-window Hourly averages for a 1–168-hour window hasDailyCycle, recommendation, savingsPercent, hourlyAverages, cheapestHourUtc, and priciestHourUtc

Fee values are reported in gwei, with transaction estimates also available in ETH and USD. The current-gas and comparison routes accept an optional gasLimit (default 21,000). Historical routes include a coverage object; USD estimates can be null if the price feed is unavailable.

Base Gas Advanced Features

  • Compare four networks in one /gas/compare request; unavailable chain RPCs are reported without preventing a partial comparison.
  • Price different transaction types by passing a custom gasLimit, such as 65,000 for an ERC-20 transfer, 85,000 for an NFT mint, 180,000 for a swap, or 1,500,000 for a contract deployment.
  • Use historical verdicts (cheap, normal, expensive, or flat) to distinguish a price snapshot from a trend-based decision. The skill advises using verdictNote rather than reinterpreting the verdict.
  • Check hasDailyCycle before relying on hourly rankings; when it is false, hourly timing does not meaningfully differ and the recommendation should guide the decision.
  • Plan batch jobs with avoidHoursUtc, cheapestHourUtc, and savingsUsd.vsAverageHour when those fields are available, and convert UTC when scheduling locally.
  • Reduce unnecessary spend by checking free coverage before history requests, using one comparison request instead of four separate current-price requests, and avoiding polling more than once a minute.
  • Access the service's OpenAPI document at /openapi.json for endpoint specifications and current published prices.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*