Skip to content

Commit

Permalink
correctly convert tick to display correct position balance
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-d committed Aug 14, 2024
1 parent d193ac0 commit 7de4bfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/app/stake/pool/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { useStakeStore } from "@/stores/useStakeStore";
import { useSwapStore } from "@/stores/useSwapStore";
import { ammAddress } from "@/lib/addresses";
import { useSimulateContract, useWriteContract } from "wagmi";
import { getTokenAmountsNumeric, sqrtPriceX96ToPrice } from "@/lib/math";
import { getSqrtRatioAtTick, getTokenAmountsNumeric, sqrtPriceX96ToPrice } from "@/lib/math";
import { TokenIcon } from "@/components/TokenIcon";
import { maxUint128 } from "viem";

Expand Down Expand Up @@ -226,7 +226,7 @@ export default function PoolPage() {
if (!positionLiquidity || !position) return 0;
const [amount0, amount1] = getTokenAmountsNumeric(
Number(positionLiquidity.result),
Number(curTick),
Number(getSqrtRatioAtTick(curTick)),
position.lower,
position.upper,
);
Expand Down

0 comments on commit 7de4bfb

Please sign in to comment.