From 63bb30b79847fabe8a118dc6527d5848a2b62533 Mon Sep 17 00:00:00 2001 From: Alejandro <95312462+AGMASO@users.noreply.github.com> Date: Thu, 18 Dec 2025 13:11:24 +0100 Subject: [PATCH] feat: refactored back the baseVariableBorrowRate using sdk --- package.json | 6 ++-- .../InterestRateModelGraphContainer.tsx | 13 ++------ yarn.lock | 30 +++++++++---------- 3 files changed, 20 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 172ec30bef..d576a08a44 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,9 @@ }, "dependencies": { "@aave/contract-helpers": "1.36.1", - "@aave/graphql": "^0.8.0", + "@aave/graphql": "^0.10.0", "@aave/math-utils": "1.36.1", - "@aave/react": "^0.7.1", + "@aave/react": "^0.8.1", "@amplitude/analytics-browser": "^2.13.0", "@bgd-labs/aave-address-book": "^4.36.3", "@cowprotocol/cow-sdk": "7.2.4", @@ -159,4 +159,4 @@ "budgetPercentIncreaseRed": 20, "showDetails": true } -} \ No newline at end of file +} diff --git a/src/modules/reserve-overview/graphs/InterestRateModelGraphContainer.tsx b/src/modules/reserve-overview/graphs/InterestRateModelGraphContainer.tsx index 0658976aeb..36bd0492e8 100644 --- a/src/modules/reserve-overview/graphs/InterestRateModelGraphContainer.tsx +++ b/src/modules/reserve-overview/graphs/InterestRateModelGraphContainer.tsx @@ -1,9 +1,6 @@ import { Box } from '@mui/material'; import { ParentSize } from '@visx/responsive'; -import { - type ReserveWithId, - useAppDataContext, -} from 'src/hooks/app-data-provider/useAppDataProvider'; +import { type ReserveWithId } from 'src/hooks/app-data-provider/useAppDataProvider'; import { GraphLegend } from './GraphLegend'; import { InterestRateModelGraph } from './InterestRateModelGraph'; @@ -20,12 +17,6 @@ export type Fields = { name: Field; color: string; text: string }[]; export const InterestRateModelGraphContainer = ({ reserve, }: InteresetRateModelGraphContainerProps): JSX.Element => { - const { reserves: reservesLegacy } = useAppDataContext(); - - const reserveData = reservesLegacy.find( - (r) => r.underlyingAsset.toLowerCase() === reserve.underlyingToken.address.toLowerCase() - ); - const CHART_HEIGHT = 155; const fields: Fields = [ { name: 'variableBorrowRate', text: 'Borrow APR, variable', color: '#B6509E' }, @@ -50,7 +41,7 @@ export const InterestRateModelGraphContainer = ({ height={CHART_HEIGHT} fields={fields} reserve={{ - baseVariableBorrowRate: String(reserveData?.baseVariableBorrowRate), + baseVariableBorrowRate: String(reserve.borrowInfo?.baseVariableBorrowRate.raw), optimalUsageRatio: String(reserve.borrowInfo?.optimalUsageRate.raw), utilizationRate: String(reserve.borrowInfo?.utilizationRate.value), variableRateSlope1: String(reserve.borrowInfo?.variableRateSlope1.raw), diff --git a/yarn.lock b/yarn.lock index 3b37d39fa3..b50c9b122c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,13 +15,13 @@ "@gql.tada/internal" "^1.0.0" graphql "^15.5.0 || ^16.0.0 || ^17.0.0" -"@aave/client@0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@aave/client/-/client-0.8.0.tgz#ef3e37d330fc454c1abe7a9e26ec01bd66ce3fd6" - integrity sha512-QW2IKOuae0jp7XV9YCUwtB00QNdO2LbybGXRV0SkehcCIgFAx6SeY3daXrtm/s1d6ysqvEJJEvXkoaXhAt76QQ== +"@aave/client@0.9.1": + version "0.9.1" + resolved "https://registry.yarnpkg.com/@aave/client/-/client-0.9.1.tgz#5a11908715e67bb2a3992d30f9df16c049d9c162" + integrity sha512-pWwICirnQdG37sbNBTYqrFCDRN+rRnCGjNPGZtKZj/QxIbQ2p0GEZcGFpUfDw2lDSBsa4VK75T6IFiNn50zmNQ== dependencies: "@aave/core" "0.1.0" - "@aave/graphql" "0.8.0" + "@aave/graphql" "0.10.0" "@aave/types" "0.2.0" "@urql/core" "^5.2.0" graphql "^16.11.0" @@ -42,10 +42,10 @@ "@urql/core" "^5.2.0" graphql "^16.11.0" -"@aave/graphql@0.8.0", "@aave/graphql@^0.8.0": - version "0.8.0" - resolved "https://registry.yarnpkg.com/@aave/graphql/-/graphql-0.8.0.tgz#b999862b5c22bf3119f5c4ba5de46aef34df197d" - integrity sha512-S5NoQk50ypHjdTP6hJvNQW336J2fgqRrFdDlgmr6u3j7DShVTIKw3taP9spbyfGQnkIYmgzs2ZCQN/8Xq81f3Q== +"@aave/graphql@0.10.0", "@aave/graphql@^0.10.0": + version "0.10.0" + resolved "https://registry.yarnpkg.com/@aave/graphql/-/graphql-0.10.0.tgz#953ad5c74d2c104fe4f4bd6f55d220b99d05b1f1" + integrity sha512-CRYjJbd04dUIuQjHcKHmd43y/agQ55NKiW+wKwz8M2vhyUb2qNP9I/fPKmEo+K+Stdr+ybcF8QMXBupRbMvEUA== dependencies: "@aave/types" "0.2.0" gql.tada "^1.8.13" @@ -57,13 +57,13 @@ resolved "https://registry.yarnpkg.com/@aave/math-utils/-/math-utils-1.36.1.tgz#3e501962de3700250c213c981ea47b36a8e37a54" integrity sha512-rR1sbDX1IFb1B1TLdi8hZANvtviPeU8hfpLuHC9cwlXluujCdHttnNVODwco1J5d2k6KxnNnc0DZJj2yV7nLTQ== -"@aave/react@^0.7.1": - version "0.7.1" - resolved "https://registry.yarnpkg.com/@aave/react/-/react-0.7.1.tgz#222f8551d927cbbb0ba1bb0f6f2d0605c978bf9b" - integrity sha512-ycnzgCz3RVrhfruuhi1P93e470KE3RyzVdTh71KgM7bM4Z8b/Gr8ocMqhkK/WCnue9p1QZGNVt00/l3d9DtY0A== +"@aave/react@^0.8.1": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@aave/react/-/react-0.8.1.tgz#11a92ad9f193700ac10d5b9fe1e3a6244e7b50dd" + integrity sha512-XZdWocic1xKNCb4x+cSsbAMHEJwsJf0D1hQmhQ5s9kisQOWGde23OsMaXPcS0Zh4XB4u5KMQWCrM7/CFMZqAQA== dependencies: - "@aave/client" "0.8.0" - "@aave/graphql" "0.8.0" + "@aave/client" "0.9.1" + "@aave/graphql" "0.10.0" "@aave/types" "0.2.0" urql "^4.2.2"