mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-17 13:06:51 +02:00
liquidity: update default budget to use flat fee percentage
This commit is contained in:
parent
c5ee9843cd
commit
4535018e58
2 changed files with 17 additions and 6 deletions
|
|
@ -83,12 +83,9 @@ var (
|
|||
// only be used for automatically dispatched swaps if autoloop is
|
||||
// explicitly enabled, so we are happy to set a non-zero value here. The
|
||||
// amount chosen simply uses the current defaults to provide budget for
|
||||
// a single swap. We don't have a swap amount to calculate our maximum
|
||||
// routing fee, so we use 0.16 BTC for now.
|
||||
defaultBudget = defaultMaximumMinerFee +
|
||||
ppmToSat(funding.MaxBtcFundingAmount, defaultSwapFeePPM) +
|
||||
ppmToSat(defaultMaximumPrepay, defaultPrepayRoutingFeePPM) +
|
||||
ppmToSat(funding.MaxBtcFundingAmount, defaultRoutingFeePPM)
|
||||
// a single swap. We don't have a swap amount so we just use our max
|
||||
// funding amount.
|
||||
defaultBudget = ppmToSat(funding.MaxBtcFundingAmount, defaultFeePPM)
|
||||
|
||||
// defaultParameters contains the default parameters that we start our
|
||||
// liquidity manger with.
|
||||
|
|
|
|||
|
|
@ -622,6 +622,13 @@ func TestSweepFeeLimit(t *testing.T) {
|
|||
params := defaultParameters
|
||||
params.FeeLimit = defaultFeeCategoryLimit()
|
||||
|
||||
// Set our budget to cover a single swap with these
|
||||
// parameters.
|
||||
params.AutoFeeBudget = defaultMaximumMinerFee +
|
||||
ppmToSat(7500, defaultSwapFeePPM) +
|
||||
ppmToSat(7500, defaultPrepayRoutingFeePPM) +
|
||||
ppmToSat(7500, defaultRoutingFeePPM)
|
||||
|
||||
params.ChannelRules = map[lnwire.ShortChannelID]*ThresholdRule{
|
||||
chanID1: chanRule,
|
||||
}
|
||||
|
|
@ -855,6 +862,13 @@ func TestFeeLimits(t *testing.T) {
|
|||
params := defaultParameters
|
||||
params.FeeLimit = defaultFeeCategoryLimit()
|
||||
|
||||
// Set our budget to cover a single swap with these
|
||||
// parameters.
|
||||
params.AutoFeeBudget = defaultMaximumMinerFee +
|
||||
ppmToSat(7500, defaultSwapFeePPM) +
|
||||
ppmToSat(7500, defaultPrepayRoutingFeePPM) +
|
||||
ppmToSat(7500, defaultRoutingFeePPM)
|
||||
|
||||
params.ChannelRules = map[lnwire.ShortChannelID]*ThresholdRule{
|
||||
chanID1: chanRule,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue