loop
loop copied to clipboard
loopout: re-target sweep's feerate every block
trafficstars
Add type loopOutSweepFeerateProvider which determines confTarget based on distance to swap expiration, then determines feerate and fee using. Fee rate is plugged into sweepbatcher using WithCustomFeeRate.
When determining confTarget, there are few adjustments over raw distance to cltv_expiry:
- make sure confTarget is positive (if the swap has expired, raw distance is negative)
- If confTarget is less than or equal to
DefaultSweepConfTargetDelta(10), cap it withurgentSweepConfTargetand apply fee factor (1.1x).
Also, if feerate is less than floor (1 sat/vbyte), then the floor is used.
DefaultSweepConfTargetDelta was decreased from 18 to 10.
Every block 100 sats/kw fee bump is disabled. Sweepbatcher re-targets feerate every block according to current mempool conditions and the number of blocks until expiry.
Added tests for loopOutSweepFeerateProvider simulating various conditions.
Pull Request Checklist
- [ ] Update
release_notes.mdif your PR contains major features, breaking changes or bugfixes