Skip to main content

Try it Live

Run MaxPriorityFeePerGas examples in the interactive playground

MaxPriorityFeePerGas

EIP-1559 maximum priority fee per gas (tip) representing the maximum additional fee paid to miners/validators for transaction inclusion. Incentivizes faster processing and transaction ordering.

Overview

Branded bigint type representing priority fee (tip) in Wei. Goes directly to block producer. Higher tips increase inclusion probability and speed.

Quick Start

Type Definition

Branded bigint preventing confusion with other fee types. All values in Wei.

API

Construction

from(value)

Create from bigint, number, or hex string.

fromGwei(gwei)

Create from Gwei value.

fromWei(wei)

Create from Wei value (alias for from).

Conversion

toGwei(priorityFee)

Convert to Gwei.

toWei(priorityFee)

Convert to Wei (identity).

toNumber(priorityFee)

Convert to number. Warning: precision loss on large values.

toBigInt(priorityFee)

Convert to bigint (identity).

Comparison

equals(priorityFee1, priorityFee2)

Check equality.

compare(priorityFee1, priorityFee2)

Compare values. Returns -1, 0, or 1.

Priority Fee Mechanics

Fee Distribution

Priority fee goes to block producer:

Effective Priority Fee

Capped by available budget:

Priority Levels

Standard Levels (2024)

Zero Tip

Valid but may delay inclusion:

Real-world Examples

Transaction Priority

Dynamic Priority

MEV Protection

Higher tips can help with MEV:

Fee Estimation

Historical Analysis

Network-specific Defaults

Common Patterns

Retry with Higher Tip

Tip Budget

Cost Calculation

Specification