https://github.com/net2devcrypto/defi-liquidity-pool-staking-calculator-js
A simple defi staking calculator based on a Masterchef contract formula to help you understand the math behind LP Staking. Just run in NodeJS
https://github.com/net2devcrypto/defi-liquidity-pool-staking-calculator-js
defi masterchef pancakeswap staking yield-farming
Last synced: about 1 year ago
JSON representation
A simple defi staking calculator based on a Masterchef contract formula to help you understand the math behind LP Staking. Just run in NodeJS
- Host: GitHub
- URL: https://github.com/net2devcrypto/defi-liquidity-pool-staking-calculator-js
- Owner: net2devcrypto
- Created: 2023-05-17T22:53:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-06T20:47:14.000Z (almost 3 years ago)
- Last Synced: 2025-01-29T21:43:27.182Z (over 1 year ago)
- Topics: defi, masterchef, pancakeswap, staking, yield-farming
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```shell
const pool1TotalStaked = 250000
const pool1UserStake = 1250
const pool1Allocation = 5000
```
//DeFI Pool 2 MATIC/N2DR Values
```shell
const pool2TotalStaked = 250000
const pool2UserStake = 850
const pool2Allocation = 2500
```
//DeFI Pool 3 BNB/N2DR Values
```shell
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
```shell
let multiplier = 60000
```
don't forget to save everytime you make changes before running!!
CTRL + S
```shell
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
```