-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts: add calculate_boost
- Loading branch information
Showing
6 changed files
with
73 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { ethers } = require("hardhat") | ||
|
||
// npx hardhat run script/07_calculate_boost.ts --network testnet | ||
async function main() { | ||
if (!process.env.LST_GAUGE) { | ||
console.log(`Please provide LST_GAUGE address`); | ||
return; | ||
} | ||
|
||
const [deployer] = await ethers.getSigners(); | ||
console.log('Deployer address:', deployer.address); | ||
|
||
const gauge = await ethers.getContractAt('IRewardGauge', process.env.LST_GAUGE, deployer); | ||
const totalSupply = await gauge.totalSupply(); | ||
const totalShare = await gauge.totalShare(); | ||
|
||
const userWillDepositLp = BigInt(10000); | ||
const userWillVoteShare = BigInt(100) ; | ||
var boost = Number(1.5) * Number((totalSupply+userWillDepositLp) *userWillVoteShare)/Number(totalShare+userWillVoteShare)/Number(userWillDepositLp) + Number(1) | ||
if (boost > Number(2.5)){ | ||
boost = Number(2.5) | ||
} | ||
console.log("boost for user: ", boost); | ||
} | ||
|
||
main().catch(err => { | ||
console.error(err); | ||
process.exitCode = 1; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters