Skip to content

Commit c9db3b3

Browse files
authored
feat: refactored back the baseVariableBorrowRate using sdk (#2818)
1 parent ab652aa commit c9db3b3

File tree

3 files changed

+20
-29
lines changed

3 files changed

+20
-29
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
},
3333
"dependencies": {
3434
"@aave/contract-helpers": "1.36.1",
35-
"@aave/graphql": "^0.8.0",
35+
"@aave/graphql": "^0.10.0",
3636
"@aave/math-utils": "1.36.1",
37-
"@aave/react": "^0.7.1",
37+
"@aave/react": "^0.8.1",
3838
"@amplitude/analytics-browser": "^2.13.0",
3939
"@bgd-labs/aave-address-book": "^4.36.3",
4040
"@cowprotocol/cow-sdk": "7.2.4",
@@ -159,4 +159,4 @@
159159
"budgetPercentIncreaseRed": 20,
160160
"showDetails": true
161161
}
162-
}
162+
}

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

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

85
import { GraphLegend } from './GraphLegend';
96
import { InterestRateModelGraph } from './InterestRateModelGraph';
@@ -20,12 +17,6 @@ export type Fields = { name: Field; color: string; text: string }[];
2017
export const InterestRateModelGraphContainer = ({
2118
reserve,
2219
}: 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-
2920
const CHART_HEIGHT = 155;
3021
const fields: Fields = [
3122
{ name: 'variableBorrowRate', text: 'Borrow APR, variable', color: '#B6509E' },
@@ -50,7 +41,7 @@ export const InterestRateModelGraphContainer = ({
5041
height={CHART_HEIGHT}
5142
fields={fields}
5243
reserve={{
53-
baseVariableBorrowRate: String(reserveData?.baseVariableBorrowRate),
44+
baseVariableBorrowRate: String(reserve.borrowInfo?.baseVariableBorrowRate.raw),
5445
optimalUsageRatio: String(reserve.borrowInfo?.optimalUsageRate.raw),
5546
utilizationRate: String(reserve.borrowInfo?.utilizationRate.value),
5647
variableRateSlope1: String(reserve.borrowInfo?.variableRateSlope1.raw),

yarn.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"@gql.tada/internal" "^1.0.0"
1616
graphql "^15.5.0 || ^16.0.0 || ^17.0.0"
1717

18-
"@aave/client@0.8.0":
19-
version "0.8.0"
20-
resolved "https://registry.yarnpkg.com/@aave/client/-/client-0.8.0.tgz#ef3e37d330fc454c1abe7a9e26ec01bd66ce3fd6"
21-
integrity sha512-QW2IKOuae0jp7XV9YCUwtB00QNdO2LbybGXRV0SkehcCIgFAx6SeY3daXrtm/s1d6ysqvEJJEvXkoaXhAt76QQ==
18+
"@aave/client@0.9.1":
19+
version "0.9.1"
20+
resolved "https://registry.yarnpkg.com/@aave/client/-/client-0.9.1.tgz#5a11908715e67bb2a3992d30f9df16c049d9c162"
21+
integrity sha512-pWwICirnQdG37sbNBTYqrFCDRN+rRnCGjNPGZtKZj/QxIbQ2p0GEZcGFpUfDw2lDSBsa4VK75T6IFiNn50zmNQ==
2222
dependencies:
2323
"@aave/core" "0.1.0"
24-
"@aave/graphql" "0.8.0"
24+
"@aave/graphql" "0.10.0"
2525
"@aave/types" "0.2.0"
2626
"@urql/core" "^5.2.0"
2727
graphql "^16.11.0"
@@ -42,10 +42,10 @@
4242
"@urql/core" "^5.2.0"
4343
graphql "^16.11.0"
4444

45-
"@aave/graphql@0.8.0", "@aave/graphql@^0.8.0":
46-
version "0.8.0"
47-
resolved "https://registry.yarnpkg.com/@aave/graphql/-/graphql-0.8.0.tgz#b999862b5c22bf3119f5c4ba5de46aef34df197d"
48-
integrity sha512-S5NoQk50ypHjdTP6hJvNQW336J2fgqRrFdDlgmr6u3j7DShVTIKw3taP9spbyfGQnkIYmgzs2ZCQN/8Xq81f3Q==
45+
"@aave/graphql@0.10.0", "@aave/graphql@^0.10.0":
46+
version "0.10.0"
47+
resolved "https://registry.yarnpkg.com/@aave/graphql/-/graphql-0.10.0.tgz#953ad5c74d2c104fe4f4bd6f55d220b99d05b1f1"
48+
integrity sha512-CRYjJbd04dUIuQjHcKHmd43y/agQ55NKiW+wKwz8M2vhyUb2qNP9I/fPKmEo+K+Stdr+ybcF8QMXBupRbMvEUA==
4949
dependencies:
5050
"@aave/types" "0.2.0"
5151
gql.tada "^1.8.13"
@@ -57,13 +57,13 @@
5757
resolved "https://registry.yarnpkg.com/@aave/math-utils/-/math-utils-1.36.1.tgz#3e501962de3700250c213c981ea47b36a8e37a54"
5858
integrity sha512-rR1sbDX1IFb1B1TLdi8hZANvtviPeU8hfpLuHC9cwlXluujCdHttnNVODwco1J5d2k6KxnNnc0DZJj2yV7nLTQ==
5959

60-
"@aave/react@^0.7.1":
61-
version "0.7.1"
62-
resolved "https://registry.yarnpkg.com/@aave/react/-/react-0.7.1.tgz#222f8551d927cbbb0ba1bb0f6f2d0605c978bf9b"
63-
integrity sha512-ycnzgCz3RVrhfruuhi1P93e470KE3RyzVdTh71KgM7bM4Z8b/Gr8ocMqhkK/WCnue9p1QZGNVt00/l3d9DtY0A==
60+
"@aave/react@^0.8.1":
61+
version "0.8.1"
62+
resolved "https://registry.yarnpkg.com/@aave/react/-/react-0.8.1.tgz#11a92ad9f193700ac10d5b9fe1e3a6244e7b50dd"
63+
integrity sha512-XZdWocic1xKNCb4x+cSsbAMHEJwsJf0D1hQmhQ5s9kisQOWGde23OsMaXPcS0Zh4XB4u5KMQWCrM7/CFMZqAQA==
6464
dependencies:
65-
"@aave/client" "0.8.0"
66-
"@aave/graphql" "0.8.0"
65+
"@aave/client" "0.9.1"
66+
"@aave/graphql" "0.10.0"
6767
"@aave/types" "0.2.0"
6868
urql "^4.2.2"
6969

0 commit comments

Comments
 (0)