> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dune.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gas & Fees

> Curated transaction fee datasets across 55+ EVM chains and Solana on Dune

Dune's gas tables provide transaction-level fee data across 55+ EVM chains and Solana, including fee breakdowns (base fee, priority fee, L1 data fee for L2s), gas pricing, and validator/proposer identification.

<Info>
  **Maintained by:** Dune · **Refresh:** \~10 min · **Chains:** 55 EVM + Solana
</Info>

<Card title="Get This Data" icon="database" href="https://dune.com/enterprise?dataset=gas.fees">
  Access gas fee data via API, Datashare, or the Dune App.
</Card>

## Available Tables

<CardGroup cols={2}>
  <Card title="gas.fees" icon="database" href="/data-catalog/curated/gas-fees/fees">
    Transaction-level gas fees across 55 EVM chains
  </Card>

  <Card title="gas_solana.fees" icon="database" href="/data-catalog/curated/gas-fees/solana_fees">
    Transaction-level fees on Solana (including vote transactions)
  </Card>
</CardGroup>

## When to Use These Tables

* Analyze transaction costs across chains
* Compare gas pricing and fee structures between L1s and L2s
* Track fee revenue for validators and block proposers
* Understand fee breakdowns (base vs priority vs L1 data costs on rollups)
* Build gas cost estimators or optimize transaction timing

## Coverage

**gas.fees (55 EVM chains):**

<Accordion title="View all chains">
  Abstract, Apechain, Arbitrum, Avalanche C-Chain, B3, Base, Berachain, Blast, BNB Chain, Bob, Boba, Celo, Corn, Degen, Ethereum, Fantom, Flare, Gnosis, Hemi, Henesys, HyperEVM, Ink, Kaia, Katana, Lens, Linea, Mantle, MegaETH, Mezo, Monad, Nova, opBNB, Optimism, Peaq, Plasma, Plume, Polygon, Ronin, Scroll, Sei, Shape, Somnia, Sonic, Sophon, Story, Superseed, TAC, Taiko, Tron, Unichain, Worldchain, X Layer, zkEVM, zkSync, Zora
</Accordion>

**gas\_solana.fees:** Solana (includes vote transactions)

## Query Performance

`gas.fees` is a view over chain-specific incremental tables using `block_month` and `block_date` as partition keys.

```sql theme={null}
-- ✅ Good: chain + time filter
SELECT * FROM gas.fees
WHERE blockchain = 'ethereum'
  AND block_date = DATE '2025-02-01'

-- ✅ L2 analysis with month filter
SELECT * FROM gas.fees
WHERE blockchain = 'base'
  AND block_month >= DATE '2025-01-01'
```

## Methodology

Gas tables are maintained by Dune ([source code](https://github.com/duneanalytics/spellbook)). Each chain has its own underlying gas model reading from the chain's `transactions` table, enriched with native token pricing for USD values.

A key feature is the `tx_fee_breakdown` MAP column, which decomposes fees into their components. For L2s like Base, this breaks down into base fee, priority fee, and L1 data fee — enabling precise rollup cost analysis.

## Example Queries

**Average gas price by chain (today):**

```sql theme={null}
SELECT
  blockchain,
  AVG(tx_fee_usd) AS avg_fee_usd,
  APPROX_PERCENTILE(tx_fee_usd, 0.5) AS median_fee_usd,
  COUNT(*) AS num_transactions
FROM gas.fees
WHERE block_date = CURRENT_DATE
GROUP BY 1
ORDER BY 2 DESC
```

**L2 fee breakdown on Base (base fee vs L1 data cost):**

```sql theme={null}
SELECT
  date_trunc('day', block_time) AS day,
  SUM(tx_fee_breakdown['base_fee']) AS total_base_fee_eth,
  SUM(tx_fee_breakdown['l1_fee']) AS total_l1_fee_eth,
  SUM(tx_fee_usd) AS total_fee_usd
FROM gas.fees
WHERE blockchain = 'base'
  AND block_month >= DATE '2025-01-01'
GROUP BY 1
ORDER BY 1
```

## Related Tables

* `rollup_economics_ethereum.l1_fees` — Aggregate daily L1 posting costs per rollup
* `rollup_economics_ethereum.l2_revenue` — Aggregate daily gas revenue per rollup

<CardGroup cols={2}>
  <Card title="Enterprise Data Solutions" icon="building" href="https://dune.com/enterprise">
    Need custom gas analytics or additional chain coverage? Talk to our enterprise team.
  </Card>

  <Card title="Build Custom Models" icon="code" href="/api-reference/connectors/overview">
    Build private gas fee analysis pipelines with the dbt Connector.
  </Card>
</CardGroup>
