Skip to content

Commit d78a07d

Browse files
committed
fix: baseVariableBorrowRate not coming from sdk
1 parent a93ff05 commit d78a07d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/modules/reserve-overview/graphs/InterestRateModelGraphContainer.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import { Box } from '@mui/material';
22
import { ParentSize } from '@visx/responsive';
3-
import type { ReserveWithId } from 'src/hooks/app-data-provider/useAppDataProvider';
3+
import { useMemo } from 'react';
4+
import {
5+
type ReserveWithId,
6+
useAppDataContext,
7+
} from 'src/hooks/app-data-provider/useAppDataProvider';
48

59
import { GraphLegend } from './GraphLegend';
610
import { InterestRateModelGraph } from './InterestRateModelGraph';
@@ -17,6 +21,13 @@ export type Fields = { name: Field; color: string; text: string }[];
1721
export const InterestRateModelGraphContainer = ({
1822
reserve,
1923
}: InteresetRateModelGraphContainerProps): JSX.Element => {
24+
const { reserves: reservesLegacy } = useAppDataContext();
25+
const reserveData = useMemo(() => {
26+
return reservesLegacy.find(
27+
(r) => r.underlyingAsset.toLowerCase() === reserve.underlyingToken.address.toLowerCase()
28+
);
29+
}, [reservesLegacy, reserve]);
30+
2031
const CHART_HEIGHT = 155;
2132
const fields: Fields = [
2233
{ name: 'variableBorrowRate', text: 'Borrow APR, variable', color: '#B6509E' },
@@ -41,7 +52,7 @@ export const InterestRateModelGraphContainer = ({
4152
height={CHART_HEIGHT}
4253
fields={fields}
4354
reserve={{
44-
baseVariableBorrowRate: String(reserve.borrowInfo?.reserveFactor.raw),
55+
baseVariableBorrowRate: String(reserveData?.baseVariableBorrowRate),
4556
optimalUsageRatio: String(reserve.borrowInfo?.optimalUsageRate.raw),
4657
utilizationRate: String(reserve.borrowInfo?.utilizationRate.value),
4758
variableRateSlope1: String(reserve.borrowInfo?.variableRateSlope1.raw),

0 commit comments

Comments
 (0)