Browse Source

loop: add autoout parameters to cli

pull/295/head
carla 1 month ago
parent
commit
a2edd78f5a
No known key found for this signature in database GPG Key ID: 4CA7FE54A6213C91
1 changed files with 44 additions and 0 deletions
  1. +44
    -0
      cmd/loop/liquidity.go

+ 44
- 0
cmd/loop/liquidity.go View File

@ -224,6 +224,30 @@ var setParamsCommand = cli.Command{
"previously had a failed swap will be " +
"included in suggestions.",
},
cli.BoolFlag{
Name: "autoout",
Usage: "set to true to enable automated dispatch " +
"of loop out swaps, limited to the budget " +
"set by autobudget",
},
cli.Uint64Flag{
Name: "autobudget",
Usage: "the maximum amount of fees in satoshis that " +
"automatically dispatched loop out swaps may " +
"spend",
},
cli.Uint64Flag{
Name: "budgetstart",
Usage: "the start time for the automated loop " +
"out budget, expressed as a unix timestamp " +
"in seconds",
},
cli.Uint64Flag{
Name: "autoinflight",
Usage: "the maximum number of automatically " +
"dispatched swaps that we allow to be in " +
"flight",
},
},
Action: setParams,
}
@ -304,6 +328,26 @@ func setParams(ctx *cli.Context) error {
flagSet = true
}
if ctx.IsSet("autoout") {
params.AutoLoopOut = ctx.Bool("autoout")
flagSet = true
}
if ctx.IsSet("autobudget") {
params.AutoOutBudgetSat = ctx.Uint64("autobudget")
flagSet = true
}
if ctx.IsSet("budgetstart") {
params.AutoOutBudgetStartSec = ctx.Uint64("budgetstart")
flagSet = true
}
if ctx.IsSet("autoinflight") {
params.AutoMaxInFlight = ctx.Uint64("autoinflight")
flagSet = true
}
if !flagSet {
return fmt.Errorf("at least one flag required to set params")
}

Loading…
Cancel
Save