Learn · Fees

Gas fees explained across chains

Gas is what you pay the network to process your transaction, and it works differently enough across chains that a habit which is cheap on one can be expensive on another. Understanding gas — base fees, priority fees, and why a failed transaction still costs money — helps you time trades, avoid getting stuck, and choose the right network for a given trade size. This article explains the gas model on Ethereum, layer-2 networks, and Solana, and how each shapes your real cost.

What gas actually pays for

Every transaction consumes computational work that validators perform and are compensated for. Gas is the unit of that work, and your fee is the gas used multiplied by a price you pay per unit. Crucially, gas is paid in the chain's native coin and is largely independent of your trade size — a swap costs roughly the same in gas whether you move a hundred dollars or a hundred thousand. That is why small trades feel gas-heavy and large trades barely notice it.

Ethereum mainnet: base fee plus tip

Ethereum uses a base fee that adjusts automatically with network demand, plus an optional priority tip to encourage faster inclusion. During quiet periods fees are modest; during NFT mints, token launches, or macro volatility they spike sharply. For small trades on mainnet, gas can exceed the value of the trade itself, which is a strong reason to use a layer 2 for routine activity and reserve mainnet for size.

Layer 2s: cheaper execution, anchored to Ethereum

Networks like Arbitrum and Base execute transactions cheaply and post data back to Ethereum for security. Their gas is a fraction of mainnet's, which makes frequent trading and small sizes practical. Fees still fluctuate with their own congestion, and they are paid in ETH on those networks. For most retail-sized swaps, an L2 offers the best balance of cost and security.

Solana: priority fees instead of auctions

Solana charges a very low base fee and adds a priority fee during congestion to determine inclusion order, rather than running a gas auction. Most of the time fees are negligible; during hot mints, raising the priority fee modestly is what gets your transaction included. Keep a little SOL on hand at all times so a swap is never blocked for lack of fee budget.

Why failed transactions still cost gas

A transaction that reverts — because slippage was too tight, liquidity moved, or it ran out of gas — still consumed validator work up to the point of failure, so on most EVM chains you still pay. This is why setting slippage sensibly and keeping a gas buffer matters: avoidable failures are avoidable costs. Before resubmitting a stuck transaction, check the explorer, because a duplicate can compound the expense.

Legal

Risk disclosure

XAUConnect is a non-custodial swap aggregator. Digital assets are volatile and may lose value rapidly. Content on this page is educational and not investment advice. Verify every contract address on the official block explorer before approving a transaction.

Frequently asked questions

Does gas depend on how much I trade?

Largely no. Gas pays for computation, which is similar regardless of trade value, so small trades feel gas-heavy while large trades barely notice it.

Why is Ethereum mainnet sometimes so expensive?

Its base fee rises with demand and spikes during mints and volatility. For small or frequent trades, a layer 2 is usually far cheaper.

How is Solana gas different?

Solana uses a tiny base fee plus an optional priority fee during congestion rather than an auction. Keep some SOL available so transactions are never blocked.

Why did I pay gas for a failed transaction?

Because validators performed work up to the failure point. Set slippage sensibly and keep a gas buffer to avoid paying for avoidable reverts.

Live execution

Trade on XAUConnect

Open the swap page to compare live routes, set slippage, and sign from your own wallet — fully non-custodial.

Continue exploring

Related markets, guides & networks

Curated next steps based on this topic — deepen your research before you trade.

Build programmatically

Swap via API for bots and AI agents — quotes, builds, and cross-chain routes.

Developer quickstart