11import type { FragmentOf } from 'gql.tada' ;
2- import { graphql } from '../graphql' ;
2+ import { type FragmentDocumentFor , graphql } from '../graphql' ;
33import {
4+ type DecimalValue ,
45 DecimalValueFragment ,
56 Erc20AmountFragment ,
7+ type FiatAmount ,
68 FiatAmountFragment ,
79 FiatAmountWithChangeFragment ,
810 HealthFactorChangeFragment ,
911 PaginatedResultInfoFragment ,
12+ type PercentValue ,
1013 PercentValueFragment ,
1114 PercentValueWithChangeFragment ,
15+ type TokenAmount ,
1216 TokenAmountFragment ,
17+ type TokenInfo ,
1318 TokenInfoFragment ,
1419} from './common' ;
1520import { ReserveFragment , ReserveInfoFragment } from './reserve' ;
@@ -133,7 +138,30 @@ export const UserPositionFragment = graphql(
133138) ;
134139export type UserPosition = FragmentOf < typeof UserPositionFragment > ;
135140
136- export const UserBalanceFragment = graphql (
141+ export interface UserBalance {
142+ __typename : 'UserBalance' ;
143+ info : TokenInfo ;
144+ totalAmount : DecimalValue ;
145+ balances : TokenAmount [ ] ;
146+ fiatAmount : FiatAmount ;
147+ /**
148+ * @deprecated Use `highestSupplyApy` instead. Removal slated for week commencing 6th October 2025.
149+ */
150+ supplyApy : PercentValue ;
151+ /**
152+ * @deprecated Use `highestBorrowApy` instead. Removal slated for week commencing 6th October 2025.
153+ */
154+ borrowApy : PercentValue ;
155+ highestSupplyApy : PercentValue ;
156+ highestBorrowApy : PercentValue ;
157+ lowestSupplyApy : PercentValue ;
158+ lowestBorrowApy : PercentValue ;
159+ }
160+
161+ export const UserBalanceFragment : FragmentDocumentFor <
162+ UserBalance ,
163+ 'UserBalance'
164+ > = graphql (
137165 `fragment UserBalance on UserBalance {
138166 __typename
139167 info {
@@ -154,6 +182,18 @@ export const UserBalanceFragment = graphql(
154182 borrowApy(metric: HIGHEST) {
155183 ...PercentValue
156184 }
185+ highestSupplyApy: supplyApy(metric: HIGHEST) {
186+ ...PercentValue
187+ }
188+ highestBorrowApy: borrowApy(metric: HIGHEST) {
189+ ...PercentValue
190+ }
191+ lowestSupplyApy: supplyApy(metric: LOWEST) {
192+ ...PercentValue
193+ }
194+ lowestBorrowApy: borrowApy(metric: LOWEST) {
195+ ...PercentValue
196+ }
157197 }` ,
158198 [
159199 TokenInfoFragment ,
@@ -163,7 +203,6 @@ export const UserBalanceFragment = graphql(
163203 PercentValueFragment ,
164204 ] ,
165205) ;
166- export type UserBalance = FragmentOf < typeof UserBalanceFragment > ;
167206
168207// Activity Fragments
169208export const BorrowActivityFragment = graphql (
0 commit comments