Commit Graph

40 Commits (803773bb65a5bae560151896a86bcc161c47ca9d)

Author SHA1 Message Date
carla 502e47362c
liquidity: add peers to swap interface and include in set reason
This commit adds a peer listing function to our generic swap
interface, which we will use to set reasons for swaps that are
specified by peer pubkey rather than channel.
3 years ago
carla 7ca7a70430
liquidity/test: add test to demonstrate missing peer reasons 3 years ago
carla c17631eee2
liquidity: increase default confirmation target 3 years ago
carla 4535018e58
liquidity: update default budget to use flat fee percentage 3 years ago
carla d4b7f9a378
liquidity: update default fee setting to flat percentage 3 years ago
carla dd1a2de731
multi: add flat fee percentage to autoloop 3 years ago
carla c778124718
liquidity: move fees behind interface 3 years ago
carla 3f46ae514b
liquidity: add peer-level liquidity rules to allow aggregate management
We add 'peer-level' rules to allow assessment of liquidity on a per-peer
level, rather than on an individual channel basis. No overlap is allowed
with the existing set of channel rules because this could lead to
contradictory rules.
3 years ago
carla d1f121cbc6
liquidity: move swap suggestions behind interface 3 years ago
carla c6e816ad95
liquidity: move swap creation into separate function 3 years ago
carla 9c35946cab
liquidity: simplify suggest swap to return swap amount 3 years ago
carla 7c4d71b175
liquidity: add reasons for autoloops not executing 3 years ago
carla b9b75c3c32
liquidity: refactor eligible channels logic to ineligible channels
This commit switches up our eligible channels logic to rather return
a struct containing information about our current swap traffic. This
change is made in preparation for returning reasons indicating why we
did not perform a swap for a specific channel - when we only return
eligible swaps, we lose the information about why all the excluded
channels weren't used.
3 years ago
carla d5096cdc21
liquidity: relax restriction which requires no unrestricted swaps
In practice, this restriction has proven to be too strict. Autoloop will
now only hold off on a swap for a channel if a manual swap is
specifically using that channel.
3 years ago
carla 7ba1821696
liquidity: fail suggest swaps when no rules are set
In an effort to surface more information about why autoloop is not
executing, we add an error when suggest swaps is called with no rules.
In other cases we can surface a reason enum with each rule that is set,
but in the case where we have no rules, there are no results to
accompany with reasons.
3 years ago
carla 68a5336362
liquidity: move logging out of suggest swaps function
This function is already quite long, and will be extended in
the commits to follow, so we move it to the calling function.
3 years ago
carla 476ae39ce9
multi: make server side restrictions function generic 3 years ago
carla 69724757ce
multi: update autoloop labels to support both swap types 3 years ago
carla 24aa429aa0
liquidity: rename ticker and default to autoloop 3 years ago
carla a168ba3400
liquidity: rename auto out boolean to autoloop 3 years ago
Oliver Gugger fb9034220c
mod: update lnd to v0.12.0 3 years ago
carla 3f0fc14c34
liquidity: allow custom autoloop swap sizes within the server's limits 3 years ago
Oliver Gugger 481839b0fb
liquidity: add initiator to swap requests 3 years ago
carla 87b02b7715
multi: add force tick endpoint behind debug server
To itest our autolooper, we need to be able to trigger dispatch on
demand. This functionality is included in a separate rpc server behind
a dev flag. Since it is unlikely that we need to split loop into
multiple rpc servers, this commit simply adds an additional debug server
rather than opting for a full subserver setup.
4 years ago
carla eb6b476469
looprpc: add autoloop parameters to rpc server 4 years ago
carla 8166d936e1
multi: add opt-in automated swap dispatch to liquidity manager 4 years ago
carla fd17580213
liquidity: add max in flight limit to swap suggestions
To allow control over the rate at which we dispatch autoloops, we add
a limit to the number of in flight autoloops we allow.
4 years ago
carla 692620d367
liquidity: add fee budget to swap suggestions
Add a dated fee budget to our swap suggestions. This budget only applies
to automatically dispatched swaps (which will be added in later
commits). We choose to apply the fee budget to our suggestions so that
they perfectly replicate what the autolooper would do. The budget has a
start date so that it can be refreshed once it has been used up over a
period (rather than having to endlessly increase it).
4 years ago
carla bda6d36a90
liquidity/test: pass full parameters into suggest swaps and add default
As we add more parameters in this PR, we wil want to test values
beyond our default values. This commit updates the suggest swaps test
helper to take a full setup struct, and adds a default set of channels
and rules which will be used in the absense of this setup struct.
4 years ago
carla 0212a41ed0
liquidity: make swap suggestions fee-aware 4 years ago
carla 1d8609bae3
liquidity: add sweep fee limit and confirmations to suggestions
To decide whether we event want to attempt a swap, we add a fee limit
that we check against our estimate for the current number of
confirmations we want our sweep to confirm in. If fees are higher than
this limit, we do not suggest swaps.
4 years ago
carla 64422ce26a
liquidity: exclude recently failed swaps from suggestions 4 years ago
carla 7740231bac
liquidity: make swap suggestions aware of ongoing swaps 4 years ago
carla 559abd1eea
liquidity: add default parameters struct 4 years ago
carla ad8b5d0552
liquidity: add clock for mocking time in tests 4 years ago
carla 7e9034b2ff
liquidity: return OutRequest from swap suggestions and set fees
This commit updates swap suggestions to return loop out requests with
sufficient fields populated so that a loop out can directly be
dispatched from a suggestion. This requires setting of fees an min
sweep conf targets (our htlc conf target and addresss will be set by
the daemon's client rpc server if we do not provide them). We also do
some test refactoring so that we can more easily test the suggest swaps
endpoint.
4 years ago
carla 340766fbb5
liquidity: add swap suggestions endpoint to manager 4 years ago
carla 8db6b32d74
liquidity: add swap suggestions for threshold rule for loop out 4 years ago
carla cd8a7704af
liquidity: add calculations for threshold rule 4 years ago
carla ce10cc7959
liquidity: add manager with updatable parameters 4 years ago