What is Nostr?
ZmnSCPxj [ARCHIVE] /
npub1g5z…ms3l
2023-06-09 12:54:22
in reply to nevent1q…w3zf

ZmnSCPxj [ARCHIVE] on Nostr: 📅 Original date posted:2019-03-14 📝 Original message: Good morning Rene and ...

📅 Original date posted:2019-03-14
📝 Original message:
Good morning Rene and list,

Let us consider then the rule *when* a rebalancing would be beneficial to the node.

The node is offered a fee amount (`offered_fee_amount`) for the forwarding.
It knows that, under current channel states, it will definitely have to fail and earn 0 fees.

If it engages in JIT-routing, it must pay some fee (`rebalancing_fee_amount`) for the rebalancing operation.
But even if it successfully forwards its hop, it is still possible that the route will fail anyway and it will earn 0 fees.

So let us consider the probability of success (`success_rate`), a value between 0 to 1.0.
This is the estimated probability that we will succeed the route after we forward it.

We should only engage in JIT-routing if:

offered_fee_amount * success_rate - rebalancing_fee_amount > 0

The LHS of the subtraction is the expected earning, while the RHS of the subtraction is the expected cost.
The above is trivial accounting for determining net earnings.

The fee amounts are trivially computable.
Presumably the rebalancing code can compute the fee given a particular rebalance path, and thus can provide `rebalancing_fee_amount`.

The `success_rate` can be computed statically from some node data.
Better, is for the node to start with this precomputed static information, but augment this over time with its own experienced `success_rate` for all forwards.

Regards,
ZmnSCPxj
Author Public Key
npub1g5zswf6y48f7fy90jf3tlcuwdmjn8znhzaa4vkmtxaeskca8hpss23ms3l