Commit Graph

37 Commits

Author SHA1 Message Date
Michael Schmoock
69e02e23b1 cleanups: feeadjuster, drain and summary 2022-02-17 10:26:54 +01:00
svewa
a207969404 another instance of unchecked short_channel_id access in fee_strategy: get_fees_median (#330)
* skip channels that are not (yet) locked in

* another unchecked request to ch['short_channel_id']

* this was meant to be the change.
2022-01-28 15:53:07 +01:00
svewa
f492affe2e skip channels that are not (yet) locked in 2022-01-27 17:40:48 +01:00
Michael Schmoock
125b2c650d feeadjuster: feature to adjust a specific channel
This adds an optional paramter to the `feeadjust` method which is `scid`
that will, if set, only adjust one channel. Default remains None which
will adjust all channels.
2021-08-29 13:44:13 +02:00
Michael Schmoock
1f968b247c feeadjuster: disable dynamic base fee scaling
This disables scaling of the base fee based on channel distortion and
instead always sets global config base fee.

The rationale behind this is that the base fee is meant to cover the
'fixed risk' of accepting an HTLC. In reality the risk may vary,
but this is unrelated on channel balance distortion but other factors.

We can have dynamic base fee per channel if we implent a better way
of competing and cost/risk coverage for this value.
2021-08-18 10:54:26 +02:00
Michael Schmoock
e7f2dbb606 feeadjuster: use listchannels by destination dynamically 2021-06-25 16:31:22 +02:00
Michael Schmoock
1d81d70fa4 feeadjuster: logs fee_strategy on startup 2021-06-25 16:31:22 +02:00
Michael Schmoock
a2c58e647d feeadjuster: adds switchable per channel fee strategy 2021-06-23 20:00:11 +02:00
Michael Schmoock
445bca51cb feeadjuster: simplified get_chan 2021-06-23 20:00:11 +02:00
Michael Schmoock
2074eeb30d feeadjuster: use listpeers to get local fees
Using gossip is not reliable and having fees in `listpeers` is
supported in `lightningd` since 0.9.3 (Jan 21).
2021-06-23 20:00:11 +02:00
Michael Schmoock
3e56d4d4d3 feeadjuster: cleanups 2021-06-23 20:00:11 +02:00
Michael Schmoock
92aafe7404 chore: rename feeadjustertoggle to feeadjuster-toggle 2021-01-19 12:17:30 +01:00
Gálli Zoltán
7c8840266d feeadjuster: no underscore in method name
cannot call methods from python framework with underscore in its name
6f924e63c2/contrib/pyln-client/pyln/client/lightning.py (L316)
2021-01-18 10:56:23 +01:00
Gálli Zoltán
bfb1cf5d27 feeadjuster toggle
possibility to turn off the forward event with config or plugin method
2021-01-14 12:53:32 +01:00
Gálli Zoltán
31dcc8cf09 feeadjuster: CI test fix 2020-12-21 15:00:38 +01:00
Gálli Zoltán
be10209355 feeadjuster: review fixes part 4 2020-12-21 15:00:38 +01:00
Gálli Zoltán
0dbafa1abd feeadjuster: review fixes part 3
- enough liquidity feature is turned off by default
2020-12-21 15:00:38 +01:00
Gálli Zoltán
0a3fe31056 feeadjuster: review fixes part 2 2020-12-21 15:00:38 +01:00
Gálli Zoltán
fabb7d370a feeadjuster: review fixes 2020-12-21 15:00:38 +01:00
Gálli Zoltán
5f71204f33 feeadjuster: option to handle big channels differently
- nit: lots of fstring
2020-12-21 15:00:38 +01:00
Michael Schmoock
96a5ff8306 feeadjuster: fix check-python flak8 nits 2020-11-29 16:30:02 +01:00
Antoine Poinsot
8c2be06595 feeadjuster: test fee adjustment in init
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-11-29 16:30:02 +01:00
Gálli Zoltán
00fe0c209e feeadjuster: final nits 2020-11-28 14:49:26 +01:00
Gálli Zoltán
7c798a423b feeadjuster: nit fixes
- no default parameter for maybe_setchannelfee
- using fstring
- log adjustment function name instead of reference
2020-11-28 14:49:26 +01:00
Gálli Zoltán
6bbd26af18 feeadjuster: review fixes
- forcefeeadjust method becomes feeadjust
- call feeadjust in plugin init
- prevent calling setchannelfee multiple times with the same parameters
- new optional get_ratio_hard and get_ratio_soft functions
- safety check in get_ratio functions
- maybe_setchannelfee is more concise thanks to @m-schmoock
- new test cases by @m-schmoock
2020-11-28 14:49:26 +01:00
Gálli Zoltán
ca518fd291 feeadjuster: forcefeeadjust can run after a successful payment too 2020-11-28 14:49:26 +01:00
Gálli Zoltán
a431fe0495 feeadjuster: method to adjust all existing channels
After start using this plugin, now you have a method to adjust fees for all of your channels. Ideally called only once.

Also, now it is allowed to customize "feeadjuster-ratio-base" to set up fee ratio:
New fee = <default fee> * feeadjuster-ratio-base**(0.5 - <our liquidity ratio>)
2020-11-28 14:49:26 +01:00
Michael Schmoock
75c4194b03 feeadjuster: adds imbalance limiter 2020-11-11 12:00:27 +01:00
Michael Schmoock
ad9c5df9ef feeadjuster: remove unused loop 2020-11-11 12:00:27 +01:00
Michael Schmoock
9809cc2dfd feeadjuster: fix typos 2020-11-11 12:00:27 +01:00
Antoine Poinsot
78c24afe48 feeadjuster: allow to customize the update threshold
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
c675979a21 jitrebalance: we might have many channel entries with one peer
Co-Authored-By: Michael Schmoock <michael@schmoock.net>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
3617674dc4 feeadjuster: fuzz update trigger treshold, add hysterisis
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
26c25fc8ee feeadjuster: unparallelize
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
d80b30579e feeadjuster: only update fees on substantial unbalancing
5% is a rather conservative value

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
4e5b26dd1e feeadjuster: always update the configuration's base and ppm fees
This avoids exponentially updating them by only multiplying constants.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00
Antoine Poinsot
a86ef381e7 feeadjuster: a plugin to adjust fees depending on balancing
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-10-21 16:06:40 +02:00