diff --git a/earn/src/components/markets/borrow/BorrowingWidget.tsx b/earn/src/components/markets/borrow/BorrowingWidget.tsx index 868342d1..4e6d7a6b 100644 --- a/earn/src/components/markets/borrow/BorrowingWidget.tsx +++ b/earn/src/components/markets/borrow/BorrowingWidget.tsx @@ -234,15 +234,14 @@ export default function BorrowingWidget(props: BorrowingWidgetProps) { let borrowModal: JSX.Element | null = null; - if (selectedBorrows != null && selectedCollateral != null) { + const borrowEntry = selectedBorrows ? filteredBorrowEntries.find((x) => x.token.equals(selectedBorrows)) : null; + + if (selectedBorrows != null && selectedCollateral != null && borrowEntry?.matchingPairs.length) { if (collateralIsUniswapPosition(selectedCollateral)) { borrowModal = ( x.token.equals(selectedBorrows))!.matchingPairs[0] - } + selectedLendingPair={borrowEntry.matchingPairs[0]} selectedCollateral={selectedCollateral} selectedBorrow={selectedBorrows} setIsOpen={() => { @@ -256,10 +255,7 @@ export default function BorrowingWidget(props: BorrowingWidgetProps) { borrowModal = ( x.token.equals(selectedBorrows))!.matchingPairs[0] - } + selectedLendingPair={borrowEntry.matchingPairs[0]} selectedCollateral={selectedCollateral} selectedBorrow={selectedBorrows} userBalance={tokenBalances.get(selectedCollateral.address)?.gn ?? GN.zero(selectedCollateral.decimals)}