# parse_ether

Shorthand for parse_units(value, 18). Converts ETH/WETH amounts to wei. Prefer VARCHAR inputs for capital-moving amounts. Negative values and excess fractional precision are rejected; overflow currently follows parse_units compatibility behavior and wraps modulo 2^256.

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

- Kind: scalar function
- Category: [EVM utilities](/docs/category/evm-utilities.md)
- Tags: Types, EVM

Shorthand for parse_units(value, 18). Converts ETH/WETH amounts to wei. Prefer VARCHAR inputs for capital-moving amounts. Negative values and excess fractional precision are rejected; overflow currently follows parse_units compatibility behavior and wraps modulo 2^256.

## Overload 1: parse_ether(VARCHAR)

```sql
parse_ether(VARCHAR)
```

Parses a non-negative ETH value of type VARCHAR to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (VARCHAR; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 2: parse_ether(DOUBLE)

```sql
parse_ether(DOUBLE)
```

Parses a non-negative ETH value of type DOUBLE to wei using the fixed 18-decimal scale. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (DOUBLE; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 3: parse_ether(FLOAT)

```sql
parse_ether(FLOAT)
```

Parses a non-negative ETH value of type FLOAT to wei using the fixed 18-decimal scale. Prefer VARCHAR inputs for capital-moving amounts. FLOAT and DOUBLE overloads are convenience forms and can introduce floating point ambiguity before conversion to UINT256.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (FLOAT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 4: parse_ether(TINYINT)

```sql
parse_ether(TINYINT)
```

Parses a non-negative ETH value of type TINYINT to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (TINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 5: parse_ether(SMALLINT)

```sql
parse_ether(SMALLINT)
```

Parses a non-negative ETH value of type SMALLINT to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (SMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 6: parse_ether(INTEGER)

```sql
parse_ether(INTEGER)
```

Parses a non-negative ETH value of type INTEGER to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (INTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 7: parse_ether(BIGINT)

```sql
parse_ether(BIGINT)
```

Parses a non-negative ETH value of type BIGINT to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (BIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 8: parse_ether(HUGEINT)

```sql
parse_ether(HUGEINT)
```

Parses a non-negative ETH value of type HUGEINT to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (HUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 9: parse_ether(UTINYINT)

```sql
parse_ether(UTINYINT)
```

Parses a non-negative ETH value of type UTINYINT to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (UTINYINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 10: parse_ether(USMALLINT)

```sql
parse_ether(USMALLINT)
```

Parses a non-negative ETH value of type USMALLINT to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (USMALLINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 11: parse_ether(UINTEGER)

```sql
parse_ether(UINTEGER)
```

Parses a non-negative ETH value of type UINTEGER to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (UINTEGER; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 12: parse_ether(UBIGINT)

```sql
parse_ether(UBIGINT)
```

Parses a non-negative ETH value of type UBIGINT to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (UBIGINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 13: parse_ether(UHUGEINT)

```sql
parse_ether(UHUGEINT)
```

Parses a non-negative ETH value of type UHUGEINT to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (UHUGEINT; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Overload 14: parse_ether(UINT256)

```sql
parse_ether(UINT256)
```

Parses a non-negative ETH value of type UINT256 to wei using the fixed 18-decimal scale.

- Kind: scalar
- Execution context: Offline
- Behavior: Transform
- Execution modes: Offline
- Input shape: Scalar Arguments
- Planning contract: Runtime
- Cardinality: One Per Input
- Determinism: Deterministic
- Return shape: Scalar
- Schema stability: Fixed
- Stability: Stable
- Side effects: None documented

### Inputs

- `eth` (UINT256; required; positional) — Use VARCHAR for exact decimal amounts. Non-string numeric overloads are convenience forms.

### Returns

Wei amount

Returns a UINT256 wei amount scaled by 10^18.

- `wei` (UINT256)

Wei amount. Returns a UINT256 wei amount scaled by 10^18.

## Guidance

### ETH and WETH input

parse_ether is parse_units with decimals fixed at 18. It is intended for human ETH amounts before building calldata, simulation value fields, or balance comparisons.

- Use parse_ether('1.25') for exact decimal parsing.
- Use format_ether when converting raw wei back to a display string.
- Do not pass FLOAT or DOUBLE values for capital-moving ETH amounts.

```sql
SELECT parse_ether('1.25') AS wei;
```

## Additional examples

```sql
-- Convert a human ETH amount to wei without floating point
SELECT parse_ether('0.42')::VARCHAR AS wei;
-- => [{"wei":"420000000000000000"}]
```

## Related functions

- [parse_units](/docs/functions/parse_units.md) — Alternative
- [format_ether](/docs/functions/format_ether.md) — Alternative
- [parse_gwei](/docs/functions/parse_gwei.md) — See Also
