- Select a pair to borrow from
+ On Aloe, all borrows are managed inside smart wallets, represented by NFTs. Select a pair and mint an NFT to
+ get started.
}
diff --git a/earn/src/components/common/UniswapPositionCard.tsx b/earn/src/components/common/UniswapPositionCard.tsx
index 0eacfa08..20c3a390 100644
--- a/earn/src/components/common/UniswapPositionCard.tsx
+++ b/earn/src/components/common/UniswapPositionCard.tsx
@@ -15,11 +15,11 @@ export const UniswapPositionCardContainer = styled.div`
gap: 8px;
`;
-export const UniswapPositionCardWrapper = styled.div`
+export const UniswapPositionCardWrapper = styled.div<{ $color?: string }>`
display: flex;
flex-direction: column;
gap: 8px;
- background-color: ${GREY_800};
+ background-color: ${(props) => props.$color ?? GREY_800};
border-radius: 8px;
padding: 16px;
width: 100%;
diff --git a/earn/src/pages/AdvancedPage.tsx b/earn/src/pages/AdvancedPage.tsx
index e0dad2fd..f002584e 100644
--- a/earn/src/pages/AdvancedPage.tsx
+++ b/earn/src/pages/AdvancedPage.tsx
@@ -8,13 +8,13 @@ import { useNavigate, useSearchParams } from 'react-router-dom';
import { borrowerAbi } from 'shared/lib/abis/Borrower';
import { borrowerLensAbi } from 'shared/lib/abis/BorrowerLens';
import { lenderLensAbi } from 'shared/lib/abis/LenderLens';
+import Banner from 'shared/lib/components/banner/Banner';
import AppPage from 'shared/lib/components/common/AppPage';
-import { LABEL_TEXT_COLOR } from 'shared/lib/components/common/Modal';
import { Text } from 'shared/lib/components/common/Typography';
import {
ALOE_II_LENDER_LENS_ADDRESS,
ALOE_II_BORROWER_LENS_ADDRESS,
- ALOE_II_ORACLE_ADDRESS,
+ ALOE_II_BORROWER_NFT_ADDRESS,
} from 'shared/lib/data/constants/ChainSpecific';
import { GetNumericFeeTier } from 'shared/lib/data/FeeTier';
import { GN } from 'shared/lib/data/GoodNumber';
@@ -28,8 +28,6 @@ import { Address, useAccount, useContract, useProvider, useContractRead, useBala
import { ChainContext } from '../App';
import { ReactComponent as InfoIcon } from '../assets/svg/info.svg';
-import BorrowGraph, { BorrowGraphData } from '../components/advanced/BorrowGraph';
-import { BorrowGraphPlaceholder } from '../components/advanced/BorrowGraphPlaceholder';
import { BorrowMetrics } from '../components/advanced/BorrowMetrics';
import GlobalStatsTable from '../components/advanced/GlobalStatsTable';
import ManageAccountButtons from '../components/advanced/ManageAccountButtons';
@@ -42,10 +40,8 @@ import WithdrawAnteModal from '../components/advanced/modal/WithdrawAnteModal';
import SmartWalletButton, { NewSmartWalletButton } from '../components/advanced/SmartWalletButton';
import { UniswapPositionList } from '../components/advanced/UniswapPositionList';
import PendingTxnModal, { PendingTxnModalStatus } from '../components/common/PendingTxnModal';
-import { computeLTV } from '../data/BalanceSheet';
import { BorrowerNftBorrower, fetchListOfBorrowerNfts } from '../data/BorrowerNft';
-import { RESPONSIVE_BREAKPOINT_MD, RESPONSIVE_BREAKPOINT_SM } from '../data/constants/Breakpoints';
-import { TOPIC0_UPDATE_ORACLE } from '../data/constants/Signatures';
+import { RESPONSIVE_BREAKPOINT_SM } from '../data/constants/Breakpoints';
import { primeUrl } from '../data/constants/Values';
import useAvailablePools from '../data/hooks/UseAvailablePools';
import { fetchBorrowerDatas } from '../data/MarginAccount';
@@ -58,145 +54,84 @@ import {
UniswapPositionPrior,
} from '../data/Uniswap';
-const SECONDARY_COLOR = 'rgba(130, 160, 182, 1)';
const BORROW_TITLE_TEXT_COLOR = 'rgba(130, 160, 182, 1)';
-const TOPIC1_PREFIX = '0x000000000000000000000000';
const FETCH_UNISWAP_POSITIONS_DEBOUNCE_MS = 500;
const SELECTED_MARGIN_ACCOUNT_KEY = 'account';
-const ExplainerWrapper = styled.div`
- display: flex;
- flex-direction: row;
- position: relative;
-
- padding: 16px;
- margin-top: 1rem;
- margin-bottom: 2rem;
-
- background-color: rgba(10, 20, 27, 1);
- border-radius: 8px;
-
- &:before {
- content: '';
- position: absolute;
- inset: 0;
- pointer-events: none;
- border-radius: 8px;
- /* 1.25px instead of 1px since it avoids the buggy appearance */
- padding: 1.25px;
- background: linear-gradient(90deg, #9baaf3 0%, #7bd8c0 100%);
- mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
- -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
- -webkit-mask-composite: xor;
- mask-composite: exclude;
- }
-`;
-
const Container = styled.div`
- display: flex;
- align-items: flex-start;
- gap: 64px;
+ display: grid;
+ gap: 20px;
max-width: 1280px;
margin: 0 auto;
+ margin-top: 32px;
- @media (max-width: ${RESPONSIVE_BREAKPOINT_MD}) {
- gap: 32px;
- }
+ grid-template-columns: 1fr 6fr;
+ grid-template-rows: auto auto;
+ grid-template-areas:
+ 'title buttons'
+ 'list data';
@media (max-width: ${RESPONSIVE_BREAKPOINT_SM}) {
- flex-direction: column;
- gap: 0;
- align-items: center;
- }
-`;
-
-const PageGrid = styled.div`
- display: grid;
- grid-template-columns: 1fr 1.2fr;
- grid-template-rows: auto auto auto auto auto;
- grid-template-areas:
- 'monitor graph'
- 'metrics metrics'
- 'uniswap uniswap'
- 'stats stats'
- 'link link';
- flex-grow: 1;
- margin-top: 26px;
-
- @media (max-width: ${RESPONSIVE_BREAKPOINT_MD}) {
- width: 100%;
grid-template-columns: 1fr;
grid-template-rows: auto auto auto auto;
grid-template-areas:
- 'monitor'
- 'graph'
- 'metrics'
- 'uniswap'
- 'stats'
- 'link';
+ 'title'
+ 'list'
+ 'buttons'
+ 'data';
}
`;
-const StyledExternalLink = styled.a`
+const GridAreaForButtons = styled.div`
display: flex;
- align-items: center;
- gap: 4px;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- max-width: 100%;
- &:hover {
- text-decoration: underline;
- }
+ grid-area: buttons;
+
+ background: rgba(13, 23, 30, 1);
+
+ padding: 16px;
+ border-radius: 16px;
`;
-const SmartWalletsContainer = styled.div`
+const GridAreaForNFTList = styled.div`
display: flex;
flex-direction: column;
- gap: 8px;
+ grid-area: list;
+
+ gap: 4px;
@media (max-width: ${RESPONSIVE_BREAKPOINT_SM}) {
+ flex-direction: row;
width: 100%;
+ overflow-x: scroll;
}
`;
-const SmartWalletsList = styled.div`
+const GridAreaForData = styled.div`
display: flex;
flex-direction: column;
- gap: 8px;
- width: max-content;
- min-width: 280px;
-`;
-
-const MonitorContainer = styled.div`
- grid-area: monitor;
- margin-bottom: 64px;
- display: flex;
- flex-direction: column;
- gap: 32px;
-`;
+ grid-area: data;
-const GraphContainer = styled.div`
- grid-area: graph;
- margin-bottom: 64px;
-`;
-
-const MetricsContainer = styled.div`
- grid-area: metrics;
- margin-bottom: 64px;
-`;
+ background: rgba(13, 23, 30, 1);
-const UniswapPositionsContainer = styled.div`
- grid-area: uniswap;
- margin-bottom: 64px;
+ gap: 64px;
+ padding: 16px;
+ border-radius: 16px;
`;
-const StatsContainer = styled.div`
- grid-area: stats;
+const StyledExternalLink = styled.a`
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ max-width: 100%;
+ &:hover {
+ text-decoration: underline;
+ }
`;
const LinkContainer = styled.div`
- grid-area: link;
display: flex;
align-items: center;
justify-content: center;
@@ -214,8 +149,6 @@ export default function AdvancedPage() {
const provider = useProvider({ chainId: activeChain.id });
const { address: userAddress, isConnected } = useAccount();
- const [cachedGraphDatas, setCachedGraphDatas] = useSafeState
+ )}
+
+
+ {availablePools.size > 0 && (
+