From 81b443889f794da1d9b3b7e54d52465a312c2eaf Mon Sep 17 00:00:00 2001
From: Joe Zhu <aidai524@gmail.com>
Date: Fri, 23 Feb 2024 15:40:04 +0800
Subject: [PATCH] Remove usn near x pool (#477)

* Remove Usn NearX pool

* filter usn and nearx token in pool list only for display

---------

Co-authored-by: lq0-github <1441665200@qq.com>
Co-authored-by: xieqian <dss@192.168.0.100>
---
 src/pages/pools/LiquidityPage/LiquidityPage.tsx    | 13 ++++++++++---
 src/pages/pools/poolsComponents/StablePoolList.tsx |  7 +++++--
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/pages/pools/LiquidityPage/LiquidityPage.tsx b/src/pages/pools/LiquidityPage/LiquidityPage.tsx
index d6337e0ca..cc300122e 100644
--- a/src/pages/pools/LiquidityPage/LiquidityPage.tsx
+++ b/src/pages/pools/LiquidityPage/LiquidityPage.tsx
@@ -153,6 +153,7 @@ import {
 const HIDE_LOW_TVL = 'REF_FI_HIDE_LOW_TVL';
 
 const REF_FI_FARM_ONLY = 'REF_FI_FARM_ONLY';
+export const BLACK_TOKEN_IDS_IN_POOL = ['usn', 'v2-nearx.stader-labs.near'];
 export function getPoolFeeAprTitle(
   dayVolume: string,
   pool: Pool,
@@ -1786,6 +1787,11 @@ export default function LiquidityPage() {
     if (farmOnly) {
       tempPools = _.filter(tempPools, (pool) => !!farmCounts[pool.id]);
     }
+    tempPools = _.filter(tempPools, (pool) =>
+      pool?.tokenIds?.every(
+        (tokenId) => !BLACK_TOKEN_IDS_IN_POOL.includes(tokenId)
+      )
+    );
     setDisplayPools(tempPools);
   }, [pools, hideLowTVL, farmOnly, farmCounts]);
   const poolTokenMetas = usePoolTokens(pools);
@@ -2622,11 +2628,12 @@ function StablePoolList({
 
   const [clicked, setClicked] = useState<boolean>(false);
 
-  const allStablePoolData = useAllStablePoolData();
-
+  let allStablePoolData = useAllStablePoolData();
   if (!allStablePoolData || allStablePoolData.some((pd) => !pd))
     return <Loading />;
-
+  allStablePoolData = _.filter(allStablePoolData, (pool) =>
+    pool?.tokens?.every((token) => !BLACK_TOKEN_IDS_IN_POOL.includes(token.id))
+  );
   const filterFunc = (p: PoolData) => {
     const b1 =
       option === 'ALL'
diff --git a/src/pages/pools/poolsComponents/StablePoolList.tsx b/src/pages/pools/poolsComponents/StablePoolList.tsx
index aac2352a2..9f953082b 100644
--- a/src/pages/pools/poolsComponents/StablePoolList.tsx
+++ b/src/pages/pools/poolsComponents/StablePoolList.tsx
@@ -44,6 +44,7 @@ import BigNumber from 'bignumber.js';
 import { Cell, Pie, PieChart, Sector } from 'recharts';
 import getConfig from 'src/services/config';
 import Big from 'big.js';
+import { BLACK_TOKEN_IDS_IN_POOL } from '../LiquidityPage/LiquidityPage';
 
 function StablePoolList({
   searchBy,
@@ -66,11 +67,13 @@ function StablePoolList({
 
   const [clicked, setClicked] = useState<boolean>(false);
 
-  const allStablePoolData = useAllStablePoolData();
+  let allStablePoolData = useAllStablePoolData();
 
   if (!allStablePoolData || allStablePoolData.some((pd) => !pd))
     return <Loading />;
-
+  allStablePoolData = _.filter(allStablePoolData, (pool) =>
+    pool?.tokens?.every((token) => !BLACK_TOKEN_IDS_IN_POOL.includes(token.id))
+  );
   const filterFunc = (p: PoolData) => {
     const b1 =
       option === 'ALL'