liquidity: update default budget to use flat fee percentage

pull/351/head
carla 3 years ago
parent c5ee9843cd
commit 4535018e58
No known key found for this signature in database
GPG Key ID: 4CA7FE54A6213C91

@ -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…
Cancel
Save