Commit Graph

71 Commits (master)

Author SHA1 Message Date
Boris Nagaev e30cb5f2a8
multi: apply make fmt 3 weeks ago
George Tsagkarelis a9be69b281
multi: use isExternalAddr flag 4 months ago
András Bánki-Horváth 7dd30a731e
Merge pull request #644 from bhandras/easy-autoloop-destaddr-fixup
liquidity: dest address support for easy autloop
8 months ago
Andras Banki-Horvath 87c8ca0d8b
liquidity: dest address support for easy autloop 8 months ago
Oliver Gugger 08026dab93
multi: update linter, fix issues 8 months ago
Slyghtning fd6a9cf3e9
loopin: consider settled invoices success 9 months ago
George Tsagkarelis 921f4d06e7
multi: integrate initiator string to various calls 10 months ago
Slyghtning 21281e3eb8
liquidity: xpub support for autoloop 10 months ago
Konstantin Nick 0781cafbfb
Merge pull request #585 from sputn1ck/sqlite
Migrate from boltdb to sql
11 months ago
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.
11 months ago
George Tsagkarelis 64d2cbe5d6
liquidity: respect feeppm if set for easyautoloop 11 months ago
George Tsagkarelis 1f72dcc095
liquidity: use easy autoloop labels 12 months ago
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.
12 months ago
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.
1 year ago
George Tsagkarelis bf4f72fd8d
liquidity: exclude prepay from total swap fees 1 year ago
George Tsagkarelis aca6428b0e
liquidity+loopd: move last budget refresh to parameters 1 year ago
George Tsagkarelis af7a470aea
liquidity+loopd: add sticky loop out swap with amount backoff 1 year ago
George Tsagkarelis b025b9ae37
multi: add recurring autoloop budget 1 year ago
George Tsagkarelis fa0393b331
multi: add OutAddr parameter for autoloop loop out 1 year ago
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.
2 years ago
Andras Banki-Horvath 391ef57ea3
loopout: enable p2tr without keyspend 2 years ago
Andras Banki-Horvath 901a935514
loopin: enable p2tr htlcs without keyspend 2 years ago
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.
2 years ago
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.
2 years ago
yyforyongyu 9c5ac0fb36
liquidity: move parameters into a new file
This commit refactors the `liquidity` by moving `Parameters` related
code into one file.
2 years ago
sputn1ck a1271fee40
multi: fix linter issues 2 years ago
Harsha Goli 7a16e3b25d
multi: bump btcec/v2 and btcutil to new versions 2 years ago
carla 5280721636
multi: add ability to autoloop in 2 years ago
carla 5e47a0c6e9
multi: add loop in swap builder implementation 2 years ago
carla 8113c34bce
liquidity: add failed loop in swaps to swap traffic 2 years ago
carla 965b99d455
liquidity: add existing loop in swaps to budget calculations 2 years ago
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.
2 years ago
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.
2 years ago
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.
2 years ago
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.
3 years ago
carla 8bd7ee35be
liquidity: add swap builder interface 3 years ago
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 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 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