2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-08 01:10:29 +00:00
Commit Graph

47 Commits

Author SHA1 Message Date
George Tsagkarelis
e9bc1dcc9e
multi: add initiator to mocked interfaces for tests 2023-07-28 14:43:19 +03:00
sputn1ck
becc8a38d8
multi: use context in loopdb call
This commit adds a context to our loopdb interface, which we should use
in the sqlite migration.
2023-06-19 12:28:32 +02:00
George Tsagkarelis
a48924a664
liquidity: get autoloop flag directly from params
Previously we would exclusively pass the autoloop boolean to multiple
functions while they had directly access to the manager's parameters.
With this commit we remove this explicit flag from the various function
interfaces and retrieve the value directly from the parameters.
2023-05-29 13:24:16 +03:00
George Tsagkarelis
36f014ac0a
liquidity: fix tests to reflect new miner fee scaling 2023-05-12 14:21:39 +03:00
George Tsagkarelis
102d3cdd1a
liquidity: differentiate autoloop expected vs max miner fees 2023-05-12 14:21:39 +03:00
George Tsagkarelis
bf4f72fd8d
liquidity: exclude prepay from total swap fees 2023-04-12 19:02:13 +03:00
George Tsagkarelis
aca6428b0e
liquidity+loopd: move last budget refresh to parameters 2023-03-16 02:10:32 +02:00
George Tsagkarelis
5d6be011f9
liquidity: tweak autoloop tests for recurring budget 2023-02-22 19:48:04 +02:00
yyforyongyu
425a007aaf
loopd+liquidity: persist parameters on disk
This commit saves the RPC request used to construct the `Parameters` on
disk. Since it's a proto message, an easy way to read/write it is to
rely on the proto marshal/unmarshal methods. A side effect is that
migration also becomes easy as proto message have its own internal
mechanism to keep track of the compatibility.
2022-06-07 20:18:11 +08:00
yyforyongyu
8217ee31c3
liquidity+loopd: refactor SetParameters to take a rpc request
This commit refactors the method `manager.SetParameters` to take a
`SetLiquidityParamsRequest`. As we'll see in the following commit, this
will enable us saving the params to disk more easily.
2022-06-07 19:19:52 +08:00
yyforyongyu
9c5ac0fb36
liquidity: move parameters into a new file
This commit refactors the `liquidity` by moving `Parameters` related
code into one file.
2022-06-07 19:19:52 +08:00
sputn1ck
a1271fee40
multi: fix linter issues 2022-05-20 10:16:46 +02:00
Harsha Goli
7a16e3b25d
multi: bump btcec/v2 and btcutil to new versions 2022-03-25 11:00:16 +01:00
carla
5280721636
multi: add ability to autoloop in 2021-12-15 09:01:22 +02:00
carla
f6c3d77c51
liquidity/test: use mock for server restrictions
This change makes the test easier to change when we add loop in
restrictions as well.
2021-12-15 09:01:21 +02:00
carla
26886731d4
multi: remove shadowed label variable in loopin swaps
We already have a Label field in the embedded SwapContract
field for loop in swaps. This commit removes an erroneously
added Label field in LoopInContract which may be a cause of
ambiguity when referencing this field.
2021-12-09 13:40:34 +02:00
carla
8113c34bce
liquidity: add failed loop in swaps to swap traffic 2021-11-30 13:18:32 +02:00
carla
965b99d455
liquidity: add existing loop in swaps to budget calculations 2021-11-30 13:18:32 +02:00
carla
25b8d20f75
liquidity: add type to rules
In preparation for adding loop in swaps, we relate liquidity rules
to a specific type of swap that we want to dispatch. This allows us
to use a single rule format for multiple swap types.
2021-11-30 13:18:27 +02:00
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.
2021-03-25 11:26:58 +02:00
carla
7ca7a70430
liquidity/test: add test to demonstrate missing peer reasons 2021-03-24 15:13:30 +02:00
carla
c17631eee2
liquidity: increase default confirmation target 2021-03-05 09:53:27 +02:00
carla
4535018e58
liquidity: update default budget to use flat fee percentage 2021-03-05 09:02:35 +02:00
carla
d4b7f9a378
liquidity: update default fee setting to flat percentage 2021-03-04 10:21:22 +02:00
carla
dd1a2de731
multi: add flat fee percentage to autoloop 2021-03-04 10:14:37 +02:00
carla
c778124718
liquidity: move fees behind interface 2021-03-04 10:14:35 +02:00
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.
2021-02-17 10:56:30 +02:00
carla
7c4d71b175
liquidity: add reasons for autoloops not executing 2021-02-08 09:39:02 +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
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
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
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
ce10cc7959
liquidity: add manager with updatable parameters 2020-09-02 11:48:27 +02:00