-
Notifications
You must be signed in to change notification settings - Fork 42
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
Sanity checks before adding to orderbook #675
Comments
We could also do this on peer orders potentially, so that we check if capacity exists before we add it to our orderbook. In both cases, I think it makes sense to save the capacity in memory (cached in other words) , and only recalculate it after it gets old, maybe 10 minutes? I'm thinking that doing this every time we place an order will introduce too much of a delay - we really want the order placement and settlement to be as fast as possible. In fact, maybe we shouldn't tie these checks into the Also one extra detail, the lightning spec recommends that 1% of the balance of each channel be held in reserve on each side. So we probably want to make sure that our channel balance is at least 101% of the order amount. |
Cache channel balances in memory and then check this value on Since we want to support AMPs in future, let's prepare aggregating balances of multiple channels. Also wouldn't distinguish between peers for now, meaning let the check succeed as long as one channel to one peer with sufficient capacity exists. Continuation: #680 |
Good point.
Agreed.
I'll make the time configurable. |
Are you thinking of putting this scheduled capacity check on each lnd client instance? Eventually we'll want similar logic for Raiden so try to make the approach generic enough that it can be reused easily. |
Thanks for pointing this out - definitely want to easily support Raiden sanity checks as well. |
Started as a result of #240 discussion.
High level specs
placeOrder
addorderSanityChecks
orderSanityChecks
should verify that:if either of the above checks fails - ERROR!
The text was updated successfully, but these errors were encountered: