Commit Graph

64 Commits (v0.20.1-beta)

Author SHA1 Message Date
sputn1ck 0f924b36cd
multi: bump lndclient and lnd version to latest
Co-authored-by: Oliver Gugger <gugger@gmail.com>
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
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.
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 66d16f52a7
liquidity/test: add autoloop in tests 2 years ago
carla 5280721636
multi: add ability to autoloop in 2 years ago
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.
2 years ago
carla 5e47a0c6e9
multi: add loop in swap builder implementation 2 years ago
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.
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 0f0be28599
liquidity: add loop in fees to fee categories 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 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.
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 4df6a4e7ca
liquidity: move loopout swap suggestion out of interface file 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 7ca7a70430
liquidity/test: add test to demonstrate missing peer reasons 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 dd1a2de731
multi: add flat fee percentage to autoloop 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
carla 476ae39ce9
multi: make server side restrictions function generic 3 years ago
carla 69724757ce
multi: update autoloop labels to support both swap types 3 years ago
carla 24aa429aa0
liquidity: rename ticker and default to autoloop 3 years ago
carla a168ba3400
liquidity: rename auto out boolean to autoloop 3 years ago
Oliver Gugger fb9034220c
mod: update lnd to v0.12.0 3 years ago
carla 3f0fc14c34
liquidity: allow custom autoloop swap sizes within the server's limits 4 years ago
Oliver Gugger 481839b0fb
liquidity: add initiator to swap requests 4 years ago
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.
4 years ago
carla eb6b476469
looprpc: add autoloop parameters to rpc server 4 years ago
carla 8166d936e1
multi: add opt-in automated swap dispatch to liquidity manager 4 years ago