Giter Site home page Giter Site logo

yaxuniu / payment-channel-rebalancing Goto Github PK

View Code? Open in Web Editor NEW

This project forked from npapadis/payment-channel-rebalancing

0.0 0.0 0.0 102 KB

A SimPy-based Discrete Event Simulator for a relay node in a payment channel network using different submarine swap rebalancing policies, including one based on Deep Reinforcement Learning.

License: MIT License

Python 100.00%

payment-channel-rebalancing's Introduction

Deep Reinforcement Learning-based rebalancing for profit maximization of relay nodes in Payment Channel Networks

This package is a Python SimPy-based Discrete Event Simulator for payment scheduling in a payment channel. It simulates a relay PCN node with two payment channels, forwarding traffic from left to right and from right to left, and allows for experiments with various rebalancing policies based on the rebalancing mechanism of submarine swaps. Transactions are generated from both sides according to customizable distributions of amounts and arrival times. Rebalancing operations are dispatched according to the chosen rebalancing policy.

The user can choose:

  • the initial channel balances and the on-chain budget
  • the transaction generation parameters: total transactions from each side, amount distribution (constant, uniform, gaussian, pareto, empirical from csv file), interarrival time distribution (exponential with customizable parameter)
  • the rebalancing policy
  • the diffent fees involved (base and proportional relay fee, server swap fee, miner fee)
  • the time every which the node will check for the need for rebalancing, and the time for a swap to complete
  • the number of experiments over which to calculate the average metrics
  • the output filename

There are several rebalancing policies the user can choose from:

  • Autoloop: a heuristic policy based on low and high thresholds currently used in practice
  • Loopmax: a heuristic policy based on the expected demand calculated from empirical data and trying to rebalance as infrequently as possible and with the maximum amount possible.
  • RebEL: "Rebalancing Enabled by Learning": a Deep Reinforcement Learning-based policy using this implementation of Soft Actor-Critic that learns to perform approximately optimal rebalancing actions based on the observed demand from both sides.

payment-channel-rebalancing's People

Contributors

npapadis avatar

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.