-
Notifications
You must be signed in to change notification settings - Fork 30
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
Calculating on-chain and off-chain balances from frcli audit data #206
Comments
The channel balance (and with that I mean the output of the |
I also thought about that later. If I consider the That difference is probably the anchor output reservations, which seem to be 330 sat per side. The following applies So far I have used Edit: I guess the msat differences are due to closed channels as on-chain only sat accuracy is possible Overall, this could be a reason why the calculation cannot be accurate. However, I need to do more research to understand this in detail. |
I think a channel with |
Thanks for clarification. I'm poking around in the dark here. |
Hi,
I am trying to calculate the current balances of my node from the values of the csv file created by frcli audit. By balances I mean the wallet balance (on-chain balance) and the available outbound liquidity (off-chain balance) of the node.
I calculate the on-chain balance by adding all values with OnChain=true and Type!=CHANNEL_CLOSE_FEE and Type!=SWEEP_FEE. In other words:
SUM(OnChain=true) - SUM(Type=CHANNEL_CLOSE_FEE) - SUM(Type=SWEEP_FEE)
This works, and the result matches the wallet balance.
I calculate the off-chain balance (available outbound liquidity) as follows:
SUM(OnChain=false) - SUM(Type=LOCAL_CHANNEL_OPEN) - SUM(Type=CHANNEL_CLOSE) + SUM(Type=CHANNEL_CLOSE_FEE) - SUM(Type=SWEEP) + SUM(Type=SWEEP_FEE)
However, the result of this calculation does not correspond exactly to the available outgoing liquidity, but only approximately. Is this calculation correct in principle? And is it even possible to calculate the available outbound liquidity exactly from the data generated by frcli audit?
Initially, I naively calculated the sum of all values in the csv file and thought that this should correspond to the sum of off-chain and on-chain balance, but this also does not match at all.
The text was updated successfully, but these errors were encountered: