anza-xyz / agave

Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.
https://www.anza.xyz/
Apache License 2.0
450 stars 220 forks source link

Improve priority fee RPC call #3332

Open Woody4618 opened 4 weeks ago

Woody4618 commented 4 weeks ago

Problem

At the moment there is no way to figure out average fees via RPC call to land transactions. Without it it is really hard to land transactions and its easy to over or underpay without that information.

The getRecentPrioritizationFees is not sufficient. For the loaded program for example it returns { prioritizationFee: 0, slot: 298150993 }, but even with 10k micro lamports per CU most of the transactions do not land.

Proposed Solution

Add an RPC that takes a parameter low, average, high and returns the average of the last few blocks.

There are some APIs from helius and quick node for example which could be used as reference. https://marketplace.quicknode.com/add-on/solana-priority-fee https://docs.helius.dev/solana-rpc-nodes/priority-fee-api

brianlong commented 2 weeks ago

Related PR here: https://github.com/anza-xyz/agave/pull/217 (Needs to be re-opened)

Woody4618 commented 2 weeks ago

This would be a good solution if upstreamed i think. https://github.com/helius-labs/atlas-priority-fee-estimator