# get_gas_price

Returns the RPC provider's current legacy gas-price estimate as an exact UINT256 value in Wei.

Canonical HTML: <https://determica.com/docs/functions/get_gas_price>

- Kind: scalar function
- Category: [Chain reads](/docs/category/chain-reads.md)
- Tags: RPC

Returns the RPC provider's current legacy gas-price estimate as an exact UINT256 value in Wei.

## Overload 1: get_gas_price(CLIENT)

```sql
get_gas_price(CLIENT)
```

Reads one current gas-price observation through the supplied client.

- Kind: scalar
- Execution context: Live RPC
- Behavior: Immediate Read
- Execution modes: Live Client
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: External State
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: network_io

### Requirements

- attached_live_client
- rpc

### Risks

- provider_limits
- chain_reorganization

### Inputs

- `client` (CLIENT; required; positional) — Attached live CLIENT used for the current gas-price observation.

### Returns

Current gas price in Wei

Exact UINT256 quantity returned by eth_gasPrice. Use format_units(gas_price_wei, 9) to display Gwei.

- `gas_price_wei` (UINT256)

Current gas price in Wei. Exact UINT256 quantity returned by eth_gasPrice. Use format_units(gas_price_wei, 9) to display Gwei.

### Examples

_Named parameters · Needs RPC · RPC required_

```sql
WITH observed AS MATERIALIZED (
  SELECT get_gas_price($client) AS gas_price_wei
)
SELECT
  gas_price_wei,
  format_units(gas_price_wei, 9) AS gas_price_gwei,
  gas_price_wei > 0::UINT256 AS is_positive
FROM observed;
```

## Guidance

### Observation boundary

The result reflects the provider's current estimate and can change between calls.

Persist one result when downstream calculations must share the same observation.

This is a legacy gas-price estimate; EIP-1559 fee selection also depends on base fee and priority fee.
