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:
parent
f68551043e
commit
96d7465436
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ghost-dao-interface",
|
"name": "ghost-dao-interface",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.7.42",
|
"version": "0.7.43",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
import { useReadContract } from "wagmi";
|
import { useReadContract } from "wagmi";
|
||||||
import toast from "react-hot-toast";
|
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 { STAKING_ADDRESSES } from "../../constants/addresses";
|
||||||
import { abi as StakingAbi } from "../../abi/GhostStaking.json";
|
import { abi as StakingAbi } from "../../abi/GhostStaking.json";
|
||||||
import { abi as GatekeeperAbi } from "../../abi/GhostGatekeeper.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 feeInBig = new DecimalBigNumber((feeIn[chainId] ?? 0n), 5);
|
||||||
const feeOutBig = new DecimalBigNumber((feeOut[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 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;
|
let apyInner = Infinity;
|
||||||
if ((circulatingSupply?._value ?? 0n) === 0n) {
|
if ((circulatingSupply?._value ?? 0n) === 0n) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user