Skip to main content
The London hard fork introduced 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:
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:
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:
{
 "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