11import { Box } from '@mui/material' ;
22import { 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
58import { GraphLegend } from './GraphLegend' ;
69import { InterestRateModelGraph } from './InterestRateModelGraph' ;
@@ -17,6 +20,12 @@ export type Fields = { name: Field; color: string; text: string }[];
1720export 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