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

# EIP-1559

> How EIP-1559 changed gas estimation and transaction fees on Polygon PoS, and how Type 2 transactions differ from legacy transactions.

The [London hard fork](https://blog.polygon.technology/eip-1559-upgrades-are-going-live-on-polygon-mainnet/) introduced [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) to Polygon, modifying how gas estimation and transaction costs work.

## What changed

Before EIP-1559, transactions specified a single `gasPrice` field. Miners prioritized transactions with higher `gasPrice` bids. This model made gas estimation unpredictable during periods of high demand.

EIP-1559 introduced a new transaction type, Type 2, which splits the old `gasPrice` into two components:

* **`baseFee`**: a network-determined fee that is burned, calculated based on how full the previous block was. All transactions must pay this fee.
* **`priorityFee` (tip)**: an optional amount offered to the validator to prioritize the transaction.

The relationship is: `maxFeePerGas` sets the ceiling on what you are willing to pay. The actual fee paid is `baseFee + priorityFee`, where `priorityFee = min(maxPriorityFeePerGas, maxFeePerGas - baseFee)`.

Legacy Type 0 transactions remain compatible but the Type 2 format is recommended.

## Legacy transaction (Type 0)

In a legacy transaction, only `gasPrice` is specified:

```jsx theme={null}
const sendLegacyTransaction = async () => {
    const web3 = new Web3('https://polygon-rpc.com');

    await web3.eth.sendTransactions({
        from: 0x05158d7a59FA8AC5007B3C8BabAa216568Fd32B3,
        to: 0xD7Fbe63Db5201f71482Fa47ecC4Be5e5B125eF07,
        value: 1000000000000000000,
        gasPrice: 200000000000
    })
}
```

## Type 2 transaction (EIP-1559)

Type 2 transactions use `maxPriorityFeePerGas` instead of `gasPrice`. The `baseFee` is paid regardless, so only the tip is bid:

```jsx theme={null}
const sendEIP1559Transaction = async () => {
    const web3 = new Web3('https://polygon-rpc.com');

    await web3.eth.sendTransactions({
        from: 0xFd71Dc9721d9ddCF0480A582927c3dCd42f3064C,
        to: 0x8C400f640447A5Fc61BFf7FdcE00eCf20b85CcAd,
        value: 1000000000000000000,
        maxPriorityFeePerGas: 40000000000
    })
}
```

## Gas estimation

The Polygon Gas Station V2 provides current gas fee estimates:

```
https://gasstation.polygon.technology/v2
```

Sample response:

```json theme={null}
{
 "safeLow": {
  "maxPriorityFee": 37.181444553750005,
  "maxFee": 326.2556979087
 },
 "standard": {
  "maxPriorityFee": 49.575259405,
  "maxFee": 435.00759721159994
 },
 "fast": {
  "maxPriorityFee": 61.96907425625,
  "maxFee": 543.7594965144999
 },
 "estimatedBaseFee": 275.308812719,
 "blockTime": 6,
 "blockNumber": 23948420
}
```

## See also

* [How to send transactions with EIP-1559](https://docs.alchemy.com/alchemy/guides/eip-1559/send-tx-eip-1559) - covers both the legacy and EIP-1559 approaches.
* [Send an EIP-1559 transaction with ethers.js](https://www.quicknode.com/guides/web3-sdks/how-to-send-an-eip-1559-transaction) - quicknode guide.
