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

# gasStats

> Per-shard gas price and price-per-unit event with percentile breakdowns.

The server pushes this event to `gasStats` subscribers in real time on state changes (debounced at 50 ms), or every 5 seconds during idle periods. Each message covers one shard. Gas statistics combine pending mempool transactions and recent block averages per shard.

## Topic

`gasStats` via [subscribe](/api-reference/ws/subscribe)

## Event fields

<ResponseField name="type" type="string">
  Value is `"gasStats"`.
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties" defaultOpen>
    <ResponseField name="shard" type="integer">
      Shard ID (0, 1, or 2).
    </ResponseField>

    <ResponseField name="gasPrice" type="object">
      Gas price statistics over the current sliding window.

      <Expandable title="properties">
        <ResponseField name="min" type="integer">Lowest observed gas price.</ResponseField>
        <ResponseField name="max" type="integer">Highest observed gas price.</ResponseField>
        <ResponseField name="avg" type="integer">Arithmetic mean across all transactions.</ResponseField>
        <ResponseField name="bucketAvg" type="integer">Mean of per-bucket averages, less sensitive to spam.</ResponseField>

        <ResponseField name="percentiles" type="object">
          <Expandable title="properties">
            <ResponseField name="p50" type="integer">50th percentile.</ResponseField>
            <ResponseField name="p75" type="integer">75th percentile. Use this for most transactions.</ResponseField>
            <ResponseField name="p90" type="integer">90th percentile. Use this for time-sensitive transactions.</ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="ppu" type="object">
      Price-per-unit statistics. Same structure as `gasPrice`.

      <Expandable title="properties">
        <ResponseField name="min" type="integer">Lowest PPU.</ResponseField>
        <ResponseField name="max" type="integer">Highest PPU.</ResponseField>
        <ResponseField name="avg" type="integer">Mean PPU.</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json gasStats event theme={"system"}
  {
    "type": "gasStats",
    "data": {
      "shard": 0,
      "gasPrice": {
        "min": 1000000000,
        "max": 1500000000,
        "avg": 1200000000,
        "bucketAvg": 1180000000,
        "percentiles": {
          "p50": 1150000000,
          "p75": 1350000000,
          "p90": 1450000000
        }
      },
      "ppu": {
        "min": 10,
        "max": 15,
        "avg": 12
      }
    }
  }
  ```
</ResponseExample>
