What is Nostr?
LNBϟG /
npub1ngu…e3pv
2023-09-23 21:33:20

LNBϟG on Nostr: I would like to present to your attention my node efficiency #statistics. It is built ...

I would like to present to your attention my node efficiency #statistics. It is built according to my method, which, perhaps, no one has used yet. Here is his description:

For example, we build statistics for the last N days. Creating for each node an array of length N with the following structure for each element:

[ "sent sats in this day", "received sats in this day", "volume of all channels of this node in this day" ]

We take [all transactions transmitted through our nodes node for this period](https://lightning.engineering/api-docs/api/lnd/lightning/forwarding-history), and taking into account the [chan_id_in and chan_id_out](https://lightning.engineering/api-docs/api/lnd/lightning/forwarding-history#lnrpcforwardingevent) of each transaction, we form arrays for each node - that is, we adjust the values "sent sats in this day" and "received sats in this day".

It is necessary to take into account both open channels and closed ones. For open channels, it is necessary to take into account on what day they were open, and for closed ones - on what day they were open and on what day they were closed. We calculate the days taking into account chan_id of channel and the approximate fact that there are 144 blocks in a day. We take this into account to calculate the total channel volume of each day for each node ("volume of all channels of this node in this day"). We take the time (timestamp_ns) of the transaction from [forwarding event](https://lightning.engineering/api-docs/api/lnd/lightning/forwarding-history#lnrpcforwardingevent).

After all the calculations, we calculate the coefficient (K) for each day of each node: ("sent sats in this day" + "received sats in this day") / "volume of all channels of this node in this day"

This coefficient "K" shows us with what efficiency the channels were used that day. After all, you can transfer a stream of 1M sats through channel(s) with a total volume of 1M sats (K will be 1.0), and you can transfer this 1M sats through a 100K channel, but using it is 10x times more efficient (K will be 10.0)!

After all, I take the median value for each node for all days - this will be the K_target value. Then I sort all the nodes by one such value K_target - nodes with a higher coefficient get higher and are more efficient for us than with a smaller one.

And now there will be results ;-)

#LNBiG #LightningNetwork #Lightning #Stats #Algorithm
Author Public Key
npub1ngumlqmus6xkrmvvee4yc7swh9h4uk7vpq4ddt7a2jtvkc22y0asrse3pv