From 4c7ca907a3d84c5a147ccff705a62e37d4c660df Mon Sep 17 00:00:00 2001 From: franm Date: Fri, 18 Jul 2025 09:45:28 -0300 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=A5=20app:=20remove=20extra=20stra?= =?UTF-8?q?tegy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hooks/useExtra.ts | 27 --------------------------- pages/strategies.tsx | 39 +-------------------------------------- 2 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 hooks/useExtra.ts diff --git a/hooks/useExtra.ts b/hooks/useExtra.ts deleted file mode 100644 index 69c19d4d2..000000000 --- a/hooks/useExtra.ts +++ /dev/null @@ -1,27 +0,0 @@ -import WAD from '@exactly/lib/esm/fixed-point-math/WAD'; -import { useExtraFinanceLendingGetReserveStatus } from 'types/abi'; -import { aprToAPY, toPercentage } from 'utils/utils'; -import { optimism } from 'wagmi/chains'; - -const EXA_RESERVE_ID = 50n; -const COMPOUNDING_INTERVAL = 60n * 60n * 24n; -const LENDING_CONTRACT_ADDRESS = '0xBB505c54D71E9e599cB8435b4F0cEEc05fC71cbD'; - -export const useExtraDepositAPR = () => { - const { data: reserves } = useExtraFinanceLendingGetReserveStatus({ - args: [[EXA_RESERVE_ID]], - address: LENDING_CONTRACT_ADDRESS, - chainId: optimism.id, - }); - if (!reserves) return undefined; - const [{ borrowingRate, totalBorrows, totalLiquidity }] = reserves; - const utilizationRate = (totalBorrows * WAD) / totalLiquidity; - return (borrowingRate * utilizationRate) / WAD; -}; - -export const useExtra = () => { - const apr = useExtraDepositAPR(); - if (!apr) return { apr: undefined, apy: undefined }; - const apy = aprToAPY(apr, COMPOUNDING_INTERVAL); - return { apr: toPercentage(Number(apr) / 1e18), apy: toPercentage(Number(apy) / 1e18) }; -}; diff --git a/pages/strategies.tsx b/pages/strategies.tsx index b0787cd73..d3caf40d6 100644 --- a/pages/strategies.tsx +++ b/pages/strategies.tsx @@ -19,7 +19,6 @@ import useFloatingPoolAPR from 'hooks/useFloatingPoolAPR'; import useRewards from 'hooks/useRewards'; import { parseEther } from 'viem'; import { useVELOPoolAPR } from 'hooks/useVELO'; -import { useExtraDepositAPR } from 'hooks/useExtra'; import { useWeb3 } from 'hooks/useWeb3'; import FeaturedStrategies from 'components/strategies/FeaturedStrategies'; import { useModal } from '../contexts/ModalContext'; @@ -71,7 +70,6 @@ const Strategies: NextPage = () => { }, [getMarketAccount, rates, usdcDepositAPR]); const veloRate = useVELOPoolAPR() ?? '0%'; - const extraRate = useExtraDepositAPR(); const featured: (Strategy & { chainId?: number })[] = useMemo( () => @@ -470,43 +468,8 @@ const Strategies: NextPage = () => { ), imgPath: '/img/assets/VELO.svg', }, - { - chainId: optimism.id, - title: t('Deposit EXA on Extra Finance'), - description: t('Deposit EXA on Extra Finance and earn interest on it.'), - tags: [ - ...(extraRate && extraRate > 10n ** 16n - ? [{ prefix: t('up to'), text: `${toPercentage(Number(extraRate ?? 0) / 1e18)} APR` }] - : []), - { text: t('Basic'), size: 'small' as const }, - ], - button: ( - - - - ), - imgPath: '/img/assets/EXTRA.svg', - }, ].filter((s) => s.chainId === chain.id || s.chainId === undefined), - [chain.id, extraRate, query, t, veloRate], + [chain.id, query, t, veloRate], ); return ( From 2978e2fd84a21c4eae3b1764062775b6f1dd0f21 Mon Sep 17 00:00:00 2001 From: franm Date: Fri, 18 Jul 2025 09:47:32 -0300 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=92=84=20app:=20hide=20frozen=20marke?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Footer/index.tsx | 2 +- components/markets/MarketsTables/index.tsx | 7 ++++++- components/markets/MarketsTables/poolTable/index.tsx | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx index f1955b8ff..fea233a80 100644 --- a/components/Footer/index.tsx +++ b/components/Footer/index.tsx @@ -26,7 +26,7 @@ const Footer = () => { padding: '16px 0px', color: 'figma.grey.300', fontWeight: '500', - mt: 8, + mt: 4, }} > Exactly Protocol © {date.getFullYear()} diff --git a/components/markets/MarketsTables/index.tsx b/components/markets/MarketsTables/index.tsx index 37db171d9..57e7d1735 100644 --- a/components/markets/MarketsTables/index.tsx +++ b/components/markets/MarketsTables/index.tsx @@ -219,7 +219,12 @@ const MarketTables: FC = () => { ), ); - setRows(sortByDefault(defaultRows, tempRows)); + setRows( + sortByDefault( + defaultRows, + tempRows.filter((row) => row.symbol !== 'USDC.e'), + ), + ); setIsLoading(false); }, [accountData, chain, defaultRows, rates, setIndexerError]); diff --git a/components/markets/MarketsTables/poolTable/index.tsx b/components/markets/MarketsTables/poolTable/index.tsx index a7a98d8ff..71445fa4f 100644 --- a/components/markets/MarketsTables/poolTable/index.tsx +++ b/components/markets/MarketsTables/poolTable/index.tsx @@ -53,7 +53,10 @@ const PoolTable: FC = ({ isLoading, headers, rows }) => { const { handleActionClick, isDisable } = useActionButton(); const assets = useAssets(); const { palette } = useTheme(); - const defaultRows = useMemo(() => assets.map((s) => ({ symbol: s })), [assets]); + const defaultRows = useMemo( + () => assets.filter((s) => s !== 'USDC.e').map((s) => ({ symbol: s })), + [assets], + ); const { setOrderBy, sortData, direction: sortDirection, isActive: sortActive } = useSorting(); const tempRows = isLoading ? defaultRows : rows; From bcdb691df4671c664f985f34a75c2be37f40956d Mon Sep 17 00:00:00 2001 From: franm Date: Fri, 18 Jul 2025 09:51:18 -0300 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=A8=20app:=20set=20borrow=20tab=20in?= =?UTF-8?q?=20dashboard=20using=20query=20param?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/MobileTabs/index.tsx | 21 ++++++++++++++++--- .../FloatingPoolDashboard/index.tsx | 9 +++++++- .../dashboard/DashboardContent/index.tsx | 6 +++++- hooks/useDashboard.ts | 11 +++++++--- hooks/useNetAPR.ts | 7 +++---- 5 files changed, 42 insertions(+), 12 deletions(-) diff --git a/components/MobileTabs/index.tsx b/components/MobileTabs/index.tsx index efa16fd30..9e71d0772 100644 --- a/components/MobileTabs/index.tsx +++ b/components/MobileTabs/index.tsx @@ -1,6 +1,7 @@ -import React, { ReactNode, useState } from 'react'; +import React, { ReactNode, useState, useEffect, useRef } from 'react'; import { Box, Button } from '@mui/material'; import { track } from 'utils/mixpanel'; +import { useRouter } from 'next/router'; export type MobileTab = { title: string; @@ -12,11 +13,25 @@ type Props = { }; function MobileTabs({ tabs }: Props) { - const [selected, setSelected] = useState(0); + const { query } = useRouter(); + const contentRef = useRef(null); + + const tabType = query.tab === 'b' ? 1 : 0; + const [selected, setSelected] = useState(tabType); + + useEffect(() => { + setSelected(tabType); + }, [tabType]); + + useEffect(() => { + if (query.tab && tabType === 1 && contentRef.current) { + contentRef.current.scrollIntoView({ behavior: 'smooth', block: 'start' }); + } + }, [query.tab, tabType]); return ( <> - + {tabs.map(({ title }, i) => (