Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: react query 5 - 5, migration hooks #1839

Merged
merged 81 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 80 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
0ffd8c4
feat: basic usepoolreserves
JoaquinBattilana Nov 7, 2023
21785f3
Merge branch 'main' of github.com:aave/interface into feat/migration-…
JoaquinBattilana Nov 7, 2023
dabc84a
feat: new hooks for app data context
JoaquinBattilana Nov 8, 2023
b81070a
feat: more refactor to useAppDataProvider
JoaquinBattilana Nov 8, 2023
647059c
feat: properly handle user being undefined
JoaquinBattilana Nov 10, 2023
f0bd8a4
chore: deleted reselect
JoaquinBattilana Nov 10, 2023
da05faf
feat: migration hooks and type refactor
JoaquinBattilana Nov 14, 2023
dc0a901
feat: added timestamp correctly
JoaquinBattilana Nov 14, 2023
6711591
feat: fixed health factor in migration
JoaquinBattilana Nov 14, 2023
c3799e2
feat: refactor query keys
JoaquinBattilana Nov 15, 2023
352f840
feat: react query key factory and fix on app data providers
JoaquinBattilana Nov 20, 2023
903163f
feat: merged with base branch
JoaquinBattilana Nov 20, 2023
dbea51e
feat: fixed hooks new parameters
JoaquinBattilana Nov 20, 2023
2337c6f
feat: merged with base
JoaquinBattilana Nov 20, 2023
9ff75ec
feat: deleted hashable
JoaquinBattilana Nov 20, 2023
564a01f
feat: deleted hashable
JoaquinBattilana Nov 20, 2023
62c5400
feat: added gho hooks
JoaquinBattilana Nov 21, 2023
db44033
feat: deleted ghoslice
JoaquinBattilana Nov 22, 2023
0dc6983
feat: merged with base
JoaquinBattilana Nov 22, 2023
801ce74
feat: ordered providers correctly
JoaquinBattilana Nov 22, 2023
a975808
feat: added authentication component wrapper
JoaquinBattilana Nov 22, 2023
238f2dc
feat: merged with base
JoaquinBattilana Nov 22, 2023
f89f89e
feat: changing types for old types, refactor will come later, depreca…
JoaquinBattilana Nov 24, 2023
00af67f
feat: more types changes
JoaquinBattilana Nov 24, 2023
df7b107
feat: more type changes
JoaquinBattilana Nov 24, 2023
f450684
feat: added pool hooks
JoaquinBattilana Nov 24, 2023
65ed14c
feat: added pool hooks
JoaquinBattilana Nov 24, 2023
ad59785
feat: renamed hook
JoaquinBattilana Nov 24, 2023
c147233
feat: updated imports
JoaquinBattilana Nov 24, 2023
6f5bec8
feat: merged with base
JoaquinBattilana Nov 24, 2023
02e8b28
feat: added hook
JoaquinBattilana Nov 24, 2023
8d4825b
Merge branch 'feat/react-query-5-2' into feat/react-query-5-3
JoaquinBattilana Nov 24, 2023
5ab859e
Merge branch 'feat/react-query-5-3' into feat/react-query-5-4
JoaquinBattilana Nov 24, 2023
838a8a7
feat: refactored useAppDataProvider
JoaquinBattilana Nov 24, 2023
ed84332
feat: deleted useless changes
JoaquinBattilana Nov 24, 2023
f227e0a
feat: deleted more useless changes
JoaquinBattilana Nov 24, 2023
0d6cbda
feat: deleted changes in gho borrow apyrange
JoaquinBattilana Nov 24, 2023
118721e
feat: deleted all background refetches
JoaquinBattilana Nov 24, 2023
5cb8e0e
feat: fixed some changes
JoaquinBattilana Nov 24, 2023
2bf7d85
feat: merged with base
JoaquinBattilana Nov 24, 2023
d3fbff5
feat: refactored with repay bundle changes
JoaquinBattilana Nov 27, 2023
b20ecdb
feat: added dynamic imports again
JoaquinBattilana Nov 27, 2023
d589a90
feat: merged with base
JoaquinBattilana Nov 28, 2023
3a2610f
feat: merged with main
JoaquinBattilana Nov 28, 2023
ecc9228
feat: fixed gho fetched data flag
JoaquinBattilana Nov 29, 2023
4919627
feat: removed lodash memoize in favour of micro-memoize
JoaquinBattilana Nov 29, 2023
3977900
feat: added refetch on windows focus off
JoaquinBattilana Nov 29, 2023
cb3377b
feat: merged with base
JoaquinBattilana Nov 29, 2023
e032418
fix: gho tests - dynamic apy
MareskoY Nov 29, 2023
d051867
Merge branch 'main' into feat/react-query-5-2
JoaquinBattilana Dec 5, 2023
17072ec
feat: fixed ghoQualifiesForDiscount
JoaquinBattilana Dec 6, 2023
e0664bc
feat: merged with main
JoaquinBattilana Dec 6, 2023
a96a9c4
feat: merged with main
JoaquinBattilana Jan 3, 2024
db4ff98
Merge branch 'main' into feat/react-query-5-2
JoaquinBattilana Jan 4, 2024
a4c116a
Merge branch 'main' into feat/react-query-5-2
JoaquinBattilana Jan 5, 2024
71ede34
feat: merged with main
JoaquinBattilana Feb 20, 2024
fd1715d
feat: merged with main
JoaquinBattilana Feb 20, 2024
ff6c658
feat: merged with main
JoaquinBattilana Feb 20, 2024
70027d3
feat: deleted not used components
JoaquinBattilana Feb 20, 2024
9ae42ad
feat: merged with base
JoaquinBattilana Feb 20, 2024
ec8d4b5
feat: changed to micro memoize
JoaquinBattilana Feb 21, 2024
80b51fd
Merge branch 'feat/react-query-5-4' into feat/react-query-5
JoaquinBattilana Feb 21, 2024
eded039
feat: switched to micro memoize
JoaquinBattilana Feb 21, 2024
31a7857
fix: skip all gho test due pull is full
MareskoY Feb 21, 2024
332a73c
feat: deleted memoize for gh ofunctions
JoaquinBattilana Feb 21, 2024
b9523db
Merge branch 'feat/react-query-5-2' of github.com:aave/interface into…
JoaquinBattilana Feb 21, 2024
4191a1a
Merge branch 'feat/react-query-5-2' into feat/react-query-5-3
JoaquinBattilana Feb 22, 2024
429f7cb
Merge branch 'feat/react-query-5-3' into feat/react-query-5-4
JoaquinBattilana Feb 22, 2024
2aea404
Merge branch 'feat/react-query-5-4' into feat/react-query-5
JoaquinBattilana Feb 22, 2024
f1bbb8f
feat: merged with main
JoaquinBattilana Feb 22, 2024
299e21b
feat: fixed build
JoaquinBattilana Feb 22, 2024
507ced9
Merge branch 'feat/react-query-5-3' into feat/react-query-5-4
JoaquinBattilana Feb 22, 2024
43f1c1f
Merge branch 'feat/react-query-5-4' into feat/react-query-5
JoaquinBattilana Feb 22, 2024
2f9e495
feat: merged with main
JoaquinBattilana Mar 8, 2024
8b75352
feat: deleted not used changes
JoaquinBattilana Mar 8, 2024
7f85ed0
test: recover polygon coverage
MareskoY Mar 11, 2024
e5b3024
fix: test coverage
MareskoY Mar 11, 2024
10131ec
feat: fixed dashboard link in success migration modal and double migr…
JoaquinBattilana Mar 11, 2024
0e195e6
feat: correct loading in migration page
JoaquinBattilana Mar 12, 2024
21da8a2
fix: dai test
MareskoY Mar 13, 2024
2496445
feat: fixed approval buffer
JoaquinBattilana Mar 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const testData = {
},
};

describe('DAI INTEGRATION SPEC, POLYGON V2 MARKET', () => {
describe.skip('DAI INTEGRATION SPEC, POLYGON V2 MARKET', () => {
const skipTestState = skipState(false);
configEnvWithTenderlyPolygonFork({ tokens: tokenSet(tokensToRequest) });
borrow(testData.testCases.borrow, skipTestState, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ import {
borrowsUnavailable,
dashboardAssetValuesVerification,
} from '../../../../support/steps/verification.steps';
import { RequestedTokens, tokenSet } from '../../../4-gho-ethereum/helpers/token.helper';

const tokensToRequest: RequestedTokens = {
aMATICPolygonV2: 800,
};

const testData = {
testCases: {
Expand Down Expand Up @@ -90,7 +95,7 @@ const testData = {

describe('MATIC INTEGRATION SPEC, POLYGON V2 MARKET', () => {
const skipTestState = skipState(false);
configEnvWithTenderlyPolygonFork({});
configEnvWithTenderlyPolygonFork({ tokens: tokenSet(tokensToRequest) });

supply(testData.testCases.deposit, skipTestState, true);
describe('Check Collateral switching', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const testData = {
},
withdrawAndSwitch: {
fromAsset: assets.ethereumV3Market.DAI,
toAsset: assets.ethereumV3Market.USDC,
toAsset: assets.ethereumV3Market.USDT,
isCollateralFromAsset: true,
amount: 5,
hasApproval: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const testData = {
},
};
//due frozen Matic
describe.skip('MATIC INTEGRATION SPEC, POLYGON V3 MARKET', () => {
describe('MATIC INTEGRATION SPEC, POLYGON V3 MARKET', () => {
const skipTestState = skipState(false);
configEnvWithTenderlyPolygonFork({ market: 'fork_proto_polygon_v3', v3: true });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const testData = {
};

//due asset frozen
describe.skip('USDC INTEGRATION SPEC, POLYGON V3 MARKET', () => {
describe('USDC INTEGRATION SPEC, POLYGON V3 MARKET', () => {
const skipTestState = skipState(false);
configEnvWithTenderlyPolygonFork({
market: 'fork_proto_polygon_v3',
Expand Down
6 changes: 6 additions & 0 deletions cypress/fixtures/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,12 @@
"collateral": true,
"wrapped": false
},
"USDT": {
"fullName": "USDT",
"shortName": "USDT",
"collateral": false,
"wrapped": false
},
"WBTC": {
"fullName": "WBTC Coin",
"shortName": "WBTC",
Expand Down
6 changes: 0 additions & 6 deletions pages/_app.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ const EmodeModal = dynamic(() =>
const FaucetModal = dynamic(() =>
import('src/components/transactions/Faucet/FaucetModal').then((module) => module.FaucetModal)
);
const MigrateV3Modal = dynamic(() =>
import('src/components/transactions/MigrateV3/MigrateV3Modal').then(
(module) => module.MigrateV3Modal
)
);
const RateSwitchModal = dynamic(() =>
import('src/components/transactions/RateSwitch/RateSwitchModal').then(
(module) => module.RateSwitchModal
Expand Down Expand Up @@ -161,7 +156,6 @@ export default function MyApp(props: MyAppProps) {
<EmodeModal />
<SwapModal />
<FaucetModal />
<MigrateV3Modal />
<TransactionEventHandler />
<SwitchModal />
<StakingMigrateModal />
Expand Down
143 changes: 70 additions & 73 deletions pages/v3-migration.page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Trans } from '@lingui/macro';
import { Box, Divider, useMediaQuery, useTheme } from '@mui/material';
import dynamic from 'next/dynamic';
import { useCallback, useEffect, useState } from 'react';
import { useEffect, useMemo } from 'react';
import { ConnectWalletPaper } from 'src/components/ConnectWalletPaper';
import { ContentContainer } from 'src/components/ContentContainer';
import { useCurrentTimestamp } from 'src/hooks/useCurrentTimestamp';
import { useUserMigrationReserves } from 'src/hooks/migration/useUserMigrationReserves';
import { useUserSummaryAfterMigration } from 'src/hooks/migration/useUserSummaryAfterMigration';
import { useUserPoolReservesHumanized } from 'src/hooks/pool/useUserPoolReserves';
import { useUserSummaryAndIncentives } from 'src/hooks/pool/useUserSummaryAndIncentives';
import { usePermissions } from 'src/hooks/usePermissions';
import { MainLayout } from 'src/layouts/MainLayout';
import { useWeb3Context } from 'src/libs/hooks/useWeb3Context';
Expand All @@ -15,14 +18,8 @@ import { MigrationListItem } from 'src/modules/migration/MigrationListItem';
import { MigrationListItemLoader } from 'src/modules/migration/MigrationListItemLoader';
import { MigrationLists } from 'src/modules/migration/MigrationLists';
import { MigrationTopPanel } from 'src/modules/migration/MigrationTopPanel';
import { selectCurrentChainIdV3PoolReserve } from 'src/store/poolSelectors';
import { selectCurrentChainIdV3MarketData } from 'src/store/poolSelectors';
import { useRootStore } from 'src/store/root';
import {
selectUserReservesForMigration,
selectV2UserSummaryAfterMigration,
selectV3UserSummary,
selectV3UserSummaryAfterMigration,
} from 'src/store/v3MigrationSelectors';

const MigrateV3Modal = dynamic(() =>
import('src/components/transactions/MigrateV3/MigrateV3Modal').then(
Expand All @@ -32,53 +29,9 @@ const MigrateV3Modal = dynamic(() =>

export default function V3Migration() {
const { currentAccount, loading: web3Loading } = useWeb3Context();
const { isPermissionsLoading } = usePermissions();
const theme = useTheme();
const downToSM = useMediaQuery(theme.breakpoints.down('sm'));

const [loading, setLoading] = useState(true);

const refreshPoolData = useRootStore((store) => store.refreshPoolData);
const refreshPoolV3Data = useRootStore((store) => store.refreshPoolV3Data);
const refreshIncentiveData = useRootStore((store) => store.refreshIncentiveData);

useEffect(() => {
Promise.all([refreshPoolData(), refreshPoolV3Data(), refreshIncentiveData()]).finally(() =>
setLoading(false)
);
}, [refreshPoolData, refreshPoolV3Data, refreshIncentiveData]);

const currentTimeStamp = useCurrentTimestamp(10);

const {
supplyReserves,
borrowReserves,
healthFactor: v2HealthFactorBeforeMigration,
isolatedReserveV3,
} = useRootStore(
useCallback(
(state) => selectUserReservesForMigration(state, currentTimeStamp),
[currentTimeStamp]
)
);

// health factor calculation
const { v3UserSummaryBeforeMigration, v2UserSummaryAfterMigration, poolReserveV3 } = useRootStore(
(state) => ({
v2UserSummaryAfterMigration: selectV2UserSummaryAfterMigration(state, currentTimeStamp),
v3UserSummaryBeforeMigration: selectV3UserSummary(state, currentTimeStamp),
poolReserveV3: selectCurrentChainIdV3PoolReserve(state),
})
);

const v3UserSummaryAfterMigration = useRootStore(
useCallback(
(state) => selectV3UserSummaryAfterMigration(state, currentTimeStamp),
[currentTimeStamp]
)
);

// actions
const currentChainId = useRootStore((store) => store.currentChainId);
const currentNetworkConfig = useRootStore((store) => store.currentNetworkConfig);
const currentMarketData = useRootStore((store) => store.currentMarketData);
const {
selectAllSupply,
selectAllBorrow,
Expand All @@ -91,6 +44,43 @@ export default function V3Migration() {
getMigrationExceptionSupplyBalances,
} = useRootStore();

const { isPermissionsLoading } = usePermissions();
const theme = useTheme();
const downToSM = useMediaQuery(theme.breakpoints.down('sm'));

const toMarketData = selectCurrentChainIdV3MarketData(currentChainId, currentNetworkConfig);
const fromMarketData = currentMarketData;

const { data: userMigrationReserves, isLoading: userMigrationReservesLoading } =
useUserMigrationReserves(currentMarketData, toMarketData);

const supplyReserves = useMemo(
() => userMigrationReserves?.supplyReserves || [],
[userMigrationReserves]
);
const borrowReserves = userMigrationReserves?.borrowReserves || [];
const isolatedReserveV3 = userMigrationReserves?.isolatedReserveV3;

const { data: fromUserSummaryAndIncentives, isLoading: fromUserSummaryAndIncentivesLoading } =
useUserSummaryAndIncentives(fromMarketData);
const fromHealthFactor = fromUserSummaryAndIncentives?.healthFactor || '0';

const { data: toUserReservesData, isLoading: toUserReservesDataLoading } =
useUserPoolReservesHumanized(toMarketData);
const { data: toUserSummaryForMigration, isLoading: toUserSummaryForMigrationLoading } =
useUserSummaryAndIncentives(toMarketData);
const toUserEModeCategoryId = toUserReservesData?.userEmodeCategoryId || 0;

const { data: userSummaryAfterMigration, isLoading: userSummaryAfterMigrationLoading } =
useUserSummaryAfterMigration(fromMarketData, toMarketData);

const loading =
userMigrationReservesLoading ||
fromUserSummaryAndIncentivesLoading ||
toUserReservesDataLoading ||
toUserSummaryForMigrationLoading ||
userSummaryAfterMigrationLoading;

useEffect(() => {
if (getMigrationExceptionSupplyBalances && supplyReserves.length > 0) {
getMigrationExceptionSupplyBalances(supplyReserves);
Expand All @@ -110,16 +100,17 @@ export default function V3Migration() {
};

const handleToggleAllSupply = () => {
selectAllSupply(currentTimeStamp);
selectAllSupply(supplyReserves);
};

const handleToggleAllBorrow = () => {
selectAllBorrow(currentTimeStamp);
selectAllBorrow(borrowReserves);
};

const userControlledCollateral =
Object.keys(selectedSupplyAssets).length > 1 &&
v3UserSummaryBeforeMigration.totalCollateralMarketReferenceCurrency == '0';
toUserSummaryForMigration &&
toUserSummaryForMigration.totalCollateralMarketReferenceCurrency == '0';

return (
<>
Expand All @@ -132,8 +123,10 @@ export default function V3Migration() {
isBorrowPositionsAvailable={borrowReserves.length > 0}
onSelectAllSupplies={handleToggleAllSupply}
onSelectAllBorrows={handleToggleAllBorrow}
emodeCategoryId={poolReserveV3?.userEmodeCategoryId}
emodeCategoryId={toUserEModeCategoryId}
isolatedReserveV3={isolatedReserveV3}
supplyReserves={supplyReserves}
borrowReserves={borrowReserves}
suppliesPositions={
<>
{loading ? (
Expand All @@ -156,8 +149,9 @@ export default function V3Migration() {
}
userControlledCollateral={userControlledCollateral}
canBeEnforced={
v3UserSummaryBeforeMigration.totalCollateralMarketReferenceCurrency ==
'0' && reserve.canBeEnforced
toUserSummaryForMigration &&
toUserSummaryForMigration.totalCollateralMarketReferenceCurrency == '0' &&
reserve.canBeEnforced
}
userReserve={reserve}
amount={reserve.underlyingBalance}
Expand Down Expand Up @@ -209,17 +203,20 @@ export default function V3Migration() {

{!downToSM && <Divider sx={{ my: 10 }} />}

<MigrationBottomPanel
hfV2Current={v2HealthFactorBeforeMigration}
hfV2AfterChange={v2UserSummaryAfterMigration.healthFactor}
hfV3Current={v3UserSummaryBeforeMigration.healthFactor}
v3SummaryAfterMigration={v3UserSummaryAfterMigration}
disableButton={
!Object.keys(selectedSupplyAssets).length && !Object.keys(selectedBorrowAssets).length
}
enteringIsolationMode={isolatedReserveV3?.enteringIsolationMode || false}
loading={loading}
/>
{userSummaryAfterMigration && (
<MigrationBottomPanel
hfV2Current={fromHealthFactor}
hfV2AfterChange={userSummaryAfterMigration.fromUserSummaryAfterMigration.healthFactor}
hfV3Current={toUserSummaryForMigration?.healthFactor || '0'}
v3SummaryAfterMigration={userSummaryAfterMigration.toUserSummaryAfterMigration}
disableButton={
!Object.keys(selectedSupplyAssets).length &&
!Object.keys(selectedBorrowAssets).length
}
enteringIsolationMode={isolatedReserveV3?.enteringIsolationMode || false}
loading={loading}
/>
)}
</ContentContainer>
) : (
<ConnectWalletPaper
Expand Down
26 changes: 22 additions & 4 deletions src/components/transactions/MigrateV3/MigrateV3Actions.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,50 @@
import { ProtocolAction } from '@aave/contract-helpers';
import { Trans } from '@lingui/macro';
import { useTransactionHandler } from 'src/helpers/useTransactionHandler';
import { UserMigrationReserves } from 'src/hooks/migration/useUserMigrationReserves';
import { UserSummaryForMigration } from 'src/hooks/migration/useUserSummaryForMigration';
import { useRootStore } from 'src/store/root';

import { TxActionsWrapper } from '../TxActionsWrapper';

export type MigrateV3ActionsProps = {
isWrongNetwork: boolean;
blocked: boolean;
userMigrationReserves: UserMigrationReserves;
toUserSummaryForMigration: UserSummaryForMigration;
};

export const MigrateV3Actions = ({ isWrongNetwork, blocked }: MigrateV3ActionsProps) => {
export const MigrateV3Actions = ({
isWrongNetwork,
blocked,
userMigrationReserves,
toUserSummaryForMigration,
}: MigrateV3ActionsProps) => {
const migrateWithPermits = useRootStore((store) => store.migrateWithPermits);
const migrateWithoutPermits = useRootStore((store) => store.migrateWithoutPermits);
const getApprovePermitsForSelectedAssets = useRootStore(
(store) => store.getApprovePermitsForSelectedAssets
);
const { approval, action, loadingTxns, requiresApproval, mainTxState, approvalTxState } =
useTransactionHandler({
handleGetTxns: async () => await migrateWithoutPermits(),
handleGetTxns: async () =>
await migrateWithoutPermits(toUserSummaryForMigration, userMigrationReserves),
handleGetPermitTxns: async (signatures, deadline) =>
await migrateWithPermits(signatures, deadline),
await migrateWithPermits(
signatures,
deadline,
toUserSummaryForMigration,
userMigrationReserves
),
tryPermit: true,
permitAction: ProtocolAction.migrateV3,
});

const handleApproval = async () => {
const approvePermitsForSelectedAssets = await getApprovePermitsForSelectedAssets();
const approvePermitsForSelectedAssets = await getApprovePermitsForSelectedAssets(
toUserSummaryForMigration,
userMigrationReserves
);
approval(approvePermitsForSelectedAssets);
};

Expand Down
20 changes: 19 additions & 1 deletion src/components/transactions/MigrateV3/MigrateV3Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
import React from 'react';
import { BasicModal } from 'src/components/primitives/BasicModal';
import { useUserMigrationReserves } from 'src/hooks/migration/useUserMigrationReserves';
import { useUserSummaryForMigration } from 'src/hooks/migration/useUserSummaryForMigration';
import { ModalType, useModalContext } from 'src/hooks/useModal';
import { selectCurrentChainIdV3MarketData } from 'src/store/poolSelectors';
import { useRootStore } from 'src/store/root';

import { MigrateV3ModalContent } from './MigrateV3ModalContent';

export const MigrateV3Modal = () => {
const { type, close } = useModalContext();

const currentChainId = useRootStore((store) => store.currentChainId);
const currentNetworkConfig = useRootStore((store) => store.currentNetworkConfig);
const currentMarketData = useRootStore((store) => store.currentMarketData);
const toMarketData = selectCurrentChainIdV3MarketData(currentChainId, currentNetworkConfig);
const fromMarketData = currentMarketData;

const { data: userMigrationReserves } = useUserMigrationReserves(fromMarketData, toMarketData);
const { data: toUserSummaryForMigration } = useUserSummaryForMigration(toMarketData);

return (
<BasicModal open={type === ModalType.V3Migration} setOpen={close}>
<MigrateV3ModalContent />
{userMigrationReserves && toUserSummaryForMigration && (
<MigrateV3ModalContent
userMigrationReserves={userMigrationReserves}
toUserSummaryForMigration={toUserSummaryForMigration}
/>
)}
</BasicModal>
);
};
Loading
Loading