Skip to content

Commit a9be578

Browse files
authored
fix: baseVariableBorrowRate not coming from sdk (#2802)
1 parent a93ff05 commit a9be578

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
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 {
4+
type ReserveWithId,
5+
useAppDataContext,
6+
} from 'src/hooks/app-data-provider/useAppDataProvider';
47

58
import { GraphLegend } from './GraphLegend';
69
import { InterestRateModelGraph } from './InterestRateModelGraph';
@@ -17,6 +20,12 @@ export type Fields = { name: Field; color: string; text: string }[];
1720
export const InterestRateModelGraphContainer = ({
1821
reserve,
1922
}: InteresetRateModelGraphContainerProps): JSX.Element => {
23+
const { reserves: reservesLegacy } = useAppDataContext();
24+
25+
const reserveData = reservesLegacy.find(
26+
(r) => r.underlyingAsset.toLowerCase() === reserve.underlyingToken.address.toLowerCase()
27+
);
28+
2029
const CHART_HEIGHT = 155;
2130
const fields: Fields = [
2231
{ name: 'variableBorrowRate', text: 'Borrow APR, variable', color: '#B6509E' },
@@ -41,7 +50,7 @@ export const InterestRateModelGraphContainer = ({
4150
height={CHART_HEIGHT}
4251
fields={fields}
4352
reserve={{
44-
baseVariableBorrowRate: String(reserve.borrowInfo?.reserveFactor.raw),
53+
baseVariableBorrowRate: String(reserveData?.baseVariableBorrowRate),
4554
optimalUsageRatio: String(reserve.borrowInfo?.optimalUsageRate.raw),
4655
utilizationRate: String(reserve.borrowInfo?.utilizationRate.value),
4756
variableRateSlope1: String(reserve.borrowInfo?.variableRateSlope1.raw),

0 commit comments

Comments
 (0)