From 72cd9d3a6d765b3786818e462e2c2cd709676f3a Mon Sep 17 00:00:00 2001 From: xieqian Date: Sun, 21 Jan 2024 18:52:06 +0800 Subject: [PATCH] add stable pool config --- screens/TokenDetail/index.tsx | 11 +++++++---- utils/config.ts | 11 +++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/screens/TokenDetail/index.tsx b/screens/TokenDetail/index.tsx index 84b1f609..4171a9fd 100644 --- a/screens/TokenDetail/index.tsx +++ b/screens/TokenDetail/index.tsx @@ -50,7 +50,7 @@ import { ConnectWalletButton } from "../../components/Header/WalletButton"; import { OuterLinkConfig } from "./config"; import { APYCell } from "../Market/APYCell"; import { RewardsV2 } from "../../components/Rewards"; -import getConfig, { DEFAULT_POSITION, lpTokenPrefix } from "../../utils/config"; +import getConfig, { DEFAULT_POSITION, lpTokenPrefix, STABLE_POOL_IDS } from "../../utils/config"; import InterestRateChart, { LabelText } from "./interestRateChart"; import TokenBorrowSuppliesChart from "./tokenBorrowSuppliesChart"; import { useTokenDetails } from "../../hooks/useTokenDetails"; @@ -1268,9 +1268,12 @@ function OuterLink() { className="lg:opacity-60 lg:hover:opacity-100" onClick={() => { const pool_id = tokenId.split("-")[1]; - // TODO need to judge is or not stable pool - window.open(`https://app.ref.finance/pool/${pool_id}`); - // window.open(`https://app.ref.finance/sauce/${pool_id}`); + const is_stable_pool = STABLE_POOL_IDS.includes(pool_id); + if (is_stable_pool) { + window.open(`https://app.ref.finance/sauce/${pool_id}`); + } else { + window.open(`https://app.ref.finance/pool/${pool_id}`); + } }} /> diff --git a/utils/config.ts b/utils/config.ts index 4f6e0505..4c503b26 100644 --- a/utils/config.ts +++ b/utils/config.ts @@ -12,6 +12,17 @@ export const defaultNetwork = (process.env.NEXT_PUBLIC_DEFAULT_NETWORK || const META_TOKEN = { testnet: undefined, mainnet: "meta-token.near" }; const REF_TOKEN = { testnet: "ref.fakes.testnet", mainnet: "token.v2.ref-finance.near" }; +export const STABLE_POOL_IDS = [ + "4179", + "3514", + "3515", + "1910", + "3020", + "3364", + "3688", + "3433", + "3689", +]; export const DEFAULT_POSITION = "REGULAR"; export const BRRR_TOKEN = { testnet: "test_brrr.1638481328.burrow.testnet",