message: flexible decimal calc
diff: @@ -12,18 +12,21 @@ const pools = [
  smartChef: '0xAfd61Dc94f11A70Ae110dC0E0F2061Af5633061A',
  coingeckoId: 'trust-wallet-token',
  asset: '0x4B0F1812e5Df2A09796481Ff14017e6005508003',
  + decimals: '1e18',
  },
  {
  name: 'inj',
  smartChef: '0x92E8CeB7eAeD69fB6E4d9dA43F605D2610214E68',
  coingeckoId: 'injective-protocol',
  asset: '0xa2B726B1145A4773F68593CF171187d8EBe4d495',
  + decimals: '1e18',
  },
  {
  name: 'ctk',
  smartChef: '0xF35d63Df93f32e025bce4A1B98dcEC1fe07AD892',
  coingeckoId: 'certik',
  asset: '0xA8c2B8eec3d368C0253ad3dae65a5F2BBB89c929',
  + decimals: '1e6',
  },
  ];
  @@ -37,7 +40,7 @@ const getCakeApys = async () => {
  for (const pool of pools) {
  const yearlyRewardsInUsd = await getYearlyRewardsInUsd(pool.smartChef, pool.coingeckoId);
  - const totalStakedInUsd = await getTotalStakedInUsd(pool.smartChef, 'pancakeswap-token', syrup);
  + const totalStakedInUsd = await getTotalStakedInUsd(pool.smartChef, 'pancakeswap-token', syrup, pool.decimals);
  const apy = yearlyRewardsInUsd.dividedBy(totalStakedInUsd).plus(baseCakeApy);
  apys[pool.name] = apy;
  }
  @@ -73,11 +76,11 @@ const getYearlyRewardsInUsd = async (smartChefAddr, earnedAsset) => {
  return yearlyRewardsInUsd;
  };
  -const getTotalStakedInUsd = async (poolAddr, coingeckoId, tokenAddr) => {
  +const getTotalStakedInUsd = async (poolAddr, coingeckoId, tokenAddr, decimals) => {
  const tokenPrice = await getPrice(coingeckoId);
  const tokenContract = await new web3.eth.Contract(ERC20, tokenAddr);
  const totalStaked = new BigNumber(await tokenContract.methods.balanceOf(poolAddr).call());
  - const totalStakedInUsd = totalStaked.times(tokenPrice).dividedBy('1e18');
  + const totalStakedInUsd = totalStaked.times(tokenPrice).dividedBy(decimals);
  return totalStakedInUsd;
  };
  