Commit Graph

47 Commits (master)

Author SHA1 Message Date
George Tsagkarelis e9bc1dcc9e
multi: add initiator to mocked interfaces for tests 9 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.
10 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.
11 months ago
George Tsagkarelis 36f014ac0a
liquidity: fix tests to reflect new miner fee scaling 12 months ago
George Tsagkarelis 102d3cdd1a
liquidity: differentiate autoloop expected vs max miner fees 12 months 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 5d6be011f9
liquidity: tweak autoloop tests for recurring budget 1 year 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 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 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 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 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 7c4d71b175
liquidity: add reasons for autoloops not executing 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 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 3f0fc14c34
liquidity: allow custom autoloop swap sizes within the server's limits 3 years ago
Oliver Gugger 481839b0fb
liquidity: add initiator to swap requests 4 years ago
carla 8166d936e1
multi: add opt-in automated swap dispatch to liquidity manager 4 years ago
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.
4 years ago
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).
4 years ago
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.
4 years ago
carla 0212a41ed0
liquidity: make swap suggestions fee-aware 4 years ago
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.
4 years ago
carla 64422ce26a
liquidity: exclude recently failed swaps from suggestions 4 years ago
carla 7740231bac
liquidity: make swap suggestions aware of ongoing swaps 4 years ago
carla 559abd1eea
liquidity: add default parameters struct 4 years ago
carla ad8b5d0552
liquidity: add clock for mocking time in tests 4 years ago
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.
4 years ago
carla 340766fbb5
liquidity: add swap suggestions endpoint to manager 4 years ago
carla ce10cc7959
liquidity: add manager with updatable parameters 4 years ago