diff --git a/packages/swap-router/.ultra.cache.json b/packages/swap-router/.ultra.cache.json index 75a2852d6..fa109ce16 100644 --- a/packages/swap-router/.ultra.cache.json +++ b/packages/swap-router/.ultra.cache.json @@ -1 +1 @@ -{"files":{".vscode":"1700971955685.2515","build":"1701256570289.2512","node_modules":"1700891704503.8325",".eslintignore":"7de3bd702df2dee92c033c49abbedd0b0f7452e6",".eslintrc.js":"ca4815a5cf5cffa1d3fb4a014c8c602f852b002a",".gitignore":"c87c9b392c0200d9c9dafc444386ad3e15a85c64",".prettierignore":"47bb4656eb55860a075be7799cba7fa955b68141",".prettierrc":"fe5f744c7a08b128c935d1e1aed3e8a577e74507","jest.config.json":"2e496ee6bd64eb237161dcd69a6957eff2df584d","package.json":"4dda70ca76fb6022f6cb20852ecd8d2d95d638d2","src/common/array.util.ts":"9482ab121d34cc7e08a0cd33b49173b0b85823d8","src/common/bigint.util.ts":"343f4c85ca1f6c840ade68c259ed82bf5b159fb0","src/common/index.ts":"861a3167cddfc93e9eb1b6a4ae8229bb9dc2f8fd","src/common/mapper.ts":"f7d7b491dff443911a978b34e4cb378bee46c2b7","src/common/queue.ts":"ad096fefbe1c5a7339b536b0b8d39dba661b520e","src/common/test.util.ts":"3e500df6ec27ba98606acbfcaec9243e22862e43","src/constants/index.ts":"9605b149deb525c25f6e93420bbc433ff1c75cd0","src/constants/math.constant.ts":"b617851527cabcc9c3bce2c8e39208001d379ad6","src/constants/swap.constant.ts":"53e280147c68acfba490bc1f9a0b7bb1580e7280","src/index.ts":"691efb21a28bd3f0e6437edcb16192789dbbb7f6","src/swap-router/index.ts":"effaf28a826bdf1441437643e8343e7fbd8026b1","src/swap-router/swap-router-default.spec.ts":"f980bc94753df130c950eb80d8709b62ec3276fa","src/swap-router/swap-router-multi-higher-range-position-pool.spec.ts":"683ce3a82d73e915018e772723700905c3ff7c92","src/swap-router/swap-router-multi-lower-range-position-pool.spec.ts":"93bfd18d0a297f3c66743cddcf2fe10c3764e250","src/swap-router/swap-router-multi-pair-pools.spec.ts":"5fbd55be39012d46adbdc91a1111dca2aafd314d","src/swap-router/swap-router-multi-route.spec.ts":"771df497876b6bc027dc7b65d03e53209538bf2e","src/swap-router/swap-router-single-pair-pools.spec.ts":"3954e9057ef9534a3724dc960c291281d1a4ef52","src/swap-router/swap-router.ts":"606de3d518665d58f5cbafb55f45d92c30dab77d","src/swap-router/swap-router.types.ts":"2a48987217df238256a0721d227952142a37ce08","src/swap-router/utility/index.ts":"4973874904dd9d77d037d72b1ec8aed397716a38","src/swap-router/utility/route.util.ts":"d492418c9184e42d3ef29d7760eb18fa013f54c6","src/swap-simulator/index.ts":"ef493c5977bdf1123d1197b804f2344ee463870c","src/swap-simulator/swap-simulator-default.spec.ts":"867788b12ccc70abe676010aeed5d6b2b58e8036","src/swap-simulator/swap-simulator.ts":"48cc4c90a2622d806659fa2f8c4f48d600a2b2db","src/swap-simulator/swap-simulator.types.ts":"2b03d7e389ab8875852330c8fddf5a9bfe96f1c6","src/swap-simulator/utility/cache.util.ts":"c5af86d350610a80a6690846657a35635bbc752a","src/swap-simulator/utility/index.ts":"7272f5d23dfa7af2895fca9bb0b17985234ab6e1","src/swap-simulator/utility/math.util.ts":"96fbe38cbabe344f6f58220f46c20103e6df4225","src/swap-simulator/utility/swap-util.spec.ts":"b7fe082f3fef7e5a912959925924f56f8c36e020","src/swap-simulator/utility/swap.util.ts":"f49236f0d22f72b9283244e870d34401d42fe009","src/swap-simulator/utility/tick.util.ts":"4d9bf8ed782f07587c71009ad13cd249b5e3a840","tsconfig.json":"55467bd5c5eb1b501abe50b952d5f2d9fa0a0d69"},"deps":{}} \ No newline at end of file +{"files":{".vscode":"1700971955685.2515","build":"1701412916671.3086","node_modules":"1700891704503.8325",".eslintignore":"7de3bd702df2dee92c033c49abbedd0b0f7452e6",".eslintrc.js":"ca4815a5cf5cffa1d3fb4a014c8c602f852b002a",".gitignore":"c87c9b392c0200d9c9dafc444386ad3e15a85c64",".prettierignore":"47bb4656eb55860a075be7799cba7fa955b68141",".prettierrc":"fe5f744c7a08b128c935d1e1aed3e8a577e74507","jest.config.json":"2e496ee6bd64eb237161dcd69a6957eff2df584d","package.json":"4dda70ca76fb6022f6cb20852ecd8d2d95d638d2","src/common/array.util.ts":"9482ab121d34cc7e08a0cd33b49173b0b85823d8","src/common/bigint.util.ts":"343f4c85ca1f6c840ade68c259ed82bf5b159fb0","src/common/index.ts":"861a3167cddfc93e9eb1b6a4ae8229bb9dc2f8fd","src/common/mapper.ts":"f7d7b491dff443911a978b34e4cb378bee46c2b7","src/common/queue.ts":"ad096fefbe1c5a7339b536b0b8d39dba661b520e","src/common/test.util.ts":"3e500df6ec27ba98606acbfcaec9243e22862e43","src/constants/index.ts":"9605b149deb525c25f6e93420bbc433ff1c75cd0","src/constants/math.constant.ts":"b617851527cabcc9c3bce2c8e39208001d379ad6","src/constants/swap.constant.ts":"53e280147c68acfba490bc1f9a0b7bb1580e7280","src/index.ts":"691efb21a28bd3f0e6437edcb16192789dbbb7f6","src/swap-router/index.ts":"effaf28a826bdf1441437643e8343e7fbd8026b1","src/swap-router/swap-router-default.spec.ts":"f980bc94753df130c950eb80d8709b62ec3276fa","src/swap-router/swap-router-multi-higher-range-position-pool.spec.ts":"683ce3a82d73e915018e772723700905c3ff7c92","src/swap-router/swap-router-multi-lower-range-position-pool.spec.ts":"93bfd18d0a297f3c66743cddcf2fe10c3764e250","src/swap-router/swap-router-multi-pair-pools.spec.ts":"5fbd55be39012d46adbdc91a1111dca2aafd314d","src/swap-router/swap-router-multi-route.spec.ts":"771df497876b6bc027dc7b65d03e53209538bf2e","src/swap-router/swap-router-single-pair-pools.spec.ts":"3954e9057ef9534a3724dc960c291281d1a4ef52","src/swap-router/swap-router.ts":"606de3d518665d58f5cbafb55f45d92c30dab77d","src/swap-router/swap-router.types.ts":"2a48987217df238256a0721d227952142a37ce08","src/swap-router/utility/index.ts":"4973874904dd9d77d037d72b1ec8aed397716a38","src/swap-router/utility/route.util.ts":"d492418c9184e42d3ef29d7760eb18fa013f54c6","src/swap-simulator/index.ts":"ef493c5977bdf1123d1197b804f2344ee463870c","src/swap-simulator/swap-simulator-default.spec.ts":"867788b12ccc70abe676010aeed5d6b2b58e8036","src/swap-simulator/swap-simulator.ts":"48cc4c90a2622d806659fa2f8c4f48d600a2b2db","src/swap-simulator/swap-simulator.types.ts":"2b03d7e389ab8875852330c8fddf5a9bfe96f1c6","src/swap-simulator/utility/cache.util.ts":"c5af86d350610a80a6690846657a35635bbc752a","src/swap-simulator/utility/index.ts":"7272f5d23dfa7af2895fca9bb0b17985234ab6e1","src/swap-simulator/utility/math.util.ts":"96fbe38cbabe344f6f58220f46c20103e6df4225","src/swap-simulator/utility/swap-util.spec.ts":"b7fe082f3fef7e5a912959925924f56f8c36e020","src/swap-simulator/utility/swap.util.ts":"f49236f0d22f72b9283244e870d34401d42fe009","src/swap-simulator/utility/tick.util.ts":"4d9bf8ed782f07587c71009ad13cd249b5e3a840","tsconfig.json":"55467bd5c5eb1b501abe50b952d5f2d9fa0a0d69"},"deps":{}} \ No newline at end of file diff --git a/packages/web/src/components/common/pool-graph/PoolGraph.stories.tsx b/packages/web/src/components/common/pool-graph/PoolGraph.stories.tsx index 0bc206a11..f1d55aa60 100644 --- a/packages/web/src/components/common/pool-graph/PoolGraph.stories.tsx +++ b/packages/web/src/components/common/pool-graph/PoolGraph.stories.tsx @@ -1,8 +1,9 @@ import PoolGraph, { type PoolGraphProps } from "./PoolGraph"; import { Meta, StoryObj } from "@storybook/react"; import POOLS from "@repositories/pool/mock/pools.json"; +import { PoolModel } from "@models/pool/pool-model"; -const pool = POOLS.pools[0]; +const pool = POOLS.pools[0] as PoolModel; export default { title: "common/PoolGraph", diff --git a/packages/web/src/components/common/pool-graph/PoolGraph.tsx b/packages/web/src/components/common/pool-graph/PoolGraph.tsx index a44ae16fb..194cbc443 100644 --- a/packages/web/src/components/common/pool-graph/PoolGraph.tsx +++ b/packages/web/src/components/common/pool-graph/PoolGraph.tsx @@ -3,7 +3,6 @@ import { PoolGraphWrapper } from "./PoolGraph.styles"; import * as d3 from "d3"; import { PoolBinModel } from "@models/pool/pool-bin-model"; import { MAX_TICK, MIN_TICK } from "@constants/swap.constant"; -import BigNumber from "bignumber.js"; import { renderToStaticMarkup } from "react-dom/server"; import { TokenModel } from "@models/token/token-model"; import { toMillionFormat } from "@utils/number-utils"; @@ -86,8 +85,8 @@ const PoolGraph: React.FC = ({ const xAxis = d3 .axisBottom(scaleX) .tickSize(0) - .tickFormat(v => BigNumber(1.001 ** (v.valueOf() / 2)).toFormat(4)); - const [minX, maxX] = d3.extent(bins, (bin) => bin.currentTick); + .tickFormat(v => v.toString()); + const [minX, maxX] = d3.extent(bins, (bin) => bin.minTick); const [, max] = d3.extent(bins, (bin) => bin.liquidity); const scaleY = useMemo(() => { @@ -152,7 +151,7 @@ const PoolGraph: React.FC = ({ if (bins.length === 2) { return 20; } - const spacing = scaleX(bins[1].currentTick) - scaleX(bins[0].currentTick); + const spacing = scaleX(bins[1].minTick) - scaleX(bins[0].minTick); if (spacing < 2) { return spacing; } @@ -166,7 +165,7 @@ const PoolGraph: React.FC = ({ // Retrieves the colour of the chart bar at the current tick. function fillByBin(bin: PoolBinModel) { - if (currentTick && scaleX(bin.currentTick) < centerPosition) { + if (currentTick && (bin.minTick) < currentTick) { return "url(#gradient-bar-green)"; } return "url(#gradient-bar-red)"; @@ -184,7 +183,7 @@ const PoolGraph: React.FC = ({ .append("rect") .style("fill", bin => fillByBin(bin)) .attr("class", "rects") - .attr("x", bin => scaleX(bin.currentTick)) + .attr("x", bin => scaleX(bin.minTick)) .attr("y", bin => scaleY(bin.liquidity)) .attr("width", tickSpacing) .attr("height", bin => boundsHeight - scaleY(bin.liquidity)) @@ -227,8 +226,8 @@ const PoolGraph: React.FC = ({ diff --git a/packages/web/src/components/common/pool-selection-graph/PoolSelectionGraph.stories.tsx b/packages/web/src/components/common/pool-selection-graph/PoolSelectionGraph.stories.tsx index 32e9f8d01..50cf48d18 100644 --- a/packages/web/src/components/common/pool-selection-graph/PoolSelectionGraph.stories.tsx +++ b/packages/web/src/components/common/pool-selection-graph/PoolSelectionGraph.stories.tsx @@ -3,6 +3,7 @@ import PoolSelectionGraph, { type PoolSelectionGraphProps } from "./PoolSelectio import { ComponentStory, Meta, StoryObj } from "@storybook/react"; import POOLS from "@repositories/pool/mock/pools.json"; import { tickToPrice } from "@utils/swap-utils"; +import { PoolModel } from "@models/pool/pool-model"; const test = [ @@ -1832,7 +1833,7 @@ const test = [ } ]; -const pool = POOLS.pools[0]; +const pool = POOLS.pools[0] as PoolModel; export default { title: "common/PoolSelectionGraph", diff --git a/packages/web/src/components/common/pool-selection-graph/PoolSelectionGraph.tsx b/packages/web/src/components/common/pool-selection-graph/PoolSelectionGraph.tsx index 34cfb2858..e286aff97 100644 --- a/packages/web/src/components/common/pool-selection-graph/PoolSelectionGraph.tsx +++ b/packages/web/src/components/common/pool-selection-graph/PoolSelectionGraph.tsx @@ -156,7 +156,7 @@ const PoolSelectionGraph: React.FC = ({ const boundsHeight = height - margin.top - margin.bottom - labelHeight - paddingHeight; const tickAmount = 10000; - const [, maxX] = d3.extent(bins.map(bin => bin.currentTick)); + const [, maxX] = d3.extent(bins.map(bin => bin.minTick)); const maxXTick = tickToPrice(maxX ?? 1) * 10000; const binRange = maxXTick / tickAmount; const currentPrice = tickToPrice(currentTick || 0); @@ -164,8 +164,8 @@ const PoolSelectionGraph: React.FC = ({ const { redColor, greenColor } = useColorGraph(); const resolvedBins = () => { - const sortedBins = bins.sort((b1, b2) => b1.currentTick - b2.currentTick) - .map(bin => ({ ...bin, currentPrice: tickToPrice(bin.currentTick) })); + const sortedBins = bins.sort((b1, b2) => b1.minTick - b2.minTick) + .map(bin => ({ ...bin, currentPrice: tickToPrice(bin.minTick) })); console.log(sortedBins); return Array.from( { length: tickAmount }, diff --git a/packages/web/src/components/earn/earn-incentivized-pools/EarnIncentivizedPools.stories.tsx b/packages/web/src/components/earn/earn-incentivized-pools/EarnIncentivizedPools.stories.tsx index db334c1d4..1e9a2655e 100644 --- a/packages/web/src/components/earn/earn-incentivized-pools/EarnIncentivizedPools.stories.tsx +++ b/packages/web/src/components/earn/earn-incentivized-pools/EarnIncentivizedPools.stories.tsx @@ -4,8 +4,9 @@ import IncentivizedPoolCardList from "../incentivized-pool-card-list/Incentivize import POOLS from "@repositories/pool/mock/pools.json"; import { PoolMapper } from "@models/pool/mapper/pool-mapper"; import { action } from "@storybook/addon-actions"; +import { PoolModel } from "@models/pool/pool-model"; -const pool = POOLS.pools[0]; +const pool = POOLS.pools[0] as PoolModel; const cardInfo = PoolMapper.toCardInfo(pool); diff --git a/packages/web/src/components/earn/incentivized-pool-card-list/IncentivizedPoolCardList.stories.tsx b/packages/web/src/components/earn/incentivized-pool-card-list/IncentivizedPoolCardList.stories.tsx index 5403af7b5..11c6104be 100644 --- a/packages/web/src/components/earn/incentivized-pool-card-list/IncentivizedPoolCardList.stories.tsx +++ b/packages/web/src/components/earn/incentivized-pool-card-list/IncentivizedPoolCardList.stories.tsx @@ -5,8 +5,9 @@ import IncentivizedPoolCardList from "./IncentivizedPoolCardList"; import { action } from "@storybook/addon-actions"; import POOLS from "@repositories/pool/mock/pools.json"; import { PoolMapper } from "@models/pool/mapper/pool-mapper"; +import { PoolModel } from "@models/pool/pool-model"; -const pool = POOLS.pools[0]; +const pool = POOLS.pools[0] as PoolModel; const cardInfo = PoolMapper.toCardInfo(pool); diff --git a/packages/web/src/components/earn/incentivized-pool-card/IncentivizedPoolCard.stories.tsx b/packages/web/src/components/earn/incentivized-pool-card/IncentivizedPoolCard.stories.tsx index f2e446163..eb59f44fc 100644 --- a/packages/web/src/components/earn/incentivized-pool-card/IncentivizedPoolCard.stories.tsx +++ b/packages/web/src/components/earn/incentivized-pool-card/IncentivizedPoolCard.stories.tsx @@ -5,8 +5,9 @@ import IncentivizedPoolCard from "./IncentivizedPoolCard"; import { action } from "@storybook/addon-actions"; import POOLS from "@repositories/pool/mock/pools.json"; import { PoolMapper } from "@models/pool/mapper/pool-mapper"; +import { PoolModel } from "@models/pool/pool-model"; -const pool = POOLS.pools[0]; +const pool = POOLS.pools[0] as PoolModel; const cardInfo = PoolMapper.toCardInfo(pool); diff --git a/packages/web/src/components/earn/incentivized-pool-card/IncentivizedPoolCard.tsx b/packages/web/src/components/earn/incentivized-pool-card/IncentivizedPoolCard.tsx index 3e29d5b30..45d680d3f 100644 --- a/packages/web/src/components/earn/incentivized-pool-card/IncentivizedPoolCard.tsx +++ b/packages/web/src/components/earn/incentivized-pool-card/IncentivizedPoolCard.tsx @@ -86,8 +86,8 @@ const IncentivizedPoolCard: React.FC = ({ = (args) => { return ( diff --git a/packages/web/src/components/incentivize/pool-incentivize-select-pool/PoolIncentivizeSelectPool.stories.tsx b/packages/web/src/components/incentivize/pool-incentivize-select-pool/PoolIncentivizeSelectPool.stories.tsx index 23d839f90..38d8bea0d 100644 --- a/packages/web/src/components/incentivize/pool-incentivize-select-pool/PoolIncentivizeSelectPool.stories.tsx +++ b/packages/web/src/components/incentivize/pool-incentivize-select-pool/PoolIncentivizeSelectPool.stories.tsx @@ -6,7 +6,7 @@ import { PoolSelectItemInfo } from "@models/pool/info/pool-select-item-info"; import { PoolMapper } from "@models/pool/mapper/pool-mapper"; const poolRepository = new PoolRepositoryMock(); -const pools = (await poolRepository.getPools()).pools.map(PoolMapper.toPoolSelectItemInfo); +const pools = (await poolRepository.getPools()).map(PoolMapper.toPoolSelectItemInfo); export default { title: "incentivize/PoolIncentivizeSelectPool", diff --git a/packages/web/src/components/incentivize/pool-incentivize/PoolIncentivize.stories.tsx b/packages/web/src/components/incentivize/pool-incentivize/PoolIncentivize.stories.tsx index c63dc80b0..368b9555d 100644 --- a/packages/web/src/components/incentivize/pool-incentivize/PoolIncentivize.stories.tsx +++ b/packages/web/src/components/incentivize/pool-incentivize/PoolIncentivize.stories.tsx @@ -31,7 +31,7 @@ const tokenB = { const tokens = [tokenA, tokenB]; -const pools = (await poolRepository.getPools()).pools; +const pools = (await poolRepository.getPools()); const details = (await poolRepository.getPoolDetailByPoolId()).pool; diff --git a/packages/web/src/constants/option.constant.ts b/packages/web/src/constants/option.constant.ts index b4af9585a..db3d378e5 100644 --- a/packages/web/src/constants/option.constant.ts +++ b/packages/web/src/constants/option.constant.ts @@ -112,11 +112,6 @@ export const CHART_TYPE = { } as const; export type CHART_TYPE = ValuesType; -export type IncentivizedOptions = - | "INCENTIVIZED" - | "NON_INCENTIVIZED" - | "EXTERNAL_INCENTIVIZED"; - export type AddLiquidityType = "POOL" | "LIQUIDITY"; export type PriceRangeType = "Active" | "Passive" | "Custom"; diff --git a/packages/web/src/constants/swap.constant.ts b/packages/web/src/constants/swap.constant.ts index 382dbfb81..6938277a0 100644 --- a/packages/web/src/constants/swap.constant.ts +++ b/packages/web/src/constants/swap.constant.ts @@ -1,8 +1,9 @@ -export const MIN_PRICE_X96 = "4295128740"; -export const MAX_PRICE_X96 = - "1461446703485210103287273052203988822378723970341"; +export const MIN_PRICE_X96 = 4295128740n; +export const MAX_PRICE_X96 = 1461446703485210103287273052203988822378723970341n; export const MIN_TICK = -887272 as const; export const MAX_TICK = 887272 as const; export const X96 = 7.9228163e28 as const; +export const Q96 = 79228162514264337593543950336n as const; +export const Q128 = 340282366920938463463374607431768211456n as const; diff --git a/packages/web/src/containers/pool-add-incentivize-container/PoolAddIncentivizeContainer.tsx b/packages/web/src/containers/pool-add-incentivize-container/PoolAddIncentivizeContainer.tsx index a19fcc1e9..58c86e23f 100644 --- a/packages/web/src/containers/pool-add-incentivize-container/PoolAddIncentivizeContainer.tsx +++ b/packages/web/src/containers/pool-add-incentivize-container/PoolAddIncentivizeContainer.tsx @@ -16,7 +16,7 @@ import { useWallet } from "@hooks/wallet/use-wallet"; export const dummyDisclaimer = "This feature enables you to provide incentives as staking rewards for a specific liquidity pool. Before you proceed, ensure that you understand the mechanics of external incentives and acknowledge that you cannot withdraw the rewards once you complete this step.

The incentives you add will be automatically distributed by the contract and may draw more liquidity providers."; -const pools: PoolModel[] = POOLS.pools; +const pools = POOLS.pools as PoolModel[]; const tokenBalances: TokenBalanceInfo[] = []; const periods = [90, 180, 365]; @@ -34,7 +34,7 @@ const PoolAddIncentivizeContainer: React.FC = () => { const [token, setToken] = useState(null); const tokenAmountInput = useTokenAmountInput(token); const { updateTokenPrices } = useTokenData(); - + useEffect(() => { setPool(pools[0]); }, []); @@ -54,7 +54,7 @@ const PoolAddIncentivizeContainer: React.FC = () => { }, []); useEffect(() => { - setPoolDetail(PoolDetailData.pool); + setPoolDetail(PoolDetailData.pool as PoolDetailModel); }, []); const selectPool = useCallback((poolId: string) => { @@ -63,7 +63,7 @@ const PoolAddIncentivizeContainer: React.FC = () => { setCurrentPool(pool); } }, [setCurrentPool]); - + const selectToken = useCallback((path: string) => { const token = tokenBalances.find(token => token.path === path); if (token) { diff --git a/packages/web/src/containers/pool-incentivize-container/PoolIncentivizeContainer.tsx b/packages/web/src/containers/pool-incentivize-container/PoolIncentivizeContainer.tsx index 82873c2e1..8e2ea194e 100644 --- a/packages/web/src/containers/pool-incentivize-container/PoolIncentivizeContainer.tsx +++ b/packages/web/src/containers/pool-incentivize-container/PoolIncentivizeContainer.tsx @@ -16,7 +16,7 @@ import { useWallet } from "@hooks/wallet/use-wallet"; export const dummyDisclaimer = "This feature enables you to provide incentives as staking rewards for a specific liquidity pool. Before you proceed, ensure that you understand the mechanics of external incentives and acknowledge that you cannot withdraw the rewards once you complete this step.

The incentives you add will be automatically distributed by the contract and may draw more liquidity providers."; -const pools: PoolModel[] = POOLS.pools; +const pools: PoolModel[] = POOLS.pools as PoolModel[]; const tokenBalances: TokenBalanceInfo[] = []; const periods = [90, 180, 365]; @@ -33,7 +33,7 @@ const PoolIncentivizeContainer: React.FC = () => { const [token, setToken] = useState(null); const tokenAmountInput = useTokenAmountInput(token); const { updateTokenPrices } = useTokenData(); - + useEffect(() => { setDataModal(tokenAmountInput); }, [tokenAmountInput.amount, token]); @@ -50,7 +50,7 @@ const PoolIncentivizeContainer: React.FC = () => { }, []); useEffect(() => { - setPoolDetail(PoolDetailData.pool); + setPoolDetail(PoolDetailData.pool as PoolDetailModel); }, []); const selectPool = useCallback((poolId: string) => { @@ -59,7 +59,7 @@ const PoolIncentivizeContainer: React.FC = () => { setCurrentPool(pool); } }, [setCurrentPool]); - + const selectToken = useCallback((path: string) => { const token = tokenBalances.find(token => token.path === path); if (token) { diff --git a/packages/web/src/containers/pool-list-container/PoolListContainer.tsx b/packages/web/src/containers/pool-list-container/PoolListContainer.tsx index 85443151a..fe116a766 100644 --- a/packages/web/src/containers/pool-list-container/PoolListContainer.tsx +++ b/packages/web/src/containers/pool-list-container/PoolListContainer.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useMemo, useState } from "react"; -import { type FeeOptions } from "@common/values/data-constant"; +import { IncentivizedOptions, type FeeOptions } from "@common/values/data-constant"; import PoolList from "@components/earn/pool-list/PoolList"; import { type TokenPairInfo } from "@models/token/token-pair-info"; import { ValuesType } from "utility-types"; @@ -50,34 +50,6 @@ export const POOL_TYPE = { export type POOL_TYPE = ValuesType; -// const SORT_PARAMS: { [key in TABLE_HEAD]: string } = { -// "Pool Name": "name", -// Liquidity: "liquidity", -// "Volume (24h)": "volume", -// "Fees (24h)": "fees", -// APR: "apr", -// Rewards: "rewards", -// "Liquidity Plot": "liquidity_plot", -// }; - -// async function fetchPools( -// type: POOL_TYPE, // eslint-disable-line -// page: number, // eslint-disable-line -// keyword: string, // eslint-disable-line -// sortKey?: string, // eslint-disable-line -// direction?: string, // eslint-disable-line -// ): Promise { -// return new Promise(resolve => setTimeout(resolve, 2000)).then(() => -// Promise.resolve([ -// ...dummyPoolList, -// ...dummyPoolList, -// ...dummyPoolList, -// ...dummyPoolList, -// ...dummyPoolList, -// ]), -// ); -// } - const PoolListContainer: React.FC = () => { const [poolType, setPoolType] = useState(POOL_TYPE.ALL); const [page, setPage] = useState(0); @@ -104,19 +76,29 @@ const PoolListContainer: React.FC = () => { }, [isClickOutside, keyword]); const sortedPoolListInfos = useMemo(() => { - return poolListInfos.filter(info => { - if (poolType !== "All") { - return info.incentiveType === poolType; + function filteredPoolType(poolType: POOL_TYPE, incentivizedType: IncentivizedOptions) { + switch (poolType) { + case "Incentivized": + return incentivizedType !== "INCENTIVIZED"; + case "Non-Incentivized": + return incentivizedType === "NON_INCENTIVIZED"; + default: + break; } + return true; + } + + return poolListInfos.filter(info => { if (keyword !== "") { return info.tokenA.name.toLowerCase().includes(keyword.toLowerCase()) || info.tokenB.name.toLowerCase().includes(keyword.toLowerCase()) || info.tokenA.symbol.toLowerCase().includes(keyword.toLowerCase()) || info.tokenB.symbol.toLowerCase().includes(keyword.toLowerCase()); } - return true; + + return filteredPoolType(poolType, info.incentivizedType); }); - }, [keyword, poolListInfos, poolType, sortOption]); + }, [keyword, poolListInfos, poolType]); const totalPage = useMemo(() => { return Math.floor(sortedPoolListInfos.length / 20) + 1; @@ -176,7 +158,7 @@ const PoolListContainer: React.FC = () => { const disableItems = ["Rewards", "Liquidity Plot"]; return !disableItems.includes(head); }, []); - + return ( { ...MOCK_DATA, lpRewardId: (Number(MOCK_DATA.lpRewardId) + item).toString(), position: item > 2 ? { ...MOCK_DATA.position, balance: 0 } : MOCK_DATA.position, - }; + } as LPPositionModel; }); const RemoveLiquidityContainer: React.FC = () => { diff --git a/packages/web/src/hooks/pool/use-pool-data.tsx b/packages/web/src/hooks/pool/use-pool-data.tsx index b09e97d4f..a9f4592a6 100644 --- a/packages/web/src/hooks/pool/use-pool-data.tsx +++ b/packages/web/src/hooks/pool/use-pool-data.tsx @@ -21,14 +21,14 @@ export const usePoolData = () => { const higestAPRs: CardListPoolInfo[] = useMemo(() => { const sortedTokens = pools.sort((p1, p2) => { - const p2Apr = Math.max(...p2.bins.map(b => b.apr)) || 0; - const p1Apr = Math.max(...p2.bins.map(b => b.apr)) || 0; + const p2Apr = p2.apr; + const p1Apr = p1.apr; return p2Apr - p1Apr; }).filter((_, index) => index < 3); return sortedTokens?.map(pool => ({ pool, upDown: "none", - content: `${Math.max(...pool.bins.map(b => b.apr)) || 0}%` + content: `${pool.apr || 0}%` })); }, [pools]); @@ -42,12 +42,12 @@ export const usePoolData = () => { const incentivizedPools: PoolCardInfo[] = useMemo(() => { return pools ?.map(PoolMapper.toCardInfo) - .filter(info => info.incentiveType === "Incentivized"); + .filter(info => info.incentivizedType !== "NON_INCENTIVIZED"); }, [pools]); async function updatePools() { - const response = await poolRepository.getPools(); - setPools(response.pools); + const pools = await poolRepository.getPools(); + setPools(pools); setLoading(false); setIsFetchedPools(true); } diff --git a/packages/web/src/hooks/pool/use-pool.tsx b/packages/web/src/hooks/pool/use-pool.tsx index cea57834b..69116b3d5 100644 --- a/packages/web/src/hooks/pool/use-pool.tsx +++ b/packages/web/src/hooks/pool/use-pool.tsx @@ -81,7 +81,7 @@ export const usePool = ({ const feetierOfLiquidityMap: { [key in string]: number } = {}; const totalLiquidities = infos.map(info => info.liquidity).reduce((total, cur) => total + cur, 0n); for (const info of infos) { - const liquidityRate = Math.round((Number(info.liquidity) / Number(totalLiquidities)) * 100); + const liquidityRate = Math.round(Number(info.liquidity / totalLiquidities) * 100); const feeTier = currentPools.find(pool => pool.id === info.poolPath)?.fee; if (feeTier) { feetierOfLiquidityMap[`${feeTier}`] = liquidityRate; diff --git a/packages/web/src/models/pool/info/pool-card-info.ts b/packages/web/src/models/pool/info/pool-card-info.ts index 47d7ed70a..002b28608 100644 --- a/packages/web/src/models/pool/info/pool-card-info.ts +++ b/packages/web/src/models/pool/info/pool-card-info.ts @@ -1,5 +1,5 @@ +import { IncentivizedOptions } from "@common/values"; import { SwapFeeTierType } from "@constants/option.constant"; -import { POOL_TYPE } from "@containers/pool-list-container/PoolListContainer"; import { TokenModel } from "@models/token/token-model"; import { PoolBinModel } from "../pool-bin-model"; import { PoolRewardInfo } from "./pool-reward-info"; @@ -10,6 +10,8 @@ import { PoolRewardInfo } from "./pool-reward-info"; export interface PoolCardInfo { poolId: string; + incentivizedType: IncentivizedOptions; + tokenA: TokenModel; tokenB: TokenModel; @@ -26,8 +28,6 @@ export interface PoolCardInfo { rewards: PoolRewardInfo[]; - incentiveType: POOL_TYPE; - price: number; currentTick: number; diff --git a/packages/web/src/models/pool/info/pool-list-info.ts b/packages/web/src/models/pool/info/pool-list-info.ts index cfcdb35bc..5ee3fd876 100644 --- a/packages/web/src/models/pool/info/pool-list-info.ts +++ b/packages/web/src/models/pool/info/pool-list-info.ts @@ -1,5 +1,5 @@ +import { IncentivizedOptions } from "@common/values"; import { SwapFeeTierType } from "@constants/option.constant"; -import { POOL_TYPE } from "@containers/pool-list-container/PoolListContainer"; import { TokenModel } from "@models/token/token-model"; import { PoolBinModel } from "../pool-bin-model"; import { PoolRewardInfo } from "./pool-reward-info"; @@ -7,6 +7,8 @@ import { PoolRewardInfo } from "./pool-reward-info"; export interface PoolListInfo { poolId: string; + incentivizedType: IncentivizedOptions; + tokenA: TokenModel; tokenB: TokenModel; @@ -23,8 +25,6 @@ export interface PoolListInfo { rewards: PoolRewardInfo[]; - incentiveType: POOL_TYPE; - price: number; currentTick: number; diff --git a/packages/web/src/models/pool/mapper/pool-mapper.ts b/packages/web/src/models/pool/mapper/pool-mapper.ts index a03fb4ab1..b8c602e44 100644 --- a/packages/web/src/models/pool/mapper/pool-mapper.ts +++ b/packages/web/src/models/pool/mapper/pool-mapper.ts @@ -5,17 +5,20 @@ import { SwapFeeTierInfoMap } from "@constants/option.constant"; import { PoolRewardInfo } from "../info/pool-reward-info"; import { PoolCardInfo } from "../info/pool-card-info"; import { PoolSelectItemInfo } from "../info/pool-select-item-info"; +import { PoolResponse } from "@repositories/pool"; +import { IncentivizedOptions } from "@common/values"; export class PoolMapper { public static toListInfo(poolModel: PoolModel): PoolListInfo { const { id, + incentivizedType, currentTick, price, tokenA, tokenB, volume, - totalVolume, + tvl, fee, feeVolume, apr, @@ -42,15 +45,15 @@ export class PoolMapper { return { poolId: id, + incentivizedType, tokenA, tokenB, feeTier: feeTierInfo?.type || "NONE", - liquidity: `$${BigNumber(totalVolume).toFormat()}`, + liquidity: `$${BigNumber(tvl).toFormat()}`, apr: `${BigNumber(apr).toFormat(2)}%`, volume24h: `$${BigNumber(volume).toFormat()}`, fees24h: `$${BigNumber(feeVolume).toFormat()}`, rewards: [defaultReward], - incentiveType: "Incentivized", currentTick, price, bins, @@ -75,11 +78,12 @@ export class PoolMapper { const { id, currentTick, + incentivizedType, price, tokenA, tokenB, + tvl, volume, - totalVolume, fee, feeVolume, apr, @@ -106,27 +110,35 @@ export class PoolMapper { return { poolId: id, + incentivizedType, tokenA, tokenB, feeTier: feeTierInfo?.type || "NONE", - liquidity: `$${BigNumber(totalVolume).toFormat()}`, + liquidity: `$${BigNumber(tvl).toFormat()}`, apr: `${BigNumber(apr).toFormat(2)}%`, volume24h: `$${BigNumber(volume).toFormat()}`, fees24h: `$${BigNumber(feeVolume).toFormat()}`, rewards: [defaultReward], - incentiveType: "Incentivized", currentTick, price, bins, }; } - public static fromResponse(poolModel: PoolModel): PoolModel { - const bins = poolModel.bins.map(bin => ({ + public static fromResponse(pool: PoolResponse): PoolModel { + const bins = pool.bins.map(bin => ({ ...bin, })); + const incentivizedTypeStr = pool.incentivizedType?.toUpperCase() || ""; + const incentivizedType: IncentivizedOptions = + incentivizedTypeStr !== "INCENTIVIZED" + ? incentivizedTypeStr === "EXTERNAL_INCENTIVIZED" + ? "EXTERNAL_INCENTIVIZED" + : "INCENTIVIZED" + : "NON_INCENTIVIZED"; return { - ...poolModel, + ...pool, + incentivizedType, bins, }; } diff --git a/packages/web/src/models/pool/pool-bin-model.ts b/packages/web/src/models/pool/pool-bin-model.ts index 8f0b3ca47..bc26c48e0 100644 --- a/packages/web/src/models/pool/pool-bin-model.ts +++ b/packages/web/src/models/pool/pool-bin-model.ts @@ -1,17 +1,23 @@ export interface PoolBinModel { - poolPath: string; + index: number; - currentTick: number; + liquidity: number; + + reserveTokenA: number; - tokenAAmount: number; + reserveTokenB: number; - tokenBAmount: number; + currentTick?: number; minTick: number; maxTick: number; - liquidity: number; + minTickPrice?: string; + + maxTickPrice?: string; + + reverseMinTickPrice?: string; - apr: number; + reverseMaxTickPrice?: string; } diff --git a/packages/web/src/models/pool/pool-model.ts b/packages/web/src/models/pool/pool-model.ts index 976af18f2..070594241 100644 --- a/packages/web/src/models/pool/pool-model.ts +++ b/packages/web/src/models/pool/pool-model.ts @@ -1,9 +1,12 @@ +import { IncentivizedOptions } from "@common/values"; import { TokenModel } from "@models/token/token-model"; import { PoolBinModel } from "./pool-bin-model"; export interface PoolModel { id: string; + incentivizedType: IncentivizedOptions; + name: string; price: number; diff --git a/packages/web/src/repositories/pool/mock/pool-detail.json b/packages/web/src/repositories/pool/mock/pool-detail.json index 28100e3fa..dcfec4a75 100644 --- a/packages/web/src/repositories/pool/mock/pool-detail.json +++ b/packages/web/src/repositories/pool/mock/pool-detail.json @@ -23,6 +23,7 @@ "logoURI": "https://s2.coinmarketcap.com/static/img/coins/64x64/5994.png", "priceId": "gno.land/r/foo" }, + "incentivizedType": "INCENTIVIZED", "tvl": 1182782.0, "tvlChange": 118278200.0, "volume": 1182797.0, diff --git a/packages/web/src/repositories/pool/mock/pools.json b/packages/web/src/repositories/pool/mock/pools.json index f0315779e..e8b5dd061 100644 --- a/packages/web/src/repositories/pool/mock/pools.json +++ b/packages/web/src/repositories/pool/mock/pools.json @@ -28,6 +28,7 @@ "logoURI": "https://s2.coinmarketcap.com/static/img/coins/64x64/5994.png", "priceId": "gno.land/r/foo" }, + "incentivizedType": "INCENTIVIZED", "tvl": 1182782.0, "tvlChange": 118278200.0, "volume": 1182797.0, diff --git a/packages/web/src/repositories/pool/pool-repository-impl.ts b/packages/web/src/repositories/pool/pool-repository-impl.ts index 051f9a0e8..9c153d17f 100644 --- a/packages/web/src/repositories/pool/pool-repository-impl.ts +++ b/packages/web/src/repositories/pool/pool-repository-impl.ts @@ -23,6 +23,7 @@ import { PoolRPCMapper } from "@models/pool/mapper/pool-rpc-mapper"; import { PoolError } from "@common/errors/pool"; import { PoolMapper } from "@models/pool/mapper/pool-mapper"; import { PoolRPCResponse } from "./response/pool-rpc-response"; +import { PoolModel } from "@models/pool/pool-model"; const POOL_PATH = process.env.NEXT_PUBLIC_PACKAGE_POOL_PATH || ""; const POSITION_PATH = process.env.NEXT_PUBLIC_PACKAGE_POSITION_PATH || ""; @@ -60,14 +61,14 @@ export class PoolRepositoryImpl implements PoolRepository { return result; }; - getPools = async (): Promise => { + getPools = async (): Promise => { const response = await this.networkClient.get({ url: "/pools", }); - return { - meta: response.data.meta, - pools: response.data.pools.map(PoolMapper.fromResponse) - }; + const pools = response?.data?.pools ? + response.data.pools.map(PoolMapper.fromResponse) : + []; + return pools; }; getPoolDetailByPoolId = async ( diff --git a/packages/web/src/repositories/pool/pool-repository-mock.ts b/packages/web/src/repositories/pool/pool-repository-mock.ts index 743e82902..cba25ce71 100644 --- a/packages/web/src/repositories/pool/pool-repository-mock.ts +++ b/packages/web/src/repositories/pool/pool-repository-mock.ts @@ -1,14 +1,14 @@ -import { PoolDetailResponse, PoolListResponse, PoolRepository } from "."; +import { PoolDetailResponse, PoolRepository } from "."; -import PoolListData from "./mock/pools.json"; import PoolDetailData from "./mock/pool-detail.json"; import { PoolRPCModel } from "@models/pool/pool-rpc-model"; import { PoolError } from "@common/errors/pool"; import rpcPools from "./mock/rpc-pools.json"; import { PoolRPCMapper } from "@models/pool/mapper/pool-rpc-mapper"; +import { PoolModel } from "@models/pool/pool-model"; export class PoolRepositoryMock implements PoolRepository { - getPools = async (): Promise => { - return PoolListData as PoolListResponse; + getPools = async (): Promise => { + return []; }; getRPCPools = async (): Promise => { diff --git a/packages/web/src/repositories/pool/pool-repository.spec.ts b/packages/web/src/repositories/pool/pool-repository.spec.ts index 8382f3dd1..f1f14bb70 100644 --- a/packages/web/src/repositories/pool/pool-repository.spec.ts +++ b/packages/web/src/repositories/pool/pool-repository.spec.ts @@ -8,16 +8,16 @@ beforeEach(() => { describe("getPools", () => { it("success", async () => { - const response = await poolRepository.getPools(); + const pools = await poolRepository.getPools(); - expect(response.pools).not.toBeNull(); + expect(pools).not.toBeNull(); }); }); describe("getPoolDetail", () => { it("success", async () => { - const response = await poolRepository.getPoolDetailByPoolId(""); + const pools = await poolRepository.getPoolDetailByPoolId(""); - expect(response.pool).not.toBeNull(); + expect(pools).not.toBeNull(); }); }); diff --git a/packages/web/src/repositories/pool/pool-repository.ts b/packages/web/src/repositories/pool/pool-repository.ts index 68ecb1427..33f737526 100644 --- a/packages/web/src/repositories/pool/pool-repository.ts +++ b/packages/web/src/repositories/pool/pool-repository.ts @@ -1,9 +1,10 @@ +import { PoolModel } from "@models/pool/pool-model"; import { PoolRPCModel } from "@models/pool/pool-rpc-model"; import { CreatePoolRequest } from "./request/create-pool-request"; -import { PoolDetailResponse, PoolListResponse } from "./response"; +import { PoolDetailResponse } from "./response"; export interface PoolRepository { - getPools: () => Promise; + getPools: () => Promise; getRPCPools: () => Promise; diff --git a/packages/web/src/repositories/pool/response/pool-list-response.ts b/packages/web/src/repositories/pool/response/pool-list-response.ts index 7b0215009..b450d123d 100644 --- a/packages/web/src/repositories/pool/response/pool-list-response.ts +++ b/packages/web/src/repositories/pool/response/pool-list-response.ts @@ -1,9 +1,51 @@ -import { PoolModel } from "@models/pool/pool-model"; +import { PoolBinModel } from "@models/pool/pool-bin-model"; +import { TokenModel } from "@models/token/token-model"; export interface PoolListResponse { meta: { height: number; timestamp: string; }; - pools: PoolModel[]; + pools: PoolResponse[]; +} +export interface PoolResponse { + id: string; + + incentivizedType?: string; + + name: string; + + price: number; + + tokenA: TokenModel; + + tokenB: TokenModel; + + tokenABalance: number; + + tokenBBalance: number; + + tickSpacing: number; + + currentTick: number; + + bins: PoolBinModel[]; + + tvl: number; + + tvlChange: number; + + volume: number; + + volumeChange: number; + + totalVolume: number; + + fee: string; + + feeVolume: number; + + feeChange: number; + + apr: number; } diff --git a/packages/web/src/repositories/pool/response/pool-list-rpc-response.ts b/packages/web/src/repositories/pool/response/pool-list-rpc-response.ts new file mode 100644 index 000000000..af6bfdc01 --- /dev/null +++ b/packages/web/src/repositories/pool/response/pool-list-rpc-response.ts @@ -0,0 +1,11 @@ +import { PoolRPCResponse } from "./pool-rpc-response"; + +export interface PoolListRPCResponse { + stat: { + height: number; + timestamp: number; + }; + response: { + data: PoolRPCResponse[]; + }; +} diff --git a/packages/web/src/resources/ticks.json b/packages/web/src/resources/ticks.json new file mode 100644 index 000000000..f32c12220 --- /dev/null +++ b/packages/web/src/resources/ticks.json @@ -0,0 +1,1419 @@ +{ + "-885000": { + "price": "3.688586534915811e-39", + "sqrtPriceX96": "4811822206" + }, + "-880000": { + "price": "6.081299054691614e-39", + "sqrtPriceX96": "6178424788" + }, + "-875000": { + "price": "1.0026116465622571e-38", + "sqrtPriceX96": "7933155304" + }, + "-870000": { + "price": "1.6529858255314103e-38", + "sqrtPriceX96": "10186245724" + }, + "-865000": { + "price": "2.7252447632904016e-38", + "sqrtPriceX96": "13079234930" + }, + "-860000": { + "price": "4.4930566887674917e-38", + "sqrtPriceX96": "16793860170" + }, + "-855000": { + "price": "7.407612952938684e-38", + "sqrtPriceX96": "21563473775" + }, + "-850000": { + "price": "1.2212783737566713e-37", + "sqrtPriceX96": "27687702323" + }, + "-845000": { + "price": "2.0134972975525625e-37", + "sqrtPriceX96": "35551269149" + }, + "-840000": { + "price": "3.3196128371460294e-37", + "sqrtPriceX96": "45648162615" + }, + "-835000": { + "price": "5.472979478015434e-37", + "sqrtPriceX96": "58612668408" + }, + "-830000": { + "price": "9.023192111924118e-37", + "sqrtPriceX96": "75259215293" + }, + "-825000": { + "price": "1.4876356875763899e-36", + "sqrtPriceX96": "96633537429" + }, + "-820000": { + "price": "2.4526352885985073e-36", + "sqrtPriceX96": "124078367278" + }, + "-815000": { + "price": "4.043610884785118e-36", + "sqrtPriceX96": "159317785894" + }, + "-810000": { + "price": "6.666620619691036e-36", + "sqrtPriceX96": "204565529503" + }, + "-805000": { + "price": "1.0991124456143483e-35", + "sqrtPriceX96": "262664056157" + }, + "-800000": { + "price": "1.8120847683100055e-35", + "sqrtPriceX96": "337263108622" + }, + "-795000": { + "price": "2.987548017169191e-35", + "sqrtPriceX96": "433048990797" + }, + "-790000": { + "price": "4.925510832043277e-35", + "sqrtPriceX96": "556038960786" + }, + "-785000": { + "price": "8.12059147406223e-35", + "sqrtPriceX96": "713959234367" + }, + "-780000": { + "price": "1.3388257205650338e-34", + "sqrtPriceX96": "916730344969" + }, + "-775000": { + "price": "2.207295263863123e-34", + "sqrtPriceX96": "1177090350448" + }, + "-770000": { + "price": "3.6391236790822533e-34", + "sqrtPriceX96": "1511395036417" + }, + "-765000": { + "price": "5.999750630769433e-34", + "sqrtPriceX96": "1940645384813" + }, + "-760000": { + "price": "9.891669205509458e-34", + "sqrtPriceX96": "2491806853174" + }, + "-755000": { + "price": "1.6308197738991037e-33", + "sqrtPriceX96": "3199503341576" + }, + "-750000": { + "price": "2.688700036045479e-33", + "sqrtPriceX96": "4108192262060" + }, + "-745000": { + "price": "4.432806125809347e-33", + "sqrtPriceX96": "5274957348141" + }, + "-740000": { + "price": "7.308279051430971e-33", + "sqrtPriceX96": "6773094648388" + }, + "-735000": { + "price": "1.2049013915273125e-32", + "sqrtPriceX96": "8696716975767" + }, + "-730000": { + "price": "1.986496893574681e-32", + "sqrtPriceX96": "11166666063731" + }, + "-725000": { + "price": "3.2750978096056144e-32", + "sqrtPriceX96": "14338103830025" + }, + "-720000": { + "price": "5.39958843992033e-32", + "sqrtPriceX96": "18410259630517" + }, + "-715000": { + "price": "8.902193771132641e-32", + "sqrtPriceX96": "23638945824432" + }, + "-710000": { + "price": "1.467686932450024e-31", + "sqrtPriceX96": "30352627877348" + }, + "-705000": { + "price": "2.419746173881015e-31", + "sqrtPriceX96": "38973058523979" + }, + "-700000": { + "price": "3.989387257293159e-31", + "sqrtPriceX96": "50041772226484" + }, + "-695000": { + "price": "6.577223206484807e-31", + "sqrtPriceX96": "64254104307122" + }, + "-690000": { + "price": "1.0843736723938543e-30", + "sqrtPriceX96": "82502871833254" + }, + "-685000": { + "price": "1.7877852468524863e-30", + "sqrtPriceX96": "105934460282873" + }, + "-680000": { + "price": "2.94748588077351e-30", + "sqrtPriceX96": "136020839348532" + }, + "-675000": { + "price": "4.8594611867697274e-30", + "sqrtPriceX96": "174652031904206" + }, + "-670000": { + "price": "8.011696741198408e-30", + "sqrtPriceX96": "224254845024943" + }, + "-665000": { + "price": "1.3208724631381812e-29", + "sqrtPriceX96": "287945321728320" + }, + "-660000": { + "price": "2.177696086404475e-29", + "sqrtPriceX96": "369724490438560" + }, + "-655000": { + "price": "3.5903241055342156e-29", + "sqrtPriceX96": "474729709132166" + }, + "-650000": { + "price": "5.919295747122842e-29", + "sqrtPriceX96": "609557393575371" + }, + "-645000": { + "price": "9.759024843439067e-29", + "sqrtPriceX96": "782677403404210" + }, + "-640000": { + "price": "1.6089509624713884e-28", + "sqrtPriceX96": "1004965117733104" + }, + "-635000": { + "price": "2.6526453627976874e-28", + "sqrtPriceX96": "1290384625220520" + }, + "-630000": { + "price": "4.373363505102601e-28", + "sqrtPriceX96": "1656865946513094" + }, + "-625000": { + "price": "7.210277188199483e-28", + "sqrtPriceX96": "2127431396081296" + }, + "-620000": { + "price": "1.1887440197919286e-27", + "sqrtPriceX96": "2731641841367668" + }, + "-615000": { + "price": "1.9598585570382892e-27", + "sqrtPriceX96": "3507453713081050" + }, + "-610000": { + "price": "3.2311797154348846e-27", + "sqrtPriceX96": "4503603423809986" + }, + "-605000": { + "price": "5.327181553966544e-27", + "sqrtPriceX96": "5782668983858475" + }, + "-600000": { + "price": "8.782817982348559e-27", + "sqrtPriceX96": "7425001144658883" + }, + "-595000": { + "price": "1.4480056842370883e-26", + "sqrtPriceX96": "9533771023739266" + }, + "-590000": { + "price": "2.3872980924765188e-26", + "sqrtPriceX96": "12241451302465250" + }, + "-585000": { + "price": "3.9358907526283384e-26", + "sqrtPriceX96": "15718138144653476" + }, + "-580000": { + "price": "6.489024586181894e-26", + "sqrtPriceX96": "20182236618027173" + }, + "-575000": { + "price": "1.0698325417684494e-25", + "sqrtPriceX96": "25914180875461240" + }, + "-570000": { + "price": "1.7638115747996925e-25", + "sqrtPriceX96": "33274050996225263" + }, + "-565000": { + "price": "2.9079609657926366e-25", + "sqrtPriceX96": "42724193175166041" + }, + "-560000": { + "price": "4.79429724772839e-25", + "sqrtPriceX96": "54858264257513462" + }, + "-555000": { + "price": "7.904262254535047e-25", + "sqrtPriceX96": "70438525193647107" + }, + "-550000": { + "price": "1.3031599535900734e-24", + "sqrtPriceX96": "90443726184364514" + }, + "-545000": { + "price": "2.148493825172021e-24", + "sqrtPriceX96": "116130591655971646" + }, + "-540000": { + "price": "3.542178919852179e-24", + "sqrtPriceX96": "149112767544262034" + }, + "-535000": { + "price": "5.83991973969977e-24", + "sqrtPriceX96": "191462190346687867" + }, + "-530000": { + "price": "9.628159203081212e-24", + "sqrtPriceX96": "245839245934926340" + }, + "-525000": { + "price": "1.5873754053449238e-23", + "sqrtPriceX96": "315659894689482773" + }, + "-520000": { + "price": "2.6170741720676837e-23", + "sqrtPriceX96": "405310261738072434" + }, + "-515000": { + "price": "4.3147179923803235e-23", + "sqrtPriceX96": "520422172831885512" + }, + "-510000": { + "price": "7.113589501004412e-23", + "sqrtPriceX96": "668226944991804751" + }, + "-505000": { + "price": "1.172803313638667e-22", + "sqrtPriceX96": "858009657012297028" + }, + "-500000": { + "price": "1.9335774327259488e-22", + "sqrtPriceX96": "1101692437043807371" + }, + "-495000": { + "price": "3.187850549933684e-22", + "sqrtPriceX96": "1414583409312522802" + }, + "-490000": { + "price": "5.255745622964578e-22", + "sqrtPriceX96": "1816338348724337676" + }, + "-485000": { + "price": "8.66504298762875e-22", + "sqrtPriceX96": "2332195454384683400" + }, + "-480000": { + "price": "1.4285883557488947e-21", + "sqrtPriceX96": "2994560810364780479" + }, + "-475000": { + "price": "2.355285130258572e-21", + "sqrtPriceX96": "3845044132177373716" + }, + "-470000": { + "price": "3.8831116202883344e-21", + "sqrtPriceX96": "4937072684321513317" + }, + "-465000": { + "price": "6.4020086833235835e-21", + "sqrtPriceX96": "6339247574896031696" + }, + "-460000": { + "price": "1.055486403409316e-20", + "sqrtPriceX96": "8139653269323472669" + }, + "-455000": { + "price": "1.7401593826073617e-20", + "sqrtPriceX96": "10451391046341159896" + }, + "-450000": { + "price": "2.868966068246092e-20", + "sqrtPriceX96": "13419684007328600630" + }, + "-445000": { + "price": "4.7300071378603265e-20", + "sqrtPriceX96": "17230999974840333146" + }, + "-440000": { + "price": "7.798268432601952e-20", + "sqrtPriceX96": "22124765379781222272" + }, + "-435000": { + "price": "1.2856849635627731e-19", + "sqrtPriceX96": "28408406002269848731" + }, + "-430000": { + "price": "2.1196831576364164e-19", + "sqrtPriceX96": "36476659423801846854" + }, + "-425000": { + "price": "3.494679346888167e-19", + "sqrtPriceX96": "46836372396737803653" + }, + "-420000": { + "price": "5.76160814108876e-19", + "sqrtPriceX96": "60138340899016078592" + }, + "-415000": { + "price": "9.49904843230316e-19", + "sqrtPriceX96": "77218193062667059059" + }, + "-410000": { + "price": "1.5660891700661575e-18", + "sqrtPriceX96": "99148883236997943770" + }, + "-405000": { + "price": "2.581979980497725e-18", + "sqrtPriceX96": "127308094857462255731" + }, + "-400000": { + "price": "4.256858898659908e-18", + "sqrtPriceX96": "163464786360687385626" + }, + "-395000": { + "price": "7.018198367133316e-18", + "sqrtPriceX96": "209890316950092302147" + }, + "-390000": { + "price": "1.1570763676460744e-17", + "sqrtPriceX96": "269501133119915777017" + }, + "-385000": { + "price": "1.9076487305272565e-17", + "sqrtPriceX96": "346041979488690386382" + }, + "-380000": { + "price": "3.1451024157425234e-17", + "sqrtPriceX96": "444321143225657989896" + }, + "-375000": { + "price": "5.185267626695346e-17", + "sqrtPriceX96": "570512510097948844672" + }, + "-370000": { + "price": "8.548847320797682e-17", + "sqrtPriceX96": "732543407264681774699" + }, + "-365000": { + "price": "1.4094314078998952e-16", + "sqrtPriceX96": "940592597057721782294" + }, + "-360000": { + "price": "2.3237014524074146e-16", + "sqrtPriceX96": "1207729705661149618913" + }, + "-355000": { + "price": "3.831040240522179e-16", + "sqrtPriceX96": "1550736255525574621679" + }, + "-350000": { + "price": "6.31615963801831e-16", + "sqrtPriceX96": "1991159878679166603244" + }, + "-345000": { + "price": "1.0413326425277632e-15", + "sqrtPriceX96": "2556667936494406447405" + }, + "-340000": { + "price": "1.7168243593255278e-15", + "sqrtPriceX96": "3282785580148681555273" + }, + "-335000": { + "price": "2.830494080756645e-15", + "sqrtPriceX96": "4215127436537041762348" + }, + "-330000": { + "price": "4.6665791393744455e-15", + "sqrtPriceX96": "5412263113889585603843" + }, + "-325000": { + "price": "7.693695956510654e-15", + "sqrtPriceX96": "6949396537826923557083" + }, + "-320000": { + "price": "1.2684443079896679e-14", + "sqrtPriceX96": "8923090253321721527778" + }, + "-315000": { + "price": "2.0912588326418608e-14", + "sqrtPriceX96": "11457331472672411580135" + }, + "-310000": { + "price": "3.44781672916634e-14", + "sqrtPriceX96": "14711320937925385215210" + }, + "-305000": { + "price": "5.684346677882062e-14", + "sqrtPriceX96": "18889473893187571972871" + }, + "-300000": { + "price": "9.371668998822225e-14", + "sqrtPriceX96": "24254261426760301279129" + }, + "-295000": { + "price": "1.5450883769145758e-13", + "sqrtPriceX96": "31142698874730970675909" + }, + "-290000": { + "price": "2.5473563916699783e-13", + "sqrtPriceX96": "39987517085640532535517" + }, + "-285000": { + "price": "4.1997756782948445e-13", + "sqrtPriceX96": "51344346522639221437138" + }, + "-280000": { + "price": "6.924086400189118e-13", + "sqrtPriceX96": "65926621905302679888627" + }, + "-275000": { + "price": "1.1415603153535399e-12", + "sqrtPriceX96": "84650400096694501733414" + }, + "-270000": { + "price": "1.882067724565771e-12", + "sqrtPriceX96": "108691906690187899962087" + }, + "-265000": { + "price": "3.102927521403169e-12", + "sqrtPriceX96": "139561426366014697895416" + }, + "-260000": { + "price": "5.115734719537052e-12", + "sqrtPriceX96": "179198178801245124734420" + }, + "-255000": { + "price": "8.434209803534896e-12", + "sqrtPriceX96": "230092140226955780863806" + }, + "-250000": { + "price": "1.3905313490626344e-11", + "sqrtPriceX96": "295440463448801648376846" + }, + "-245000": { + "price": "2.2925413023464988e-11", + "sqrtPriceX96": "379348322618701395038342" + }, + "-240000": { + "price": "3.779667122576928e-11", + "sqrtPriceX96": "487086799803102792261278" + }, + "-235000": { + "price": "6.231461803050979e-11", + "sqrtPriceX96": "625424013752398326272026" + }, + "-230000": { + "price": "1.0273686793986453e-10", + "sqrtPriceX96": "803050292342716926398368" + }, + "-225000": { + "price": "1.6938022518127943e-10", + "sqrtPriceX96": "1031124097974004516289920" + }, + "-220000": { + "price": "2.7925379912549004e-10", + "sqrtPriceX96": "1323973000895137595086273" + }, + "-215000": { + "price": "4.6040016916117844e-10", + "sqrtPriceX96": "1699993735519764930000240" + }, + "-210000": { + "price": "7.590525766433286e-10", + "sqrtPriceX96": "2182807881167162077574891" + }, + "-205000": { + "price": "1.2514348445149505e-09", + "sqrtPriceX96": "2802745766959374473415602" + }, + "-200000": { + "price": "2.063215669449006e-09", + "sqrtPriceX96": "3598751819609688046946419" + }, + "-195000": { + "price": "3.40158252530506e-09", + "sqrtPriceX96": "4620831047831447636217006" + }, + "-190000": { + "price": "5.6081212680741175e-09", + "sqrtPriceX96": "5933190351236521063098400" + }, + "-185000": { + "price": "9.245997685916694e-09", + "sqrtPriceX96": "7618271990387264626894203" + }, + "-180000": { + "price": "1.5243691981955735e-08", + "sqrtPriceX96": "9781932600126939955981007" + }, + "-175000": { + "price": "2.5131970949406878e-08", + "sqrtPriceX96": "12560093091210585200253310" + }, + "-170000": { + "price": "4.143457927052631e-08", + "sqrtPriceX96": "16127277186292274990982847" + }, + "-165000": { + "price": "6.831236446921192e-08", + "sqrtPriceX96": "20707574980117841975345668" + }, + "-160000": { + "price": "1.1262523287388437e-07", + "sqrtPriceX96": "26588720253513922924161746" + }, + "-155000": { + "price": "1.8568297523376616e-07", + "sqrtPriceX96": "34140165876419699683639095" + }, + "-150000": { + "price": "3.061318179938542e-07", + "sqrtPriceX96": "43836292794701720435367485" + }, + "-145000": { + "price": "5.047134228123896e-07", + "sqrtPriceX96": "56286210586635248912715112" + }, + "-140000": { + "price": "8.321109541514954e-07", + "sqrtPriceX96": "72272021656584229836729783" + }, + "-135000": { + "price": "1.3718847344313486e-06", + "sqrtPriceX96": "92797952818127739904818859" + }, + "-130000": { + "price": "2.2617990006932654e-06", + "sqrtPriceX96": "119153440707036434548008061" + }, + "-125000": { + "price": "3.7289829029678247e-06", + "sqrtPriceX96": "152994134042489452358643945" + }, + "-120000": { + "price": "6.14789974103102e-06", + "sqrtPriceX96": "196445901289268864651836582" + }, + "-115000": { + "price": "1.013591968890167e-05", + "sqrtPriceX96": "252238377470313313167184095" + }, + "-110000": { + "price": "1.6710888639611302e-05", + "sqrtPriceX96": "323876439525042026007317843" + }, + "-105000": { + "price": "2.7550908817012347e-05", + "sqrtPriceX96": "415860382275745179290392731" + }, + "-100000": { + "price": "4.5422633889383895e-05", + "sqrtPriceX96": "533968626430936354154228408" + }, + "-95000": { + "price": "7.488739058128623e-05", + "sqrtPriceX96": "685620718309935698881964048" + }, + "-90000": { + "price": "0.00012346534729208733", + "sqrtPriceX96": "880343424889649248742632770" + }, + "-85000": { + "price": "0.0002035548556790683", + "sqrtPriceX96": "1130369204210797695124473645" + }, + "-80000": { + "price": "0.00033559683084600844", + "sqrtPriceX96": "1451404646985709758556457135" + }, + "-75000": { + "price": "0.0005532918018494891", + "sqrtPriceX96": "1863617162821136589286696008" + }, + "-70000": { + "price": "0.0009122011588194214", + "sqrtPriceX96": "2392901894571168388149760752" + }, + "-65000": { + "price": "0.0015039278575427963", + "sqrtPriceX96": "3072508448234250573069996845" + }, + "-60000": { + "price": "0.0024794958642899607", + "sqrtPriceX96": "3945129629379410362911094632" + }, + "-55000": { + "price": "0.004087895380218445", + "sqrtPriceX96": "5065583400283854306666498833" + }, + "-50000": { + "price": "0.006739631584098933", + "sqrtPriceX96": "6504256538020985011912221507" + }, + "-45000": { + "price": "0.011111496177027076", + "sqrtPriceX96": "8351526323704020455302062737" + }, + "-40000": { + "price": "0.01831930213861894", + "sqrtPriceX96": "10723438032895153248244559719" + }, + "-35000": { + "price": "0.030202668074516555", + "sqrtPriceX96": "13768994886475031200013793227" + }, + "-30000": { + "price": "0.04979453649036168", + "sqrtPriceX96": "17679518415848078729890725252" + }, + "-25000": { + "price": "0.0820952592059915", + "sqrtPriceX96": "22700667259549727605385594708" + }, + "-20000": { + "price": "0.13534881653941028", + "sqrtPriceX96": "29147869410676662479573841824" + }, + "-15000": { + "price": "0.2231468944223999", + "sqrtPriceX96": "37426137367149455490167040980" + }, + "-10000": { + "price": "0.3678978343771682", + "sqrtPriceX96": "48055510970269007215549348797" + }, + "-5000": { + "price": "0.6065458221578715", + "sqrtPriceX96": "61703726247759831737814779831" + }, + "0": { "price": "1", "sqrtPriceX96": "79228162514264337593543950336" }, + "5000": { + "price": "1.6486800559310761", + "sqrtPriceX96": "101729702841318637793976746270" + }, + "10000": { + "price": "2.718145926824896", + "sqrtPriceX96": "130621891405341611593710811006" + }, + "15000": { + "price": "4.4813529786664965", + "sqrtPriceX96": "167719732170287102368011632179" + }, + "20000": { + "price": "7.388317279514774", + "sqrtPriceX96": "215353707227994575755767921544" + }, + "25000": { + "price": "12.180971345626954", + "sqrtPriceX96": "276516177415270759983386722852" + }, + "30000": { + "price": "20.082524519403083", + "sqrtPriceX96": "355049362077636148767035039534" + }, + "35000": { + "price": "33.109657647886685", + "sqrtPriceX96": "455886706846883518728614478808" + }, + "40000": { + "price": "54.587232222776606", + "sqrtPriceX96": "585362802128485443007867815090" + }, + "45000": { + "price": "89.99688107416998", + "sqrtPriceX96": "751611321342599451347498024762" + }, + "50000": { + "price": "148.37606292298497", + "sqrtPriceX96": "965075977353221155028623082916" + }, + "55000": { + "price": "244.62465571869973", + "sqrtPriceX96": "1239166595309621787903026290373" + }, + "60000": { + "price": "403.3077910724261", + "sqrtPriceX96": "1591101516320542774261326897414" + }, + "65000": { + "price": "664.9255115427262", + "sqrtPriceX96": "2042989251663111899394153092024" + }, + "70000": { + "price": "1096.2494295602612", + "sqrtPriceX96": "2623217336919531037715394526791" + }, + "75000": { + "price": "1807.3645708418217", + "sqrtPriceX96": "3368235633698730256523845479038" + }, + "80000": { + "price": "2979.7659217433397", + "sqrtPriceX96": "4324846105752122384442905378221" + }, + "85000": { + "price": "4912.680646521324", + "sqrtPriceX96": "5553142912955801861254440912313" + }, + "90000": { + "price": "8099.438603078292", + "sqrtPriceX96": "7130287519525136850197316788243" + }, + "95000": { + "price": "13353.382889133434", + "sqrtPriceX96": "9155355968325783751009077503786" + }, + "100000": { + "price": "22015.456048525586", + "sqrtPriceX96": "11755562826496067164730007768450" + }, + "105000": { + "price": "36296.44330943131", + "sqrtPriceX96": "15094252789929177052557648566737" + }, + "110000": { + "price": "59841.222185492355", + "sqrtPriceX96": "19381161978289986732805897287339" + }, + "115000": { + "price": "98659.0295397615", + "sqrtPriceX96": "24885593533939741527740389115814" + }, + "120000": { + "price": "162657.17433971967", + "sqrtPriceX96": "31953335214378312554014683580590" + }, + "125000": { + "price": "268169.63928799983", + "sqrtPriceX96": "41028381739416279140261706159033" + }, + "130000": { + "price": "442125.9359003561", + "sqrtPriceX96": "52680826488428844642796710679847" + }, + "135000": { + "price": "728924.2127287785", + "sqrtPriceX96": "67642674700906461703662565037704" + }, + "140000": { + "price": "1.2017628118111982e+06", + "sqrtPriceX96": "86853827961443433599284932923936" + }, + "145000": { + "price": "1.9813223797927736e+06", + "sqrtPriceX96": "111521128709224793505776342223320" + }, + "150000": { + "price": "3.266566691934243e+06", + "sqrtPriceX96": "143194173941309278083010301478497" + }, + "155000": { + "price": "5.385523356360738e+06", + "sqrtPriceX96": "183862660717832584420084935324936" + }, + "160000": { + "price": "8.879004948382938e+06", + "sqrtPriceX96": "236081378702576292487980732871173" + }, + "165000": { + "price": "1.4638638374912284e+07", + "sqrtPriceX96": "303130701755931019362314154906510" + }, + "170000": { + "price": "2.4134431134705182e+07", + "sqrtPriceX96": "389222660643672570049038195778755" + }, + "175000": { + "price": "3.9789955273030445e+07", + "sqrtPriceX96": "499765542325424914083981603724884" + }, + "180000": { + "price": "6.560090568503485e+07", + "sqrtPriceX96": "641703637919691138772047178820171" + }, + "185000": { + "price": "1.081549048539325e+08", + "sqrtPriceX96": "823953482273555938758881394075740" + }, + "190000": { + "price": "1.7831283458380166e+08", + "sqrtPriceX96": "1057963989656675351166795586135635" + }, + "195000": { + "price": "2.9398081409485084e+08", + "sqrtPriceX96": "1358435673239453248152483143175383" + }, + "200000": { + "price": "4.84680305024562e+08", + "sqrtPriceX96": "1744244129640337381386292603617838" + }, + "205000": { + "price": "7.99082752396586e+08", + "sqrtPriceX96": "2239625801735326192853114508036250" + }, + "210000": { + "price": "1.3174317969147615e+09", + "sqrtPriceX96": "2875700509213056433999819962028363" + }, + "215000": { + "price": "2.172023528622807e+09", + "sqrtPriceX96": "3692426392069901962686080366569818" + }, + "220000": { + "price": "3.580971872653463e+09", + "sqrtPriceX96": "4741110076370692523211601645348446" + }, + "225000": { + "price": "5.903876907293921e+09", + "sqrtPriceX96": "6087629750599555519117063815672534" + }, + "230000": { + "price": "9.733604109727531e+09", + "sqrtPriceX96": "7816573625886694373813086082119774" + }, + "235000": { + "price": "1.604759896803654e+10", + "sqrtPriceX96": "10036553757706764794459542930649328" + }, + "240000": { + "price": "2.645735636418196e+10", + "sqrtPriceX96": "12887029042717028665926882169045829" + }, + "245000": { + "price": "4.3619715770287926e+10", + "sqrtPriceX96": "16547066010612241324949022844924077" + }, + "250000": { + "price": "7.191495543585594e+10", + "sqrtPriceX96": "21246587762933397357449903968194344" + }, + "255000": { + "price": "1.1856475275026782e+11", + "sqrtPriceX96": "27280817715873047538810711452686776" + }, + "260000": { + "price": "1.9547534319576578e+11", + "sqrtPriceX96": "35028825501339668228739965712487798" + }, + "265000": { + "price": "3.222762997531414e+11", + "sqrtPriceX96": "44977340077653786821968777869783664" + }, + "270000": { + "price": "5.313305079022695e+11", + "sqrtPriceX96": "57751325986752080334422645116702725" + }, + "275000": { + "price": "8.759940114862007e+11", + "sqrtPriceX96": "74153243554861758791240311647396006" + }, + "280000": { + "price": "1.4442338558523572e+12", + "sqrtPriceX96": "95213459357937984499883282771742754" + }, + "285000": { + "price": "2.381079554244218e+12", + "sqrtPriceX96": "122254973731507583638964573427678290" + }, + "290000": { + "price": "3.9256383726676987e+12", + "sqrtPriceX96": "156976531499645927268447966600894654" + }, + "295000": { + "price": "6.47212169181496e+12", + "sqrtPriceX96": "201559336929526347482117166840891231" + }, + "300000": { + "price": "1.0670457952854219e+13", + "sqrtPriceX96": "258804076732718222382218977114942914" + }, + "305000": { + "price": "1.7592171214521889e+13", + "sqrtPriceX96": "332306858882422200381867422186318358" + }, + "310000": { + "price": "2.9003861821907016e+13", + "sqrtPriceX96": "426685119702914184511123645165394084" + }, + "315000": { + "price": "4.781808853075886e+13", + "sqrtPriceX96": "547867690688585166931367359489744927" + }, + "320000": { + "price": "7.883672887340867e+13", + "sqrtPriceX96": "703467247016800986108341258316891996" + }, + "325000": { + "price": "1.299765425684345e+14", + "sqrtPriceX96": "903258534927340699419958859999791449" + }, + "330000": { + "price": "2.142897334714545e+14", + "sqrtPriceX96": "1159792420157409690850255072429363291" + }, + "335000": { + "price": "3.53295209765173e+14", + "sqrtPriceX96": "1489184331884319946757643129005007221" + }, + "340000": { + "price": "5.824707661958268e+14", + "sqrtPriceX96": "1912126632133671917217560250559053505" + }, + "345000": { + "price": "9.603079353899524e+14", + "sqrtPriceX96": "2455188507582871229818626656037098209" + }, + "350000": { + "price": "1.583240540629763e+15", + "sqrtPriceX96": "3152485042813632972133852776380996944" + }, + "355000": { + "price": "2.610257103077825e+15", + "sqrtPriceX96": "4047820326003308104366083016009044286" + }, + "360000": { + "price": "4.3034788266968375e+15", + "sqrtPriceX96": "5197439216708175449230827716416006664" + }, + "365000": { + "price": "7.095059712696744e+15", + "sqrtPriceX96": "6673560641474484143071021520368234482" + }, + "370000": { + "price": "1.1697483443963192e+16", + "sqrtPriceX96": "8568914378501321081301555221885198696" + }, + "375000": { + "price": "1.928540765864607e+16", + "sqrtPriceX96": "11002566331646245764580426793204077981" + }, + "380000": { + "price": "3.1795466977310212e+16", + "sqrtPriceX96": "14127398236817014299172024662239546734" + }, + "385000": { + "price": "5.242055227450649e+16", + "sqrtPriceX96": "18139711675045003879447989702764858566" + }, + "390000": { + "price": "8.642471905587126e+16", + "sqrtPriceX96": "23291559715237469085706879691404477959" + }, + "395000": { + "price": "1.4248671064686138e+17", + "sqrtPriceX96": "29906580858988599103287202328564705943" + }, + "400000": { + "price": "2.3491499807870246e+17", + "sqrtPriceX96": "38400329974042030913961448288742562464" + }, + "405000": { + "price": "3.8729967217144384e+17", + "sqrtPriceX96": "49306383403307554262297200203048996400" + }, + "410000": { + "price": "6.385332451777034e+17", + "sqrtPriceX96": "63309858169379220917097088042298610710" + }, + "415000": { + "price": "1.0527370263734276e+18", + "sqrtPriceX96": "81290450947129095256237653735746789690" + }, + "420000": { + "price": "1.7356265395220575e+18", + "sqrtPriceX96": "104377700507686939163380661623514006038" + }, + "425000": { + "price": "2.8614928602546857e+18", + "sqrtPriceX96": "134021945214183297083270512651878387491" + }, + "430000": { + "price": "4.71768620889107e+18", + "sqrtPriceX96": "172085433110980816384931235381244758108" + }, + "435000": { + "price": "7.777955162739797e+18", + "sqrtPriceX96": "220959308131724692997213361822905074757" + }, + "440000": { + "price": "1.282335955273525e+19", + "sqrtPriceX96": "283713821486352459080373031264241921202" + }, + "445000": { + "price": "2.114161714462785e+19", + "sqrtPriceX96": "364291204489125767901577181925742489659" + }, + "450000": { + "price": "3.4855762536478446e+19", + "sqrtPriceX96": "467753319076567190062726668251522605604" + }, + "455000": { + "price": "5.7466000528161595e+19", + "sqrtPriceX96": "600599643392367260634835193162512055576" + }, + "460000": { + "price": "9.474304896490471e+19", + "sqrtPriceX96": "771175568257147901011079136249231048588" + }, + "465000": { + "price": "1.562009752665398e+20", + "sqrtPriceX96": "990196653660372277017949497131126727953" + }, + "470000": { + "price": "2.5752543263892747e+20", + "sqrtPriceX96": "1271421779006950858872394719461240899644" + }, + "475000": { + "price": "4.245770446868215e+20", + "sqrtPriceX96": "1632517474339645648049893615625311991167" + }, + "480000": { + "price": "6.999917057813199e+20", + "sqrtPriceX96": "2096167729725294740976889705764922512181" + }, + "485000": { + "price": "1.1540623646388359e+21", + "sqrtPriceX96": "2691499000902908791307114104105449948197" + }, + "490000": { + "price": "1.902679603880706e+21", + "sqrtPriceX96": "3455909929884624667441737426146628442864" + }, + "495000": { + "price": "3.13690991574496e+21", + "sqrtPriceX96": "4437420723347311369331493986187339833355" + }, + "500000": { + "price": "5.171760815341148e+21", + "sqrtPriceX96": "5697689776495288729098254600827762987878" + }, + "505000": { + "price": "8.526578910298791e+21", + "sqrtPriceX96": "7315887046358403749718629637655614833904" + }, + "510000": { + "price": "1.4057600594732145e+22", + "sqrtPriceX96": "9393667499390740991861318079547018453218" + }, + "515000": { + "price": "2.317648573477972e+22", + "sqrtPriceX96": "12061557064776337394704082380849177813243" + }, + "520000": { + "price": "3.821060979750242e+22", + "sqrtPriceX96": "15487152258294394888329255071253241908376" + }, + "525000": { + "price": "6.299707029810682e+22", + "sqrtPriceX96": "19885648576172520181306842733799508099568" + }, + "530000": { + "price": "1.038620133825767e+23", + "sqrtPriceX96": "25533359051419438094148794646649685772055" + }, + "535000": { + "price": "1.712352300327007e+23", + "sqrtPriceX96": "32785072206791816379478942354475458945684" + }, + "540000": { + "price": "2.823121086276837e+23", + "sqrtPriceX96": "42096339829004992291028993115853611474762" + }, + "545000": { + "price": "4.6544234304230963e+23", + "sqrtPriceX96": "54052094679601168046544724096001822159503" + }, + "550000": { + "price": "7.673655081596861e+23", + "sqrtPriceX96": "69403395903781732924452231135551211990438" + }, + "555000": { + "price": "1.26514020891229e+24", + "sqrtPriceX96": "89114610479562061976335553030114936297180" + }, + "560000": { + "price": "2.0858114303901675e+24", + "sqrtPriceX96": "114423994640460402741395837104087166882101" + }, + "565000": { + "price": "3.4388357057173394e+24", + "sqrtPriceX96": "146921480989729322713481772721905725065288" + }, + "570000": { + "price": "5.669539843639845e+24", + "sqrtPriceX96": "188648557883702813290270392917419831739550" + }, + "575000": { + "price": "9.347257266515605e+24", + "sqrtPriceX96": "242226515495638117341902042043675124960111" + }, + "580000": { + "price": "1.5410636632961106e+25", + "sqrtPriceX96": "311021114963038803895664736054233663131375" + }, + "585000": { + "price": "2.540720926596381e+25", + "sqrtPriceX96": "399354025115362465550351460424401464662021" + }, + "590000": { + "price": "4.1888359193661764e+25", + "sqrtPriceX96": "512774309213039464270167294310485336091735" + }, + "595000": { + "price": "6.906050237826728e+25", + "sqrtPriceX96": "658407016463535962739406229709810159885839" + }, + "600000": { + "price": "1.1385867292362992e+26", + "sqrtPriceX96": "845400776793423922697130608897531771147615" + }, + "605000": { + "price": "1.8771652324396827e+26", + "sqrtPriceX96": "1085502516728581036827722320806083736139447" + }, + "610000": { + "price": "3.0948448804105276e+26", + "sqrtPriceX96": "1393795399968041595485515757166004023752599" + }, + "615000": { + "price": "5.102409030533233e+26", + "sqrtPriceX96": "1789646349993509045317170798974784593155424" + }, + "620000": { + "price": "8.412240005842759e+26", + "sqrtPriceX96": "2297922677975926320156833954766171117185889" + }, + "625000": { + "price": "1.3869092323338475e+27", + "sqrtPriceX96": "2950554244404323059794015567965003225157574" + }, + "630000": { + "price": "2.2865695907354935e+27", + "sqrtPriceX96": "3788539289250867412402444345107863146317886" + }, + "635000": { + "price": "3.7698216807440914e+27", + "sqrtPriceX96": "4864519936692487403821913844237933494349903" + }, + "640000": { + "price": "6.215229819459352e+27", + "sqrtPriceX96": "6246089167299576982712220331495939731184947" + }, + "645000": { + "price": "1.0246925446370736e+28", + "sqrtPriceX96": "8020037001304489746941270643702405325191334" + }, + "650000": { + "price": "1.6893901618044073e+28", + "sqrtPriceX96": "10297802637694577668861263540024626515634267" + }, + "655000": { + "price": "2.7852638664531e+28", + "sqrtPriceX96": "13222475051880785354870422815457829623062935" + }, + "660000": { + "price": "4.592008987126702e+28", + "sqrtPriceX96": "16977781828682505680934521963939399517557292" + }, + "665000": { + "price": "7.570753633732056e+28", + "sqrtPriceX96": "21799630908083389435135719601659270687307112" + }, + "670000": { + "price": "1.2481750524301764e+29", + "sqrtPriceX96": "27990930294899573104484031788436854267502194" + }, + "675000": { + "price": "2.057841315252357e+29", + "sqrtPriceX96": "35940616704817910526951271620129960208436775" + }, + "680000": { + "price": "3.392721934727535e+29", + "sqrtPriceX96": "46148088524160670465339683141260283541684423" + }, + "685000": { + "price": "5.593512989105182e+29", + "sqrtPriceX96": "59254577959100142913580055043258413399365096" + }, + "690000": { + "price": "9.221913307729132e+29", + "sqrtPriceX96": "76083433169130064859988807722972877058836358" + }, + "695000": { + "price": "1.52039845479784e+30", + "sqrtPriceX96": "97691840903787438604328293727903501357729621" + }, + "700000": { + "price": "2.5066506094936243e+30", + "sqrtPriceX96": "125437238852717229072740403726643244412679815" + }, + "705000": { + "price": "4.1326648670596145e+30", + "sqrtPriceX96": "161062589725275799126473448008900594635711618" + }, + "710000": { + "price": "6.813442144168239e+30", + "sqrtPriceX96": "206805873967550095555809556995222187376046560" + }, + "715000": { + "price": "1.1233186175330442e+31", + "sqrtPriceX96": "265540679436687720339747256538743319150092229" + }, + "720000": { + "price": "1.8519930011827984e+31", + "sqrtPriceX96": "340956719859716178611573120889198386200441263" + }, + "725000": { + "price": "3.0533439247740174e+31", + "sqrtPriceX96": "437791622225680726329615245898001371601206503" + }, + "730000": { + "price": "5.033987232673238e+31", + "sqrtPriceX96": "562128543968427097663001898986044257368067477" + }, + "735000": { + "price": "8.299434352320036e+31", + "sqrtPriceX96": "721778316217235473060325426882835333378340086" + }, + "740000": { + "price": "1.3683111892179292e+32", + "sqrtPriceX96": "926770119310376785198304649622188248161304747" + }, + "745000": { + "price": "2.2559073679709326e+32", + "sqrtPriceX96": "1189981514750941650777596882918999279836088489" + }, + "750000": { + "price": "3.719269485601644e+32", + "sqrtPriceX96": "1527947412139974439408748016788501500435754646" + }, + "755000": { + "price": "6.1318854235444634e+32", + "sqrtPriceX96": "1961898790296647744947311168026907141648217794" + }, + "760000": { + "price": "1.0109517203052237e+33", + "sqrtPriceX96": "2519096424906828333913936072626735930310118054" + }, + "765000": { + "price": "1.6667359387764338e+33", + "sqrtPriceX96": "3234543407317583286442536745637311652163878750" + }, + "770000": { + "price": "2.7479143007642655e+33", + "sqrtPriceX96": "4153184034711414659663252231388279002886517661" + }, + "775000": { + "price": "4.5304315030778334e+33", + "sqrtPriceX96": "5332727205688169061864209565983025485696022050" + }, + "780000": { + "price": "7.469232063886272e+33", + "sqrtPriceX96": "6847271686640481370151807489039305675330440373" + }, + "785000": { + "price": "1.2314373936850206e+34", + "sqrtPriceX96": "8791960987739673241738312009932297000045451651" + }, + "790000": { + "price": "2.0302462710962383e+34", + "sqrtPriceX96": "11288960267306385073229935611571957154358555635" + }, + "795000": { + "price": "3.347226535784805e+34", + "sqrtPriceX96": "14495130733011359845175822750945104579138192055" + }, + "800000": { + "price": "5.518505632231674e+34", + "sqrtPriceX96": "18611883644907511909590774894315720731532604461" + }, + "805000": { + "price": "9.098250174403675e+34", + "sqrtPriceX96": "23897832947630873581331894889511233889674657011" + }, + "810000": { + "price": "1.5000103606410775e+35", + "sqrtPriceX96": "30685041368670652282304191306229548749626859800" + }, + "815000": { + "price": "2.4730371652789254e+35", + "sqrtPriceX96": "39399880560733963763251813129613389581737194025" + }, + "820000": { + "price": "4.0772470519716886e+35", + "sqrtPriceX96": "50589815719950373294249895433604285090202329406" + }, + "825000": { + "price": "6.722075897689498e+35", + "sqrtPriceX96": "64957797286552516322064986511682478264350247398" + }, + "830000": { + "price": "1.1082552466975661e+36", + "sqrtPriceX96": "83406420210715656628405067706917970517948077569" + }, + "835000": { + "price": "1.827158322111252e+36", + "sqrtPriceX96": "107094624863559380252003088212018546676012845552" + }, + "840000": { + "price": "3.01239948469331e+36", + "sqrtPriceX96": "137510501538021837891384467161248967591254290372" + }, + "845000": { + "price": "4.9664829509109115e+36", + "sqrtPriceX96": "176564772109981366260049165595105288361353148930" + }, + "850000": { + "price": "8.188141389288537e+36", + "sqrtPriceX96": "226710821366829875387493445330895341819225487643" + }, + "855000": { + "price": "1.3499625403663785e+37", + "sqrtPriceX96": "291098818357759382535399349011119045382109209812" + }, + "860000": { + "price": "2.225656316556099e+37", + "sqrtPriceX96": "373773609651267877702319363120376684510538270237" + }, + "865000": { + "price": "3.6693951804630617e+37", + "sqrtPriceX96": "479928816131569914696138914848875449452242960268" + }, + "870000": { + "price": "6.049658651359061e+37", + "sqrtPriceX96": "616233095665449784060622916635049098175242748173" + }, + "875000": { + "price": "9.973951563686577e+37", + "sqrtPriceX96": "791249067422779658938554157497828940405764481749" + }, + "880000": { + "price": "1.6443855021872629e+38", + "sqrtPriceX96": "1015971214628355338719976056448214614983598369636" + }, + "885000": { + "price": "2.7110655817183473e+38", + "sqrtPriceX96": "1304516556734079035666525303464462732999888307147" + } +} diff --git a/packages/web/src/utils/swap-utils.spec.ts b/packages/web/src/utils/swap-utils.spec.ts index 3a010f3de..eb9545eed 100644 --- a/packages/web/src/utils/swap-utils.spec.ts +++ b/packages/web/src/utils/swap-utils.spec.ts @@ -18,6 +18,36 @@ describe("tick convert to price", () => { expect(tickToPrice(tick)).toBe(1.6487624878732252); }); + test("100000 to 148.3760629230746", () => { + const tick = 100000; + expect(tickToPrice(tick)).toBe(148.3760629230746); + }); +}); + +describe("tick convert to sqrtPriceX96", () => { + test("-5120 to 61334630738499455555414115609", () => { + const tick = -5120; + expect(tickToSqrtPriceX96(tick).toString()).toBe( + "61334630738499455555414115609", + ); + }); + + test("10000 to 1.6486800559311758", () => { + const tick = 10000; + expect(tickToPrice(tick)).toBe(1.6486800559311758); + }); + + test("10001 to 1.6487624878732252", () => { + const tick = 10001; + expect(tickToPrice(tick)).toBe(1.6487624878732252); + }); + + test("100000 to 148.3760629230746", () => { + const tick = 100000; + console.log(tickToPrice(tick)); + expect(tickToPrice(tick)).toBe(148.3760629230746); + }); + test("100000 to 148.3760629230746", () => { const tick = 100000; console.log(tickToPrice(tick));