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

76 Commits

Author SHA1 Message Date
George Tsagkarelis
bf4f72fd8d
liquidity: exclude prepay from total swap fees 2023-04-12 19:02:13 +03:00
Andras Banki-Horvath
4d34eb97ce
build: fixup new linter issues 2023-03-29 15:56:40 +02:00
George Tsagkarelis
55c769ef9d
liquidity: parse old auto budget to new parameters 2023-03-20 17:20:56 +02:00
George Tsagkarelis
aca6428b0e
liquidity+loopd: move last budget refresh to parameters 2023-03-16 02:10:32 +02:00
George Tsagkarelis
c17e5a6fc6
liquidity: fix tests for autoloop sticky loop out 2023-03-09 00:43:07 +02:00
George Tsagkarelis
af7a470aea
liquidity+loopd: add sticky loop out swap with amount backoff 2023-03-09 00:43:07 +02:00
George Tsagkarelis
3b896babc6
liquidity: add test for recurring budget 2023-02-22 19:48:04 +02:00
George Tsagkarelis
5d6be011f9
liquidity: tweak autoloop tests for recurring budget 2023-02-22 19:48:04 +02:00
George Tsagkarelis
b025b9ae37
multi: add recurring autoloop budget 2023-02-22 19:48:03 +02:00
George Tsagkarelis
a14f6e8bd6
liquidity: add autoloop test for outaddr 2022-12-16 12:02:46 +02:00
George Tsagkarelis
fa0393b331
multi: add OutAddr parameter for autoloop loop out 2022-12-16 12:02:46 +02:00
Andras Banki-Horvath
88956455b4
multi: completely remove support for NP2WSH htlcs
This commit removes all code related to NP2WSH htlcs. These were
historically used when segwit adoption was very sporadic and are not
used anywhere anymore. Some historical swaps stored in the DB may be
listed with incorrect htlc adresses from here on.
2022-11-04 17:14:53 +01:00
sputn1ck
0f924b36cd
multi: bump lndclient and lnd version to latest
Co-authored-by: Oliver Gugger <gugger@gmail.com>
2022-07-07 17:28:22 +02:00
Andras Banki-Horvath
391ef57ea3
loopout: enable p2tr without keyspend 2022-06-30 16:59:55 +02:00
Andras Banki-Horvath
901a935514
loopin: enable p2tr htlcs without keyspend 2022-06-30 16:59:55 +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
Oliver Gugger
d5952f1202
multi: bump all dependency to use lnd 0.15.0-beta.rc4
This commit bumps all dependencies to be in line with what's required
for the current release candidate of lnd 0.15.0-beta.
2022-06-03 10:50:47 +02: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
66d16f52a7
liquidity/test: add autoloop in tests 2021-12-15 09:01:23 +02: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
5e47a0c6e9
multi: add loop in swap builder implementation 2021-12-15 09:01:20 +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
0f0be28599
liquidity: add loop in fees to fee categories 2021-11-30 13:18:31 +02:00
carla
c067169e6f
liquidity: add loop fee estimation and swap interface impl
Add an implementation of our swap interface which can be used for
loop in, and fee estimation. For fee estimation, we always want to
calculate worst case loop in fees, so that autoloop never goes over
its budget. However, for loop in we can't estimate how much a
timeout would cost, because we must sweep the output (can't set
a limit like loop out), and fee estimation in a few hundred blocks
(when we'd sweep the timeout) is totally unreliable.

Instead, we use a high fee rate as our best-effort fee rate for
the future. We can also be confident that that loop in swaps will
succeed, since once the htlc is locked in, all that is required
is for the server to sweep.
2021-11-30 13:18:30 +02:00
carla
3e7782e1ab
liquidity: use builder in single place
In preparation of supporting multiple swap types, we move our swap
builder into a single place, so that we can check our `maySwap`
restriction per-swap (since we'll now have different checks for
different swap types.

To save ourselves from making multiple calls to the loop server for
the restrictions placed on each swap type, we still pass a single
set of restrictions in.
2021-11-30 13:18:29 +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
00c2d4e5f0
liquidity: generalize threshold rule variable names
The current wording in this function is very specific to loop out.
In this commit, we refactor to use `target` and `reserve` rather
than inbound and outbound so that it can be used more generically.
2021-11-30 13:18:26 +02:00
carla
cca5926263
multi: bump lndclient to v0.12.0-13
To allow code with more up-to-date dependencies to import loop, we
bump our lndclient version. The minimum loop version remains 11.1
since we're not using any new apis.
2021-10-24 10:22:30 +02:00
carla
8bd7ee35be
liquidity: add swap builder interface 2021-09-28 10:31:04 +02:00
carla
4df6a4e7ca
liquidity: move loopout swap suggestion out of interface file 2021-09-17 12:50:39 +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
d1f121cbc6
liquidity: move swap suggestions behind interface 2021-02-17 10:55:38 +02:00
carla
c6e816ad95
liquidity: move swap creation into separate function 2021-02-17 10:55:36 +02:00
carla
9c35946cab
liquidity: simplify suggest swap to return swap amount 2021-02-16 13:31:48 +02:00
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