Skip to content

[fix] Reduce Outlier Impact on AVAX Fees

Ursa (9R) requested to merge ursa/avax-fees into develop

Gas price observations on AVAX have still been rather noisy, after some digging it appears that this is due to high variance in the gas price paid across transactions in a block - you can observe min/max by hovering on a candle here for example: https://snowtrace.io/chart/gasprice. Unlike Ethereum where blocks are quite dense and gas is expensive, Avalanche blocks are sparsely populated, and gas is cheap so payers likely do little to optimize it.

The algorithm used for the Ethereum gas relied on the 25th percentile in a block, along with 3x the standard deviation to account for times of gas price volatility, but this did not translate well to Avalanche based on the above reasoning. This change updates the fee estimation for Avalanche to instead compute a simple median over the median gas prices in the gas cache window - which should be far more resistant to outliers.

Merge request reports