Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/components/primitives/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import MuiLink, { LinkProps as MuiLinkProps } from '@mui/material/Link';
import { styled } from '@mui/material/styles';
import clsx from 'clsx';
import { clsx } from 'clsx';
import NextLink, { LinkProps as NextLinkProps } from 'next/link';
import { useRouter } from 'next/router';
import * as React from 'react';
Expand Down
16 changes: 16 additions & 0 deletions src/hooks/app-data-provider/useAppDataProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, { PropsWithChildren, useContext } from 'react';
import { EmodeCategory } from 'src/helpers/types';
import { useWeb3Context } from 'src/libs/hooks/useWeb3Context';
import { useRootStore } from 'src/store/root';
import { fetchIconSymbolAndName } from 'src/ui-config/reservePatches';

import { formatEmodes } from '../../store/poolSelectors';
import {
Expand Down Expand Up @@ -88,13 +89,28 @@ export const AppDataProvider: React.FC<PropsWithChildren> = ({ children }) => {
return acc + Number(value);
}, 0);

const patchUnderlyingToken = (reserve: Reserve) => {
const patch = fetchIconSymbolAndName({
underlyingAsset: reserve.underlyingToken.address,
symbol: reserve.underlyingToken.symbol,
name: reserve.underlyingToken.name,
});
return {
...reserve.underlyingToken,
name: patch.name ?? reserve.underlyingToken.name,
symbol: patch.symbol ?? reserve.underlyingToken.symbol,
};
};

const supplyReserves = (sdkMarket?.supplyReserves ?? []).map((reserve) => ({
...reserve,
underlyingToken: patchUnderlyingToken(reserve),
id: `${sdkMarket?.address}-${reserve.underlyingToken.address}`,
}));

const borrowReserves = (sdkMarket?.borrowReserves ?? []).map((reserve) => ({
...reserve,
underlyingToken: patchUnderlyingToken(reserve),
id: `${sdkMarket?.address}-${reserve.underlyingToken.address}`,
}));

Expand Down
5 changes: 5 additions & 0 deletions src/ui-config/reservePatches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ export function fetchIconSymbolAndName({ underlyingAsset, symbol, name }: IconSy
'0x004375dff511095cc5a197a54140a24efef3a416': { iconSymbol: 'UNI_BTC_USDC' },
'0xbb2b8038a1640196fbe3e38816f3e67cba72d940': { iconSymbol: 'UNI_WBTC_WETH' },
'0x2fdbadf3c4d5a8666bc06645b8358ab803996e28': { iconSymbol: 'UNI_YFI_WETH' },
'0xc96de26018a54d51c097160568752c4e3bd6c364': {
iconSymbol: 'FBTC',
name: 'Function Bitcoin',
symbol: 'FBTC',
},
};

const lowerUnderlyingAsset = underlyingAsset.toLowerCase();
Expand Down
Loading