Skip to main content
Use real-time gas statistics from the Relayer to submit transactions at the selected gas price for cost and confirmation speed.

Gas pricing fundamentals

Every MultiversX transaction specifies a gasPrice in atomic EGLD units (10^-18 EGLD) and a gasLimit in gas units:
fee = gasPrice * gasUsed
The network enforces a minimum gasPrice of 1,000,000,000 (10^9). Validators prioritize higher-priced transactions, so the minimum price during congestion risks delayed inclusion. PPU (price per unit) is the effective cost per gas unit. For transactions with a non-empty data field, each byte costs an additional 1,500 gas units. PPU accounts for this overhead, so it compares costs across transaction types more accurately than raw gasPrice.

The sliding window

Gas statistics are computed over a 30-minute sliding window of 10-second buckets (180 buckets total). As time advances, the oldest bucket expires and the window shifts forward.
MetricMeasuresSpam sensitivity
avgMean over all transactions in windowBiased low by spam volume
bucketAvgMean of per-bucket averagesLess sensitive to volume spikes
p5050th percentile gas priceOften at minimum during spam
p7575th percentileSpam-resistant; typical legitimate price
p9090th percentileUpper bound; high congestion
Spam attacks cluster at the minimum price. The p75 percentile filters these out and reflects what legitimate transactions paid, making it a stronger default for most applications.

Choosing the right percentile

ScenarioRecommendedRationale
Background operationsp50 or bucketAvgCheapest with historical inclusion
Standard user swapsp75Reliable inclusion without overpay
Time-sensitive arbitragep90Competitive even during congestion
Mempool pressure > 0.5Shift up one tier (e.g., p75p90)Queue is growing; higher price improves ordering
Shard has no transactions1,000,000,000 (minimum)Shard is idle; minimum is sufficient
When a shard reports all gas price fields as 1000000000 and PPU as 0, it has no recent transaction history. The minimum price is sufficient.

Using mempool pressure

The networkStats stream on wss://relayer.xoxno.com/ws/stats pushes updates at adaptive intervals. Each message includes mempool.pressure per shard, representing current queue depth relative to throughput capacity.
function selectPercentile(pressure, baseline = 'normal') {
  if (pressure > 0.75) return 'p90';   // heavy congestion
  if (pressure > 0.50) return 'p75';   // moderate
  if (pressure > 0.25) return 'p75';   // light
  return baseline === 'low' ? 'bucketAvg' : 'p75';
}

Block time expectations

Transaction typeCurrent networkAfter Supernova (600 ms blocks)
Same-shard~6 seconds~600 ms
Cross-shard~12 seconds (two block rounds)~1.2 seconds
The blockTimeMsP50ByShard field in networkStats gives the current median block time per shard. For cross-shard transactions, sum both shards.

Adaptive gas pricing example

printf '{"action":"subscribe","topic":"gasStats"}\n' \
  | websocat wss://relayer.xoxno.com/ws

Practical guidelines

Do:
  • Subscribe to gasStats before your first transaction; the first message arrives immediately
  • Default to p75 for user-facing swaps
  • Escalate to p90 during periods of high network activity
  • Use bucketAvg for background or non-urgent operations
Avoid:
  • Using the raw avg field (spam volume biases it low)
  • Setting gasPrice below 1,000,000,000 (the network rejects it)
  • Caching gas stats beyond a few seconds; conditions shift within a single block

Gas statistics

Full gasStats message schema and field descriptions.

Network stats

networkStats stream with mempool pressure data.