-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,9 @@ | ||
const sdk = require('@defillama/sdk') | ||
|
||
const TOKEN_CONTRACT = '0xea3eed8616877F5d3c4aEbf5A799F2e8D6DE9A5E'; | ||
|
||
async function getGrowityMetrics() { | ||
// Fetch the market cap for Growity or define the API source here | ||
return await sdk.api.util.fetchJSON('https://mkl2z286c7.execute-api.eu-west-1.amazonaws.com/prod/overview'); | ||
} | ||
|
||
async function getPriceRFRM() { | ||
// Fetch the price of RFRM from a reliable source like CoinMarketCap | ||
return await sdk.api.util.fetchJSON('https://api.coinmarketcap.com/v1/ticker/growity-rfrm/'); | ||
} | ||
|
||
// async function getHolderCount() { | ||
// // Fetch the holder count from Etherscan or another blockchain explorer | ||
// return await sdk.api.util.fetchJSON('https://api.etherscan.io/api?module=stats&action=tokenholdercount&contractaddress=' + TOKEN_CONTRACT); | ||
// } | ||
|
||
|
||
// Function to calculate and export Growity-specific metrics | ||
async function growityMetrics() { | ||
const growityMetrics = await getGrowityMetrics(); | ||
|
||
const tvl = growityMetrics.locked; | ||
const marketCap = growityMetrics.market_cap; | ||
const staking = growityMetrics.staking; | ||
const priceRFRM = await getPriceRFRM(); | ||
// const holders = await getHolderCount(); | ||
|
||
const stakingTVL = staking * marketCap; | ||
|
||
|
||
return { | ||
tvl, | ||
marketCap, | ||
stakingTVL, | ||
priceRFRM, | ||
// holders, | ||
}; | ||
} | ||
|
||
const { staking } = require('../helper/staking') | ||
|
||
module.exports = { | ||
bsc: { | ||
growityMetrics, | ||
}, | ||
}; | ||
ethereum: { | ||
tvl: () => ({}), | ||
staking: staking('0x74ef3b69e8c475df8450eddda5dabd9b6dd17972', '0xea3eed8616877F5d3c4aEbf5A799F2e8D6DE9A5E'), | ||
pool2: staking('0x74ef3b69e8c475df8450eddda5dabd9b6dd17972', '0xf4e14a7766a3316d6cefbaec614c714f2d4965d8') | ||
} | ||
} |