coral-xyz / backpack

🎒 Next level crypto wallet
https://backpack.app
GNU General Public License v3.0
1.38k stars 824 forks source link

automatic priority fees #2063

Open armaniferrante opened 1 year ago

armaniferrante commented 1 year ago

Currently priority fees are only enabled in developer mode. We should use them automatically when not in developer mode. We will need some type of heuristic or retry logic for this. Related API that will come out in 1.14: https://github.com/solana-labs/solana/pull/27278

armaniferrante commented 1 year ago

We should use the new API in web3.js for this https://github.com/solana-labs/solana-web3.js/issues/1095

jeivardan commented 1 year ago

@armaniferrante I've just closed the issue solana-labs/solana-web3.js#1095 and the api is availbale from v1.75.0 which is available now. Can I work on this issue of adding automatic priority fees?

jeivardan commented 1 year ago

getRecentPrioritizationFees API returns an array for ex:

[ { "slot": 348125, "prioritizationFee": 0 }, { "slot": 348126, "prioritizationFee": 1000 }, { "slot": 348127, "prioritizationFee": 500 }, { "slot": 348128, "prioritizationFee": 0 }, { "slot": 348129, "prioritizationFee": 1234 } ]

where, slot: slot in which the fee was observed prioritizationFee: the per-compute-unit fee paid by at least one successfully landed transaction, specified in increments of 0.000001 lamports.

So, What type of information about priority fees should we display in the UI? Should we show the max, min, or average prioritization fee for a given block in the UI, or some other metric?