Proof of Concept implementation of the Dijkstra Overpayment MPP Splitter #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces 2 things:
WARNING!!! very experimental work in progress! Only use with caution and wait for the proper release
The
DijkstraOverPayment
class aims to find Dijkstra paths in a pragmatic way for redundant overpayments.In particular it is a proof of concept to generate an MPP-Split in an ad hoc way that seems to be more
resonable than existing splitters which either do devide an conquorer or split to a certain amount or split
to a predefined number of parts.
This splitter finds low cost paths and greedly allocates as many sats as long as the reliability stays abvove a threshold
The main ideas are the following:
With respect to the cost function for candidate selection:
We use dijkstra to compute candidate paths as shortest paths with respect to our cost function
1.) Use a cost function for a unit that is the combination of
linearized routing cost
andlinearized uncertainty cost
2.) smooth the routing cost (currently laplace smoothing with
+100
. The exact value needs to be found3.)
cost = (ppm + 100) * 1/capacity
4.) after a path is planned increase cost of each edge with a multiplier
with respect to allocation of funds to paths
The cost function favors paths with low routing costs thus the only question is how many sats to allocate?
The following idea shall be used for motivation:
x%
l
be the length of the planned path andc
be the capacity of the smallest channel.s = (c+1-a)/(c+1)
is the success probability for the allocated amounta
s >= x ** (1/l)
which means the path has a probability of at leastx
s
at equality we solve fora
-->a = (c+1) - s*(c+1) = (c+1)*(1-s)
a
sats to the candidate pathNumber of generated / planned candidate paths
known short commings: