framework
framework copied to clipboard
Implement adaptive fee strategy
The only currently implemented FeeStrategy is ConstantFeeStrategy, that lets the user configure a fee that will always be used for settlement. However, this is rarely how real scenarios work.
For production, we want to look at the current fee market rate and go a bit above that.
So we should build a new module AdaptiveFeeStrategy that does that.
Possible sources it look at:
- Last block and the transactions included there, then choose the fee of the n-lowest transaction
- The current public mempool and therefore the expected inclusion likelihood based on the fee levels there
Also, the amount we "go above" the obtained fee should be configurable, either by a constant amount or a percentage (probably the latter).