Gas Compare
by OnchainCheck Gas Prices in Onchain & crypto
Multichain gas prices right now on Base, Ethereum, Arbitrum, Optimism and Polygon, side by side: gas price, base and priority fee, USD cost of a native transfer, an ERC-20 transfer and a DEX swap (L2 L1-data fees included), the cheapest chain for each, and how each chain's gas price ranks against its own last 7 days of 10-minute samples, with the usually cheapest UTC hour. Errors return 4xx/5xx JSON and aren't charged.
https://onchaincheck.dev/gas/compare- Price
- $0.003
- per call in USDC
- Uptime
- 66.7%
- last 30 days
- Response time
- 75 ms
- 85 ms slowest 5%
- Last check
- Passed
- 7 h ago, next any minute now
Reliability
Status and outage history · Atom feed · Watch with other listings
How to call it
GET https://onchaincheck.dev/gas/compare
Each call costs $0.003 in USDC on Base, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
GET https://onchaincheck.dev/gas/compareParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chains | string | No | Comma-separated subset: base, eth, arbitrum, optimism, polygon (default all) |
Example response
The provider's example. We can't check it without paying.
Example response, 165 lines
{
"chains": [
{
"baseFeeGwei": 8.31e-7,
"blockNumber": 159743052,
"blockTime": "2026-11-19T10:41:21.000Z",
"chain": "optimism",
"costs": {
"erc20Transfer": {
"l1DataFeeUsd": 0.0000052,
"native": 6.792e-8,
"usd": 0.000122
},
"nativeTransfer": {
"l1DataFeeUsd": 0.0000035,
"native": 2.294e-8,
"usd": 0.0000414
},
"swap": {
"l1DataFeeUsd": 0.000011,
"native": 1.86e-7,
"usd": 0.000335
}
},
"gasPriceGwei": 0.001000831,
"l1DataFeeIncluded": true,
"maxPriorityFeeGwei": 0.001,
"name": "OP Mainnet",
"nativeSymbol": "ETH",
"nativeUsd": 1802.54,
"vsLast7Days": null
},
{
"baseFeeGwei": 0.005,
"blockNumber": 59472528,
"blockTime": "2026-11-19T10:41:21.000Z",
"chain": "base",
"costs": {
"erc20Transfer": {
"l1DataFeeUsd": 0.0000033,
"native": 3.918e-7,
"usd": 0.000707
},
"nativeTransfer": {
"l1DataFeeUsd": 0.0000022,
"native": 1.272e-7,
"usd": 0.00023
},
"swap": {
"l1DataFeeUsd": 0.0000068,
"native": 0.000001084,
"usd": 0.00196
}
},
"gasPriceGwei": 0.006,
"l1DataFeeIncluded": true,
"maxPriorityFeeGwei": 0.001,
"name": "Base",
"nativeSymbol": "ETH",
"nativeUsd": 1804.68,
"vsLast7Days": null
},
{
"baseFeeGwei": 244.706553068,
"blockNumber": 97586275,
"blockTime": "2026-11-19T10:41:22.000Z",
"chain": "polygon",
"costs": {
"erc20Transfer": {
"native": 0.01763,
"usd": 0.00144
},
"nativeTransfer": {
"native": 0.005695,
"usd": 0.000466
},
"swap": {
"native": 0.04881,
"usd": 0.00399
}
},
"gasPriceGwei": 271.169757353,
"l1DataFeeIncluded": false,
"maxPriorityFeeGwei": 26.463204285,
"name": "Polygon PoS",
"nativeSymbol": "POL",
"nativeUsd": 0.0818378,
"vsLast7Days": null
},
{
"baseFeeGwei": 0.020068,
"blockNumber": 525592089,
"blockTime": "2026-11-19T10:41:20.000Z",
"chain": "arbitrum",
"costs": {
"erc20Transfer": {
"l1DataFeeUsd": 0.000024,
"native": 0.000001319,
"usd": 0.00238
},
"nativeTransfer": {
"l1DataFeeUsd": 0.000019,
"native": 4.323e-7,
"usd": 0.00078
},
"swap": {
"l1DataFeeUsd": 0.00004,
"native": 0.000003639,
"usd": 0.00656
}
},
"gasPriceGwei": 0.020094,
"l1DataFeeIncluded": true,
"maxPriorityFeeGwei": 0,
"name": "Arbitrum One",
"nativeSymbol": "ETH",
"nativeUsd": 1803.82,
"vsLast7Days": null
},
{
"baseFeeGwei": 0.116594591,
"blockNumber": 26448593,
"blockTime": "2026-11-19T10:41:11.000Z",
"chain": "eth",
"costs": {
"erc20Transfer": {
"native": 0.000007579,
"usd": 0.0137
},
"nativeTransfer": {
"native": 0.000002449,
"usd": 0.00442
},
"swap": {
"native": 0.00002099,
"usd": 0.0379
}
},
"gasPriceGwei": 0.11659946,
"l1DataFeeIncluded": false,
"maxPriorityFeeGwei": 0.000004869,
"name": "Ethereum",
"nativeSymbol": "ETH",
"nativeUsd": 1806.02,
"vsLast7Days": null
}
],
"cheapest": {
"erc20Transfer": {
"chain": "optimism",
"usd": 0.000122
},
"nativeTransfer": {
"chain": "optimism",
"usd": 0.0000414
},
"swap": {
"chain": "optimism",
"usd": 0.000335
}
},
"checkedAt": "2026-11-19T10:41:21.349Z",
"notes": "Costs are estimates at the current gas price for typical gas use (native transfer 21k, ERC-20 transfer 65k, DEX swap 180k gas); real swaps vary by route. L2 costs include the L1 data fee (OP Stack ora… (240 chars, truncated in this example)",
"source": "Each chain's RPC (eth_gasPrice, fee history, L1 fee precompiles), Chainlink price feeds, onchaincheck gas samples"
}Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.003.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i 'https://onchaincheck.dev/gas/compare'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - 'https://onchaincheck.dev/gas/compare' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.003 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.003" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.003 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fonchaincheck.dev%2Fgas%2Fcompare
const res = await pay("https://onchaincheck.dev/gas/compare");
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.003 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.003"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.get("https://onchaincheck.dev/gas/compare")
print(res.status_code, res.text)Security scan
No findings
We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 7 h ago | Passed | 402 | 85 ms | $0.003 |
| 16 h ago | Passed | 402 | 75 ms | $0.003 |
| 27 h ago | Passed | 402 | 80 ms | $0.003 |
| 45 h ago | Timed out | - | - | - |
| 4 days ago | Timed out | - | - | - |
Show 1 older checks
| 5 days ago | Passed | 402 | 55 ms | $0.003 |