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

71 Commits

Author SHA1 Message Date
Boris Nagaev
e30cb5f2a8
multi: apply make fmt 2024-04-23 15:18:15 -03:00
George Tsagkarelis
a9be69b281
multi: use isExternalAddr flag 2024-01-23 20:38:07 +02:00
András Bánki-Horváth
7dd30a731e
Merge pull request #644 from bhandras/easy-autoloop-destaddr-fixup
liquidity: dest address support for easy autloop
2023-10-04 14:26:00 +02:00
Andras Banki-Horvath
87c8ca0d8b
liquidity: dest address support for easy autloop 2023-10-04 14:18:37 +02:00
Oliver Gugger
08026dab93
multi: update linter, fix issues 2023-10-03 19:36:40 +02:00
Slyghtning
fd6a9cf3e9
loopin: consider settled invoices success 2023-09-01 13:09:10 +02:00
George Tsagkarelis
921f4d06e7
multi: integrate initiator string to various calls 2023-07-28 14:43:18 +03:00
Slyghtning
21281e3eb8
liquidity: xpub support for autoloop 2023-07-27 13:51:53 +02:00
Konstantin Nick
0781cafbfb
Merge pull request #585 from sputn1ck/sqlite
Migrate from boltdb to sql
2023-06-20 19:54:37 +02: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
64d2cbe5d6
liquidity: respect feeppm if set for easyautoloop 2023-06-14 15:53:09 +03:00
George Tsagkarelis
1f72dcc095
liquidity: use easy autoloop labels 2023-06-02 14:00:58 +03: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
fad9f40ae3
liquidity+loopd: add easy autoloop
Adds the easy autoloop function which executes a budget update and the
best easy-autoloop swap. The easy-autoloop function re-uses functions
used in the normal autoloop that relate to on-going swaps and traffic
summary.
2023-05-22 15:48:38 +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
af7a470aea
liquidity+loopd: add sticky loop out swap with amount backoff 2023-03-09 00:43:07 +02:00
George Tsagkarelis
b025b9ae37
multi: add recurring autoloop budget 2023-02-22 19:48:03 +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
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
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
5e47a0c6e9
multi: add loop in swap builder implementation 2021-12-15 09:01:20 +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
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
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
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
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
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
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