-
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 tradinglimits
account for lightning chan reserve
#1945
Comments
Im for providing this value, because it can be big enough. |
I think it makes sense to subtract channel reserves since it is non tradeable balance. However, to do so wouldn't we still need to iterate through the list of channels? Also, do we actually know that this new approach would be more efficient or accurate than iterating through the list of channels? I don't know why our current approach wouldn't be accurate, and my guess would be it's at least roughly the same in terms of efficiency - either way it's not computationally expensive to iterate through a list of up to a couple dozen channels. |
Yes, that's why I brought it up. The new lnd
Yep, for us even more accurate since we'd exclude channel reserve. Summary of the todo's:
|
tradinglimits
maxBuy
to new lnd calltradinglimits
accurate
Currently we're already iterating through channels for lnd, correct me if I'm mistaken @sangaman.
And currently that's how maxSell & maxBuy is being calculated:
In here while calculating available outbound & inbound capacities we're subtracting reserved amounts? |
tradinglimits
accuratetradinglimits
account for lightning chan reserve & routing fees
And for fee calculation I'm not sure how to handle it, can somebody please guide me? |
tradinglimits
account for lightning chan reserve & routing feestradinglimits
account for lightning chan reserve
Channel reserve is already accounted for by now (see #1988 (comment)) and pre-calculating routing fees is hardly possible so I am closing here. |
EDIT: renamed this issue, new goal below.
LND
0.12
will return inbound balance with thechannelbalance
call. Since this is considerably more efficient and accurate than our current "iterate through lnd'slistchannels
" approach, we should move to this call too once lndbtc & lndltc 0.12 are released.Also I just double checked the following:
channelbalance
is simply alllocal_balance
fields of all channels accumulatedchannelbalance
include allremote_balance
fields of all channels accumulated with the PR above.Here is the but: lnd's
local_balance
andremote_balance
subtract thecommit_fee
, but not the channel reservechan_reserve_sat
which is essentially non-usable balance. Question is: do we want to manually subtract channel reserves from our local and remote balances to give the user a correct picture of what balance is actually usable?The text was updated successfully, but these errors were encountered: