You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a number of issues with the current code, but they all boil down to very poor gas estimation.
The calculation only looks at transactions - it ignores blocks that aren't full.
The calculation only looks at gas price for the transaction, so smaller transactions (which tend towards higher gas prices) take up a disproportionate piece of the total gas.
[FIX 1&2]: These two can be solved by weighting by gas cost - make the percentage the % of 20,000,000 that the token fills.
The buffer only holds 2-3 blocks worth of transactions. To calculate a more stable price, you need a longer lookback.
[FIX 3]: Rather than calculating over a buffer, run the calculation for each block individually (including the weighting from fix 1&2), store the values for each block using, and weighted average over a different number of blocks for each one (highest 10 of the last 15 blocks for safelow, highest 7 for standard, highest 4 for fast, and highest 2 for fastest)
The percentage calculations value outliers incredibly highly.
[FIX 4]: Use 98% rather than 100% for "highest". There's no need to match a single over-high data point when your goal is "just get this confirmed"
The calculation doesn't take into account how long pending transactions have been waiting - "safelow" and "fast" transactions complete at the same speed.
The text was updated successfully, but these errors were encountered:
There's a number of issues with the current code, but they all boil down to very poor gas estimation.
The calculation only looks at transactions - it ignores blocks that aren't full.
The calculation only looks at gas price for the transaction, so smaller transactions (which tend towards higher gas prices) take up a disproportionate piece of the total gas.
[FIX 1&2]: These two can be solved by weighting by gas cost - make the percentage the % of 20,000,000 that the token fills.
[FIX 3]: Rather than calculating over a buffer, run the calculation for each block individually (including the weighting from fix 1&2), store the values for each block using, and weighted average over a different number of blocks for each one (highest 10 of the last 15 blocks for safelow, highest 7 for standard, highest 4 for fast, and highest 2 for fastest)
[FIX 4]: Use 98% rather than 100% for "highest". There's no need to match a single over-high data point when your goal is "just get this confirmed"
The text was updated successfully, but these errors were encountered: