I run the node c-otto.de which currently has more than 300 peers. As such, I need to automate certain things. Some of the trickier questions:
- Which channels should I close?
- Which peers are good, which are bad, and how does peer X compare to peer Y?
As part of lnd-manageJ (https://github.com/C-Otto/lnd-manageJ) I implemented a rating system, which assigns some number to each peer. For example, LOOP might get a high score because I earn a lot forwarding transactions to said node. Some good plebnet node might get a lower number, but still a lot more than what I'd assign to a bad node.
Currently, I consider the following values for some peer X:
- sats earned by routing out through peer X
- sats earned by routing out through some other peer, where the transaction came in from peer X
- sats provided as part of rebalance transactions (to have more liquidity in a channel with some other peer)
- sats received as part of rebalance transactions (to have more inbound liquidity from some other peer)
- potential earnings (based on the current local liquidity and fee rate)
These numbers are added (with different weights), and then the sum is divided by the number of days used for the analysis (so that I get some number that tells me "... per day").
This number is then divided by the average amount of satoshis I have on my side (normalized to million satoshis), so that I divide the number by 3 if I have 3 million sat on my side (on average), or multiply by 2 if I have 1/2 million satoshis (= 500,000sat) on my side (on average). This way I can compare peers based on how much of my capital they use (block?), where higher capital requirements lower the resulting rating.
Note that other important aspects like uptime or fee-configuration are handled irrespective of the rating.
What do you think about this? What makes a good peer good, and how can I assign a number to this?