Coder Social home page Coder Social logo

Remote fees about suez HOT 4 CLOSED

prusnak avatar prusnak commented on June 19, 2024
Remote fees

from suez.

Comments (4)

hosiawak avatar hosiawak commented on June 19, 2024 1

I think they're better than nothing though (after my fix below). I was able to quickly identify which remote nodes made more sats by forwarding than my node. Unless people actively manage their fees they don't change often so I think it's a reasonable assumption to make these days.

The exact fix is below (you have to adapt it to LND, I'm running this on C-Lightning):

        for fe in fwd_events:
            cin = fe["in_channel"]
            cout = fe["out_channel"]
            ts = int(fe["resolved_time"])
            fee = int(fe["fee"] / 1000)
            amount_in = int(fe["in_msatoshi"] / 1000)
            if cin in self.channels:
                self.channels[cin].last_forward = max(
                    ts, self.channels[cin].last_forward
                )
                self.channels[cin].remote_fees += int((self.channels[cin].remote_base_fee + (self.channels[cin].remote_fee_rate * amount_in / 1000)) / 1000)
      	    if cout in self.channels:
                self.channels[cout].last_forward = max(
                    ts, self.channels[cout].last_forward
                )
                self.channels[cout].local_fees += fee

from suez.

hosiawak avatar hosiawak commented on June 19, 2024

The above is just an estimate that assumes fixed remote fees for the given forwarding period. To get the exact number we'd have to track remote fee changes.

from suez.

prusnak avatar prusnak commented on June 19, 2024

I am thinking of dropping remote fees completely, because these are not accurate. Also I am not that sure whether these should be an important factor whether to keep/close/rebalance the channel.

from suez.

prusnak avatar prusnak commented on June 19, 2024

Fixed in 8f07c6f

Thanks!

from suez.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.