-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make lockBuffer dynamic + additional lockDelta for taker+maker #1164
Comments
Idea: calcuation based on https://en.wikipedia.org/wiki/Poisson_distribution with 99.99% probability that 1st leg is longer than 2nd leg.
Yes. We want an additional configurable |
This looks like exactly what we'd need to calculate the buffer to ensure a high probability that the second leg payment does not expire before the first leg payment: https://www.npmjs.com/package/distributions-poisson-quantile . For example that can tell us that the number of bitcoin blocks to ensure a 99.999% chance of taking at least 500 minutes is 83. The tricky part I need to think about some more is that the second leg payment is not measured in minutes but rather blocks from a different chain, which follow an independent poisson distribution of their own. 576 LTC blocks will not always take 1440 minutes. I believe there I can use the same function as above, for example 99.99% of the time 576 LTC blocks will take 1668 minutes or less, and then I can calculate that 217 BTC blocks will take 1668 minutes or more 99.99% of the time. We'll bring back the |
Great! That sound exactly like what needs to be done.
Agree too. But let's call it
Numbers make sense, but I still think our terminology is confusing and we should start becoming strict on that. In general I think calling these 257 BTC blocks 1. we want to move from 2. this is not a "delta" but a Let me know what you think. |
The config option is specific to lnd and I was going to say I think it's fine to have an lnd specific term here like
I do think this is a "delta", it's what we'd set for the |
This modifies the logic around calculating the `makerCltvDelta` value for swaps which specifies the minimum expected lock duration for the final hop of the first leg. We use the poisson quantile function to determine a very high probability that the first leg final lock won't expire before the second leg payment. This also removes the recently added `lockBuffer` config option in favor of a `cltvDelta` for lnd that specifies the lock delta that is used for the final hop of the second leg and gets added to the lock buffer to determine the final lock delta for the first leg. Closes #1164.
This modifies the logic around calculating the `makerCltvDelta` value for swaps which specifies the minimum expected lock duration for the final hop of the first leg. We use the poisson quantile function to determine a very high probability that the first leg final lock won't expire before the second leg payment. This also removes the recently added `lockBuffer` config option in favor of a `cltvDelta` for lnd that specifies the lock delta that is used for the final hop of the second leg and gets added to the lock buffer to determine the final lock delta for the first leg. Closes #1164.
This modifies the logic around calculating the `makerCltvDelta` value for swaps which specifies the minimum expected lock duration for the final hop of the first leg. We use the poisson quantile function to determine a very high probability that the first leg final lock won't expire before the second leg payment. This also removes the recently added `lockBuffer` config option in favor of a `cltvDelta` for lnd that specifies the lock delta that is used for the final hop of the second leg and gets added to the lock buffer to determine the final lock delta for the first leg. Closes #1164.
This modifies the logic around calculating the `makerCltvDelta` value for swaps which specifies the minimum expected lock duration for the final hop of the first leg. We use the poisson quantile function to determine a very high probability that the first leg final lock won't expire before the second leg payment. This also removes the recently added `lockBuffer` config option in favor of a `cltvDelta` for lnd that specifies the lock delta that is used for the final hop of the second leg and gets added to the lock buffer to determine the final lock delta for the first leg. Closes #1164.
This modifies the logic around calculating the `makerCltvDelta` value for swaps which specifies the minimum expected lock duration for the final hop of the first leg. We use the poisson quantile function to determine a very high probability that the first leg final lock won't expire before the second leg payment. This also removes the recently added `lockBuffer` config option in favor of a `cltvDelta` for lnd that specifies the lock delta that is used for the final hop of the second leg and gets added to the lock buffer to determine the final lock delta for the first leg. Closes #1164.
Off-shoot of #1157
TBD:
lockBuffer
? Lower bound, %. Upper bound needed?cltvDelta
for taker and maker?The text was updated successfully, but these errors were encountered: