Comments (12)
Isn't the fee
in fwdinghistory
always the fee earned by my node?
If I do the suggested change, the earned_fees is around half of what lncli feereport
shows as month_fee_sum
. If I keep it unchanged, the numbers are almost the same (difference <100 sat).
from suez.
Isn't the
fee
infwdinghistory
always the fee earned by my node?
Yes, that's my understanding. But isn't the suez
script counting the fee twice for each forward:
(snippet bwlow adjusted for brevity)
for fe in fwd_events:
c1 = fe["chan_id_in"]
c2 = fe["chan_id_out"]
fee = int(fe["fee"])
if not c1 in fees:
fees[c1] = 0
if not c2 in fees:
fees[c2] = 0
fees[c1] += fee # Why record the fee against the incoming channel?
fees[c2] += fee
If I do the suggested change, the earned_fees is around half of what lncli feereport shows as month_fee_sum. If I keep it unchanged, the numbers are almost the same (difference <100 sat).
Very strange. In my case it's the opposite. lncli feereport
is approx. half of what suez
calculates. If I adjust the suez
script to not record the forwarding fee against the incoming channel they are within 48 sats.
from suez.
My understanding is that one of the channels listed in fwd_events
is mine, the other is not mine. I record both, because I don't know which is mine or not at this point. But later I look into the correct records, leaving not mine channels without access.
I might be wrong, though.
from suez.
I did a small refactor in 094e952, but that does not change functionality at all.
When I run bos forwards --days 30
, it shows Earned In
and Earned Out
with total matching value in my table, so it seems node earns fees for both in and out channels.
bos = https://github.com/alexbosworth/balanceofsatoshis
from suez.
Btw, there will be always discrepancies when a channel was closed in the last 30 days - my table does not show closed channels at all, while lncli fee_report
and lncli fwdinghistory
take these into account.
from suez.
When I run bos forwards --days 30, it shows Earned In and Earned Out with total matching value in my table, so it seems node earns fees for both in and out channels.
I think bos
does some kind of double entry book-keeping in the bos forwards
table. The fact the Earned In
total exactly matches the Earned Out
table supports that likelihood.
I did see Alex Bosworth explain this to someone else, I think it was on the Telegram group. I'll see if I can dig up the explanation.
Btw, there will be always discrepancies when a channel was closed in the last 30 days - my table does not show closed channels at all, while lncli fee_report and lncli fwdinghistory take these into account.
Ah, I didn't even think of that. That could explain the 48 sat discrepancy I am getting. I'll see if I can double check that on my node somehow.
from suez.
Alex confirmed that the Earned In
and Earned Out
columns produced by bos forwards
are using double entries. The total earned fees is Sum(Earned Out)
, (which is == Sum(Earned In)
).
from suez.
I have trouble understanding why all these 3 values are the same on my system:
month_fee_sum
inlncli feereport
- your script from the OP
- earned fees total in suez table
from suez.
Argh, I get it now. I had one closed channel that earned approx 1/2 of the total fees, which confused me ...
Thanks
from suez.
How come
lncli feereport
shows approx the same value inmonth_fee_sum
as in suez earned fees total?
That I can't explain, unless, as you alluded to, the fees from closed channels in the lncli feereport
coincidentally match the value of your active channels.
For one of my nodes:
$ lncli feereport
"month_fee_sum": "2039"
$ suez
earned fees (sat) 3,998
$ bos forwards --days 30
sum(Earned Out)=2007
$ lncli fwdinghistory --start_time -30d --max_events 5000 | grep '"fee"' | sed -nr 's/."([0-9]+)./\1/p' | a
wk 'BEGIN {total=0;}{total+=$1;}END {print "Total: ",total}'
Total: 2007
from suez.
I believe I fixed the issue in a0d43b9 (by splitting into local and remote fees). Can you please confirm the numbers are now what you expect?
from suez.
I believe I fixed the issue in a0d43b9 (by splitting into local and remote fees). Can you please confirm the numbers are now what you expect?
Pretty close.
I have a discrepancy between the local fees (sat)
total of 1991
and the remote fees (sat)
total of 2007
. A channel I closed in the last 30 days did earn a relay fee of 16
. The closed channel does show up in bos forwards
. Probably not that big a deal.
IMHO the local & remote fee columns do create a bit of confusion. I found the previous earned fees
column more intuitive. There is only one relay fee for each lightning payment, which is the relay fee on the outgoing channel, so it's not as if there really is a local and remote component. This is purely personal preference though. The script now looks to be working well enough for me. Thanks for your work!
from suez.
Related Issues (20)
- ModuleNotFoundError: No module named 'dataclasses' HOT 8
- edge not foud HOT 2
- ZeroDivisionError when running without channels HOT 1
- connecting to remote node? HOT 6
- TypeError: unsupported format string passed to NoneType.__format__ HOT 2
- ZeroDivisionError while node syncing HOT 3
- Latest c-lightning no longer has last_tx_fee, but does have last_tx_fee_msat
- Confirming: is it dangerous to interrupt the script (e.g., via CTRL+C)? HOT 2
- Remote Node / Umbrel HOT 3
- Display in Min & Max HTLCs HOT 4
- Use RPC instead of lncli HOT 3
- No module named 'virtualenv.seed.via_app_data' HOT 4
- Parallel channels for Core Ligthning are not displayed HOT 2
- Version for Terminal Web Scores HOT 1
- Terminal Web v3 HOT 1
- Inaccurate local fees calculation HOT 2
- Add arguments to show only public or only private channels HOT 6
- corelightning + suez HOT 18
- CLN - Command "setchannelfee" is deprecated HOT 3
- Add lightning-network as a topic to this repository HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from suez.