fee-suggestions
fee-suggestions copied to clipboard
Question on error when running on polygon
This is a great lib! I was wondering if this utility supports polygon mainnet?
When I import this library and use it to get suggestions for tx on polygon (as a provider) an error is throw with
node_modules/@rainbow-me/fee-suggestions/dist/index.js:133
throw new Error('Error: ema was undefined');
An example implementation
const provider = ethers.getDefaultProvider('https://polygon-mainnet.infura.io/v3/008a971363b748c7bdfb80bfe3df977e');
feeSuggestions.suggestFees(provider).then(console.log);
even stranger is that it works on the mumbai test net. Any clarity or support would be appreciated. Thank you
Hey mate, I believe this only work on the eth chain as it using EIP-1559 and the basefee math I could be wrong tho!
Hey mate, I believe this only work on the eth chain as it using EIP-1559 and the basefee math
I could be wrong tho!
Good point, I believe polygon is also on EIP-1559 now so I was hoping it would have worked all the same.
Any workarounds? We have the same issue.
Hi,
I took a look to see if there was a quick win in this regard, but there are some barriers to using this for polygon. We currently don't have capacity to exhaustively test these changes since there is significant data analysis that needs to be done on retroactive data:
Immediate issues that would need to be fixed:
getOutlierBlocksToRemovecurrently has a hardcoded5 gweicutoff for priority fees which would need to be updated to use quantiles, median absolute deviation, or a more appropriate statistical function for outlier detectionsuggestMaxPriorityFeelooks at only the past ten blocks which does not work for polygon due to higher block production
Hey,
any update on this? Why is there a hard-coded limit of 5 gwei? Here is a reproduction code, with a block that has only rewards above 5 gwei
const provider = new providers.JsonRpcProvider("https://rpc.ankr.com/gnosis");
await suggestMaxPriorityFee(provider, "28704700");