Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki authored Nov 8, 2024
1 parent a6ac6c4 commit c6a8b82
Showing 1 changed file with 7 additions and 46 deletions.
53 changes: 7 additions & 46 deletions projects/reform/index.js
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')
}
}

0 comments on commit c6a8b82

Please sign in to comment.