Skip to content

[feature-request] Inbound discount should be suffered by inbound channel, not outbound, when calculating profit #441

@xmrk-btc

Description

@xmrk-btc

Inbound discount (or negative inbound fee) is in effect "stealing" profit from the outbound channel. This may make the inbound channel look overly profitable, and the outbound channel may look unprofitable. This is a problem, because I may close such seemingly unprofitable channel, but that channel is helping the inbound channel, thus indirectly helping my profit. Closing it would be a mistake, but I have no easy way of knowing this.

Note that I have an implementation of this, but not ready for pull request yet.

For example, channel A has inbound fee -500 ppm, and channel B has outbound fee 501 ppm. When forwarding from A to B, the resulting fee (my revenue) will be 501 - 500 = 1 ppm. If all outbound traffic of channel B comes from channel A, then profit of channel B is negligible. Channel A is stealing almost all profit of channel B. But I have set inbound fee on A for a reason, probably it is a good outbound channel, A's outbound fee is say 1100 ppm. So channel A can afford to pay what it is stealing. Say I forward 1M sats from A to B. Currently, A's profit is unchanged by this, and B's profit is increased by 1 sat. With my adjustments, A's profit would be decreased by 500 sats (it gives back what it stole), and B's profit would be increased by 501 sats (1 sat of real profit + 500 sats stolen given back).

Very similar idea applies to first hop of rebalancing payments. When doing rebalance payment me->A->B->C->me, I pay no fee to send payment me->A, I only pay fee for A->B, B->C and C->me. But I do suffer an opportunity cost - if I rebalance x sats out of channel me->A, I cannot forward those x sats and I don't get revenue I would get if I forwarded. My channel with C is stealing profit from my channel with A. Maybe channel with A does no forwarding out, only rebalancing out, so will have 0 profit, even though A is helping C. It could be an error to close channel with A, it depends on volume rebalanced out of A and outbound fee of A.

I would prefer to display both real/raw profit and adjusted profit. The adjustments are a bit of an accounting trick, an estimation of opportunity cost, but such estimation can be inaccurate: in my first example, maybe I set outbound fee for B too high (501 ppm), and the channel B is only forwarding out because of the inbound fee on A. Without such inbound fee, maybe channel B would only start forwarding out at 100 ppm. But it will display adjusted profit of 500 ppm * forwarded_out_amount. So the adjustments shouldn't be trusted blindly - when looking at a channel, a node owner should look whether most of the revenue is real (paid by other nodes), or adjusted/fictitious (paid by myself, taken from profit of other channel of mine). Perhaps a warning should be displayed if real_revenue < fictitious_revenue_from_adjustments. It is more complicated for fictitious costs (when channel A with inbound fee gives back what it stole), but I have an idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions