2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-11 13:11:12 +00:00
Commit Graph

29 Commits

Author SHA1 Message Date
carla
7c4d71b175
liquidity: add reasons for autoloops not executing 2021-02-08 09:39:02 +02:00
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.
2021-02-08 09:39:01 +02:00
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.
2021-02-08 09:38:59 +02:00
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.
2021-02-08 09:38:23 +02:00
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.
2021-02-03 08:54:51 +02:00
carla
476ae39ce9
multi: make server side restrictions function generic 2021-02-03 08:54:50 +02:00
carla
69724757ce
multi: update autoloop labels to support both swap types 2021-02-03 08:54:50 +02:00
carla
24aa429aa0
liquidity: rename ticker and default to autoloop 2021-02-03 08:54:49 +02:00
carla
a168ba3400
liquidity: rename auto out boolean to autoloop 2021-02-03 08:54:47 +02:00
Oliver Gugger
fb9034220c
mod: update lnd to v0.12.0 2021-01-07 17:33:21 +01:00
carla
3f0fc14c34
liquidity: allow custom autoloop swap sizes within the server's limits 2020-12-01 13:06:35 +02:00
Oliver Gugger
481839b0fb
liquidity: add initiator to swap requests 2020-11-09 12:57:33 +01:00
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.
2020-10-15 13:53:27 +02:00
carla
eb6b476469
looprpc: add autoloop parameters to rpc server 2020-10-12 13:34:56 +02:00
carla
8166d936e1
multi: add opt-in automated swap dispatch to liquidity manager 2020-10-12 13:34:55 +02:00
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.
2020-10-12 13:34:54 +02:00
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).
2020-10-12 13:34:54 +02:00
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.
2020-10-12 13:34:53 +02:00
carla
0212a41ed0
liquidity: make swap suggestions fee-aware 2020-09-30 12:46:35 +02:00
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.
2020-09-30 12:46:34 +02:00
carla
64422ce26a
liquidity: exclude recently failed swaps from suggestions 2020-09-30 12:46:33 +02:00
carla
7740231bac
liquidity: make swap suggestions aware of ongoing swaps 2020-09-30 12:46:32 +02:00
carla
559abd1eea
liquidity: add default parameters struct 2020-09-30 12:46:31 +02:00
carla
ad8b5d0552
liquidity: add clock for mocking time in tests 2020-09-30 12:46:30 +02:00
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.
2020-09-30 12:46:29 +02:00
carla
340766fbb5
liquidity: add swap suggestions endpoint to manager 2020-09-03 10:36:43 +02:00
carla
8db6b32d74
liquidity: add swap suggestions for threshold rule for loop out 2020-09-03 10:36:42 +02:00
carla
cd8a7704af
liquidity: add calculations for threshold rule 2020-09-03 10:36:41 +02:00
carla
ce10cc7959
liquidity: add manager with updatable parameters 2020-09-02 11:48:27 +02:00