no, this is final fix for the boosted apy... I belive so

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2026-05-07 21:13:43 +03:00
parent f68551043e
commit 96d7465436
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
2 changed files with 10 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.7.42",
"version": "0.7.43",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -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) {