Skip to content

Commit 0d5ac85

Browse files
committed
chore: disable deposits to rune pools
1 parent d72433e commit 0d5ac85

2 files changed

Lines changed: 59 additions & 5 deletions

File tree

apps/frontend/src/app/5_pages/MarketMakingPage/components/PoolsTable/PoolsTable.constants.tsx

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import React from 'react';
22

3+
import classNames from 'classnames';
34
import { t } from 'i18next';
45

56
import { ChainIds } from '@sovryn/ethers-provider';
67
import { HelperButton } from '@sovryn/ui';
78

89
import { AssetPairRenderer } from '../../../../2_molecules/AssetPairRenderer/AssetPairRenderer';
10+
import { DeprecatedBadge } from '../../../../2_molecules/DeprecatedBadge/DeprecatedBadge';
11+
import { getRskDeprecatedAssetTooltips } from '../../../../../constants/tokens';
912
import { translations } from '../../../../../locales/i18n';
13+
import { findAsset } from '../../../../../utils/asset';
1014
import { AmmLiquidityPool } from '../../utils/AmmLiquidityPool';
1115
import { BlockedPoolConfig } from './PoolsTable.types';
1216
import { CurrentBalanceRenderer } from './components/CurrentBalanceRenderer/CurrentBalanceRenderer';
@@ -19,11 +23,35 @@ export const COLUMNS_CONFIG = [
1923
{
2024
id: 'pair',
2125
title: t(translations.marketMakingPage.poolsTable.pair),
22-
cellRenderer: (pool: AmmLiquidityPool) => (
23-
<div data-pool-key={pool.key}>
24-
<AssetPairRenderer asset1={pool.assetA} asset2={pool.assetB} />
25-
</div>
26-
),
26+
cellRenderer: (pool: AmmLiquidityPool) => {
27+
const isDeprecated =
28+
!!getRskDeprecatedAssetTooltips(pool.assetA) ||
29+
!!getRskDeprecatedAssetTooltips(pool.assetB);
30+
return (
31+
<div
32+
data-pool-key={pool.key}
33+
className="inline-flex items-center gap-2"
34+
>
35+
<AssetPairRenderer
36+
asset1={pool.assetA}
37+
asset2={pool.assetB}
38+
chainId={pool.chainId}
39+
hideSymbol
40+
/>
41+
<div
42+
className={classNames('flex flex-col gap-1 font-medium text-xs', {
43+
'text-gray-40': isDeprecated,
44+
})}
45+
>
46+
<span>
47+
{findAsset(pool.assetA, pool.chainId)?.symbol}/
48+
{findAsset(pool.assetB, pool.chainId)?.symbol}
49+
</span>
50+
{isDeprecated && <DeprecatedBadge />}
51+
</div>
52+
</div>
53+
);
54+
},
2755
className: 'hidden lg:block',
2856
},
2957
{
@@ -86,4 +114,12 @@ export const BLOCKED_POOLS: BlockedPoolConfig[] = [
86114
chainId: ChainIds.RSK_TESTNET,
87115
message: 'SOV pool deposits are under maintenance for testing purposes',
88116
},
117+
{
118+
poolAssetA: 'POWA',
119+
poolAssetB: 'BTC',
120+
chainId: ChainIds.RSK_MAINNET,
121+
message: t(
122+
translations.marketMakingPage.marketMakingOperations.depositNotAllowed,
123+
),
124+
},
89125
];

apps/frontend/src/constants/tokens.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,22 @@ export const getBobDeprecatedAssetTooltips = (asset: string) => {
3838
),
3939
};
4040
}
41+
42+
if (
43+
['POWA', 'DOGGOTOTHEMOON', 'PUPSWORLDPEACE'].includes(asset.toUpperCase())
44+
) {
45+
return {
46+
pool: 'Will be removed soon',
47+
convert: 'Convert',
48+
};
49+
}
50+
};
51+
52+
export const getRskDeprecatedAssetTooltips = (asset: string) => {
53+
if (['POWA'].includes(asset.toUpperCase())) {
54+
return {
55+
pool: 'Will be removed soon',
56+
convert: 'Convert',
57+
};
58+
}
4159
};

0 commit comments

Comments
 (0)