Giter VIP home page Giter VIP logo

defi-liquidity-pool-staking-calculator-js's Introduction

DeFI Liquidity Pool Staking Rewards Calculator

๐Ÿ‘‘ A simple DeFI Staking Pool Calculator to help you understand the DeFI LP Staking Math.

** THE FILES ATTACHED TO THIS REPO ARE FOR EDUCATIONAL PURPOSES ONLY **

** NOT FINANCIAL ADVISE **

** USE IT AT YOUR OWN RISK** **I'M NOT RESPONSIBLE FOR ANY USE, ISSUES ETC.. **

Download defi-reward-formula.js and update as you like!

Variables

poolTotalStaked -- > The total amount of LP tokens staked in the pool

poolUserStake -- > The amount of LP tokens the user has staked in the pool

poolAllocation -- > The percentage in basis points allocated to each pool of tokens mined after each block and provided as staking rewards to stakers.

Feel free to play with these values, save and run :)

//DeFI Pool 1 ETH/N2DR Values

const pool1TotalStaked = 250000
const pool1UserStake = 1250
const pool1Allocation = 5000

//DeFI Pool 2 MATIC/N2DR Values

const pool2TotalStaked = 250000
const pool2UserStake = 850
const pool2Allocation = 2500

//DeFI Pool 3 BNB/N2DR Values

const pool3TotalStaked = 10000000
const pool3UserStake = 5400
const pool3Allocation = 2500

if you want to calculate rewards in time, basically is substracting endblock minus start block or change the multiplier value in milliseconds example 1 minute

let multiplier = 60000

don't forget to save everytime you make changes before running!!

CTRL + S

node defi-reward-formula.js

โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„
โ–ˆ โ–„โ–„โ–€โ–ˆ โ–„โ–„โ–ˆโ–„ โ–„โ–ˆ โ–„ โ–ˆ โ–„โ–€โ–ˆ โ–„โ–„โ–ˆโ–€โ–ˆโ–ˆโ–ˆโ–€
โ–ˆ โ–ˆโ–ˆ โ–ˆ โ–„โ–„โ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–€โ–„โ–ˆ โ–ˆ โ–ˆ โ–„โ–„โ–ˆโ–ˆ โ–€ โ–ˆ
โ–ˆโ–„โ–ˆโ–ˆโ–„โ–ˆโ–„โ–„โ–„โ–ˆโ–ˆโ–„โ–ˆโ–ˆ โ–€โ–€โ–ˆโ–„โ–„โ–ˆโ–ˆโ–„โ–„โ–„โ–ˆโ–ˆโ–ˆโ–„โ–ˆโ–ˆ
โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€

DEFI Staking Rewards

User has staked for 24 hours.

User Staked: 1250 ETH
Pool 1 Rewards: 648 N2DR

User Staked: 850 MATIC
Pool 2 Rewards: 220.32 N2DR

User Staked: 5400 BNB
Pool 3 Rewards: 34.992 N2DR

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.