diff --git a/package.json b/package.json index aba55bc..7dbe5f3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.7.42", + "version": "0.7.43", "type": "module", "scripts": { "dev": "vite", diff --git a/src/hooks/staking/index.js b/src/hooks/staking/index.js index c021bb8..c2de289 100644 --- a/src/hooks/staking/index.js +++ b/src/hooks/staking/index.js @@ -1,7 +1,13 @@ import { useReadContract } from "wagmi"; import toast from "react-hot-toast"; -import * from "../../constants/gatekeeper"; +import { + amountInHistory, + amountOutHistory, + feeIn, + feeOut, + stakeRatio +} from "../../constants/gatekeeper"; import { STAKING_ADDRESSES } from "../../constants/addresses"; import { abi as StakingAbi } from "../../abi/GhostStaking.json"; import { abi as GatekeeperAbi } from "../../abi/GhostGatekeeper.json"; @@ -39,10 +45,10 @@ export const useGatekeeperApy = (chainId) => { const feeInBig = new DecimalBigNumber((feeIn[chainId] ?? 0n), 5); const feeOutBig = new DecimalBigNumber((feeOut[chainId] ?? 0n), 5); - const stakeRatioBig = new DecimalBigNumber((stakeRatio[chainId] ?? 0n), 5); + const stakeRatioBig = new DecimalBigNumber((stakeRatio ?? 0n), 5); const numerator = amountIn.mul(feeInBig).add(amountOut.mul(feeOutBig)); - const denominator = amountIn.mul(stakeRatio).sub(amountOut.mul(stakeRatio)); + const denominator = amountIn.mul(stakeRatioBig).sub(amountOut.mul(stakeRatioBig)); let apyInner = Infinity; if ((circulatingSupply?._value ?? 0n) === 0n) {