From 5f000110943ab6dd85f0314cec609fe18370ce71 Mon Sep 17 00:00:00 2001 From: Pietro <74987028+pietro-maximoff@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:55:54 +0200 Subject: [PATCH 1/8] Portfolio page in D2 on RSK fix (#1002) * chore: fix issue with decimalish value * chore: add support for the RSK chain in the CHAIN_SPECS object * Create real-ghosts-judge.md * chore: update changeset --------- Co-authored-by: soulBit --- .changeset/real-ghosts-judge.md | 6 +++ .../src/hooks/useGetNativeTokenPrice.ts | 11 ++--- packages/sdex/src/constants.ts | 46 +++++++++++++++++++ 3 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 .changeset/real-ghosts-judge.md diff --git a/.changeset/real-ghosts-judge.md b/.changeset/real-ghosts-judge.md new file mode 100644 index 000000000..481beea44 --- /dev/null +++ b/.changeset/real-ghosts-judge.md @@ -0,0 +1,6 @@ +--- +"frontend": patch +"@sovryn/sdex": patch +--- + +SOV-4453: Fixed issue with Portfolio page crashing on RSK chain diff --git a/apps/frontend/src/hooks/useGetNativeTokenPrice.ts b/apps/frontend/src/hooks/useGetNativeTokenPrice.ts index b7d9e78b0..49ba66e49 100644 --- a/apps/frontend/src/hooks/useGetNativeTokenPrice.ts +++ b/apps/frontend/src/hooks/useGetNativeTokenPrice.ts @@ -26,8 +26,7 @@ export const useGetNativeTokenPrice = () => { }); const price = data?.data[0]?.usdPrice as string; - - return price; + return price ?? '0'; }, [currentChainId], ); @@ -37,10 +36,10 @@ export const useGetNativeTokenPrice = () => { toWei(1).toString(), ); - const price = useMemo( - () => (isRskChain(currentChainId) ? rBTCPrice : ethPrice), - [currentChainId, ethPrice, rBTCPrice], - ); + const price = useMemo(() => { + const nativePrice = isRskChain(currentChainId) ? rBTCPrice : ethPrice; + return nativePrice || '0'; + }, [currentChainId, ethPrice, rBTCPrice]); const nativeToken = useMemo( () => (isRskChain(currentChainId) ? BITCOIN : ETH), diff --git a/packages/sdex/src/constants.ts b/packages/sdex/src/constants.ts index c31b5318e..4810d4fbb 100644 --- a/packages/sdex/src/constants.ts +++ b/packages/sdex/src/constants.ts @@ -136,12 +136,58 @@ const LOCAL_FORK_CHAIN: ChainSpec = Object.assign({}, SEPOLIA_CHAIN, { displayName: 'Local Fork', }); +const RSK_MAINNET: ChainSpec = { + nodeUrl: 'https://public-node.rsk.co', + addrs: { + dex: '', + query: '', + impact: '', + router: '', + routerBypass: '', + }, + poolIndex: 0, + isTestNet: false, + chainId: '0x1e', // 30 in decimal + gridSize: 0, + proxyPaths: { + cold: 0, + long: 0, + liq: 0, + dfltColdSwap: true, + }, + displayName: 'RSK Mainnet', +}; + +const RSK_TESTNET: ChainSpec = { + nodeUrl: 'https://public-node.testnet.rsk.co', + addrs: { + dex: '', + query: '', + impact: '', + router: '', + routerBypass: '', + }, + poolIndex: 0, + isTestNet: true, + chainId: '0x1f', // 31 in decimal + gridSize: 0, + proxyPaths: { + cold: 0, + long: 0, + liq: 0, + }, + blockExplorer: 'https://explorer.testnet.rsk.co', + displayName: 'RSK Testnet', +}; + export const CHAIN_SPECS: { [chainId: string]: ChainSpec } = { '0xed88': BOB_CHAIN, '0xc576d': BOB_TESTNET_CHAIN, '0x7a69': LOCAL_FORK_CHAIN, '0xaa36a7': SEPOLIA_CHAIN, '0x1b669': TENDERLY_FORK, + '0x1e': RSK_MAINNET, + '0x1f': RSK_TESTNET, sepolia: SEPOLIA_CHAIN, local: LOCAL_FORK_CHAIN, bob: BOB_CHAIN, From 04f2b6f46fae8c5e94ad288cc0cec40684d77c03 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 12:59:25 +0100 Subject: [PATCH 2/8] Version Packages (#1005) Co-authored-by: github-actions[bot] --- .changeset/real-ghosts-judge.md | 6 ------ apps/frontend/CHANGELOG.md | 8 ++++++++ apps/frontend/package.json | 2 +- packages/sdex/CHANGELOG.md | 6 ++++++ packages/sdex/package.json | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 .changeset/real-ghosts-judge.md diff --git a/.changeset/real-ghosts-judge.md b/.changeset/real-ghosts-judge.md deleted file mode 100644 index 481beea44..000000000 --- a/.changeset/real-ghosts-judge.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"frontend": patch -"@sovryn/sdex": patch ---- - -SOV-4453: Fixed issue with Portfolio page crashing on RSK chain diff --git a/apps/frontend/CHANGELOG.md b/apps/frontend/CHANGELOG.md index d66c33508..0c1fb7857 100644 --- a/apps/frontend/CHANGELOG.md +++ b/apps/frontend/CHANGELOG.md @@ -1,5 +1,13 @@ # frontend +## 1.1.21 + +### Patch Changes + +- 5f000110: SOV-4453: Fixed issue with Portfolio page crashing on RSK chain +- Updated dependencies [5f000110] + - @sovryn/sdex@0.3.14 + ## 1.1.20 ### Patch Changes diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 2d59dbed8..1c39a248a 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "1.1.20", + "version": "1.1.21", "homepage": ".", "private": true, "dependencies": { diff --git a/packages/sdex/CHANGELOG.md b/packages/sdex/CHANGELOG.md index 8c3371b52..7dbd70102 100644 --- a/packages/sdex/CHANGELOG.md +++ b/packages/sdex/CHANGELOG.md @@ -1,5 +1,11 @@ # @sovryn/sdex +## 0.3.14 + +### Patch Changes + +- 5f000110: SOV-4453: Fixed issue with Portfolio page crashing on RSK chain + ## 0.3.13 ### Patch Changes diff --git a/packages/sdex/package.json b/packages/sdex/package.json index 391833f55..27f896cc0 100644 --- a/packages/sdex/package.json +++ b/packages/sdex/package.json @@ -1,6 +1,6 @@ { "name": "@sovryn/sdex", - "version": "0.3.13", + "version": "0.3.14", "description": "🛠🐊🛠 An SDK for building applications on top of Sovryn dex", "repository": "https://github.com/DistributedCollective/sovryn-dapp.git", "license": "MIT", From ef2f1abee5f4240ec75c904d219667be3271815b Mon Sep 17 00:00:00 2001 From: Victor Creed <69458664+creed-victor@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:22:45 +0300 Subject: [PATCH 3/8] SOV-4457: rebrand SAT token (#1006) * feat: rebrand SAT token * chore: remove $ sign --- .changeset/green-forks-rule.md | 8 ++++++++ .../AmbientMarketMaking/utils/pools/bobMainnet.ts | 4 ++-- packages/contracts/src/contracts/assets/bob.ts | 2 +- .../sdk/src/swaps/smart-router/utils/ambient-utils.ts | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 .changeset/green-forks-rule.md diff --git a/.changeset/green-forks-rule.md b/.changeset/green-forks-rule.md new file mode 100644 index 000000000..3cb6e25a7 --- /dev/null +++ b/.changeset/green-forks-rule.md @@ -0,0 +1,8 @@ +--- +'frontend': patch +'@sovryn/contracts': patch +'@sovryn/sdk': patch +--- + +SOV-4457: rebrand SAT token + diff --git a/apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/utils/pools/bobMainnet.ts b/apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/utils/pools/bobMainnet.ts index b1df62569..d8419ad7a 100644 --- a/apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/utils/pools/bobMainnet.ts +++ b/apps/frontend/src/app/5_pages/MarketMakingPage/components/AmbientMarketMaking/utils/pools/bobMainnet.ts @@ -96,14 +96,14 @@ export const bobMainnet: AmbientLiquidityPool[] = [ ), new AmbientLiquidityPool( 'WBTC', - 'SAT', + 'satUSD', ChainIds.BOB_MAINNET, 410, '0x9C82eF04eC7FEB9E07a9f2Be23cc180753CE4612', ), new AmbientLiquidityPool( 'USDT', - 'SAT', + 'satUSD', ChainIds.BOB_MAINNET, 400, '0x8C6a57d16B1ddAD730Fee27822284d085C106DbB', diff --git a/packages/contracts/src/contracts/assets/bob.ts b/packages/contracts/src/contracts/assets/bob.ts index 77a088768..21c595d84 100644 --- a/packages/contracts/src/contracts/assets/bob.ts +++ b/packages/contracts/src/contracts/assets/bob.ts @@ -83,7 +83,7 @@ export const bob: Array = [ getIcon: async () => (await import('./icons/bob/powa')).default, }, { - symbol: 'SAT', + symbol: 'satUSD', address: '0x78fea795cbfcc5ffd6fb5b845a4f53d25c283bdb', name: 'Satoshi Stablecoin', decimals: 18, diff --git a/packages/sdk/src/swaps/smart-router/utils/ambient-utils.ts b/packages/sdk/src/swaps/smart-router/utils/ambient-utils.ts index 5d7848aeb..90ff0c96a 100644 --- a/packages/sdk/src/swaps/smart-router/utils/ambient-utils.ts +++ b/packages/sdk/src/swaps/smart-router/utils/ambient-utils.ts @@ -195,8 +195,8 @@ const POOLS: Partial> = { ['TBTC', 'SOV', 410], ['TBTC', 'WBTC', 400], ['POWA', 'SOV', 420], - ['WBTC', 'SAT', 410], - ['USDT', 'SAT', 400], + ['WBTC', 'satUSD', 410], + ['USDT', 'satUSD', 400], ], [ChainIds.BOB_TESTNET]: [ ['USDC', 'USDT', 36000], From c20bcb3baeaf6f46f6543e4241df505d99e80830 Mon Sep 17 00:00:00 2001 From: Rick <81699526+rick23p@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:58:23 +0330 Subject: [PATCH 4/8] SOV-4443: Rune Pools Market Making updates (#1013) * feat: rune pool page update * Create honest-fans-fly.md * fix: rename pools prop * Hide highlighted pairs functionality --------- Co-authored-by: Peiman <25097709+Rickk137@users.noreply.github.com> Co-authored-by: tiltom --- .changeset/honest-fans-fly.md | 5 +++++ .../MarketMakingPage.constants.ts | 2 ++ .../components/MarketMaking/MarketMaking.tsx | 19 +++++++++++++++++++ .../components/PoolsTable/PoolsTable.tsx | 16 ++++++++++++---- .../utils/AmmLiquidityPool.ts | 2 ++ .../frontend/src/locales/en/translations.json | 2 ++ 6 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 .changeset/honest-fans-fly.md diff --git a/.changeset/honest-fans-fly.md b/.changeset/honest-fans-fly.md new file mode 100644 index 000000000..8869ca101 --- /dev/null +++ b/.changeset/honest-fans-fly.md @@ -0,0 +1,5 @@ +--- +"frontend": patch +--- + +SOV-4443: rune pool page update diff --git a/apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.constants.ts b/apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.constants.ts index b5edb18dc..a299ca2da 100644 --- a/apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.constants.ts +++ b/apps/frontend/src/app/5_pages/MarketMakingPage/MarketMakingPage.constants.ts @@ -146,6 +146,8 @@ export const TESTNET_AMM = [ ChainIds.RSK_TESTNET, '0x5fc0b3ac4683bd8af8e244e646d897a2c3f2a6ac', '0x64B1aC8301f64c92721804ed78f2ee6025aaf7cE', + // undefined, + // true, ), new AmmLiquidityPool( COMMON_SYMBOLS.SOV, diff --git a/apps/frontend/src/app/5_pages/MarketMakingPage/components/MarketMaking/MarketMaking.tsx b/apps/frontend/src/app/5_pages/MarketMakingPage/components/MarketMaking/MarketMaking.tsx index 936a9d2ce..2b4b19630 100644 --- a/apps/frontend/src/app/5_pages/MarketMakingPage/components/MarketMaking/MarketMaking.tsx +++ b/apps/frontend/src/app/5_pages/MarketMakingPage/components/MarketMaking/MarketMaking.tsx @@ -59,6 +59,25 @@ export const MarketMaking: FC = () => { onClick={setIsPromoCardClicked} /> + {/* + {t(translations.marketMakingPage.newPairs)} + + + + + {t(translations.marketMakingPage.allPairs)} + */} void; shouldScroll?: boolean; + showHighlightedPools?: boolean; }; export const PoolsTable: FC = ({ activePool, setActivePool, shouldScroll = false, + showHighlightedPools, }) => { const navigate = useNavigate(); const { account } = useAccount(); const tableRef = useRef(null); + const pools = useMemo( + () => + ammPools.filter(pool => pool.isHighlighted === !!showHighlightedPools), + [showHighlightedPools], + ); + const expandedIndex = useMemo( - () => ammPools.findIndex(pool => pool.key === activePool), - [activePool], + () => pools.findIndex(pool => pool.key === activePool), + [activePool, pools], ); const generateRowTitle = useCallback( @@ -95,7 +103,7 @@ export const PoolsTable: FC = ({ }, [activePool, shouldScroll]); return ( -
+
{account && (