@aave/graphql 1.0.0-next.5 → 1.0.0-next.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  input ActivitiesRequest {
7
7
  query: ActivitiesRequestQuery!
8
8
  user: EvmAddress
9
- types: [ActivityFeedType!]! = [BORROW, SUPPLY, WITHDRAW, REPAY, LIQUIDATED, SET_AS_COLLATERAL]
9
+ types: [ActivityType!]! = [BORROW, SUPPLY, WITHDRAW, REPAY, LIQUIDATED, SET_AS_COLLATERAL, UPDATED_DYNAMIC_CONFIG, UPDATED_RISK_PREMIUM]
10
10
  pageSize: PageSize! = FIFTY
11
11
  cursor: Cursor
12
12
  }
@@ -18,19 +18,22 @@ input ActivitiesRequestQuery @oneOf {
18
18
  spokeId: SpokeId
19
19
  chainIds: [ChainId!]
20
20
  txHash: TxHashInput
21
+ userPositionId: UserPositionId
21
22
  }
22
23
 
23
- enum ActivityFeedType {
24
+ union ActivityItem = BorrowActivity | SupplyActivity | WithdrawActivity | RepayActivity | LiquidatedActivity | UsingAsCollateralActivity | UpdatedDynamicConfigActivity | UpdatedRiskPremiumActivity
25
+
26
+ enum ActivityType {
24
27
  SUPPLY
25
28
  BORROW
26
29
  REPAY
27
30
  WITHDRAW
28
31
  LIQUIDATED
29
32
  SET_AS_COLLATERAL
33
+ UPDATED_DYNAMIC_CONFIG
34
+ UPDATED_RISK_PREMIUM
30
35
  }
31
36
 
32
- union ActivityItem = BorrowActivity | SupplyActivity | WithdrawActivity | RepayActivity | LiquidatedActivity | UsingAsCollateralActivity
33
-
34
37
  scalar AlwaysTrue
35
38
 
36
39
  input AmountInput @oneOf {
@@ -51,7 +54,12 @@ type Asset {
51
54
  id: AssetId!
52
55
  token: Erc20Token!
53
56
  summary: AssetSummary!
54
- price(currency: Currency! = USD): FiatAmountWithChange!
57
+ price(currency: Currency! = USD): ExchangeAmountWithChange!
58
+ }
59
+
60
+ type AssetAmountWithChange {
61
+ amount: DecimalNumberWithChange!
62
+ exchange(currency: Currency! = USD): ExchangeAmountWithChange!
55
63
  }
56
64
 
57
65
  input AssetBorrowHistoryRequest {
@@ -67,6 +75,32 @@ input AssetBorrowHistoryRequestQuery @oneOf {
67
75
  type AssetBorrowSample {
68
76
  date: DateTime!
69
77
  amount: DecimalNumber!
78
+ highestAPY: PercentNumber!
79
+ lowestAPY: PercentNumber!
80
+ }
81
+
82
+ input AssetCategoryBorrowHistoryRequest {
83
+ category: TokenCategory!
84
+ window: TimeWindow! = LAST_DAY
85
+ }
86
+
87
+ type AssetCategoryBorrowSample {
88
+ date: DateTime!
89
+ highestAPY: PercentNumber!
90
+ lowestAPY: PercentNumber!
91
+ borrows(currency: Currency! = USD): ExchangeAmount!
92
+ }
93
+
94
+ input AssetCategorySupplyHistoryRequest {
95
+ category: TokenCategory!
96
+ window: TimeWindow! = LAST_DAY
97
+ }
98
+
99
+ type AssetCategorySupplySample {
100
+ date: DateTime!
101
+ highestAPY: PercentNumber!
102
+ lowestAPY: PercentNumber!
103
+ deposits(currency: Currency! = USD): ExchangeAmount!
70
104
  }
71
105
 
72
106
  scalar AssetId
@@ -98,13 +132,11 @@ input AssetRequestQuery @oneOf {
98
132
 
99
133
  type AssetSummary {
100
134
  totalSupplyCap: DecimalNumberWithChange!
101
- totalSupplied: DecimalNumberWithChange!
102
- totalSuppliable: DecimalNumberWithChange!
135
+ totalSupplied: AssetAmountWithChange!
136
+ totalSuppliable: AssetAmountWithChange!
103
137
  totalBorrowCap: DecimalNumberWithChange!
104
- totalBorrowed: DecimalNumberWithChange!
105
- totalBorrowable: DecimalNumberWithChange!
106
- totalSuppliedFiat(currency: Currency! = USD): FiatAmountWithChange!
107
- totalBorrowedFiat(currency: Currency! = USD): FiatAmountWithChange!
138
+ totalBorrowed: AssetAmountWithChange!
139
+ totalBorrowable: AssetAmountWithChange!
108
140
 
109
141
  """The supply APY dependent on what you pass in for the \`metric\`"""
110
142
  supplyApy(metric: ApyMetric! = AVERAGE): PercentNumber!
@@ -126,6 +158,8 @@ input AssetSupplyHistoryRequestQuery @oneOf {
126
158
  type AssetSupplySample {
127
159
  date: DateTime!
128
160
  amount: DecimalNumber!
161
+ highestAPY: PercentNumber!
162
+ lowestAPY: PercentNumber!
129
163
  }
130
164
 
131
165
  scalar BigDecimal
@@ -196,6 +230,7 @@ type Chain {
196
230
  nativeGateway: EvmAddress!
197
231
  signatureGateway: EvmAddress!
198
232
  rpcUrl: String!
233
+ isFork: Boolean!
199
234
  }
200
235
 
201
236
  """A supported blockchain chain ID"""
@@ -206,12 +241,36 @@ input ChainRequest {
206
241
  chainId: ChainId!
207
242
  }
208
243
 
244
+ input ChainTokenInput {
245
+ """The chain id"""
246
+ chainId: ChainId!
247
+
248
+ """The token input"""
249
+ token: TokenInput!
250
+ }
251
+
209
252
  enum ChainsFilter {
210
253
  TESTNET_ONLY
211
254
  MAINNET_ONLY
212
255
  ALL
213
256
  }
214
257
 
258
+ input ChainsRequest {
259
+ query: ChainsRequestQuery!
260
+ }
261
+
262
+ input ChainsRequestQuery @oneOf {
263
+ chainIds: [ChainId!]
264
+ filter: ChainsFilter
265
+ }
266
+
267
+ union ChangedDynamicConfigUserPositionConditions = DynamicConfigUserPositionCollateralFactorVariation | DynamicConfigUserPositionLiquidationFeeVariation | DynamicConfigUserPositionMaxLiquidationBonusVariation
268
+
269
+ enum CollateralMetric {
270
+ HIGHEST
271
+ LOWEST
272
+ }
273
+
215
274
  enum Currency {
216
275
  USD
217
276
  GBP
@@ -247,6 +306,29 @@ type DomainData {
247
306
  verifyingContract: EvmAddress!
248
307
  }
249
308
 
309
+ scalar DynamicConfigKey
310
+
311
+ type DynamicConfigUserPositionCollateralFactorVariation {
312
+ reserveId: ReserveId!
313
+ token: Erc20Token!
314
+ current: PercentNumber!
315
+ after: PercentNumber!
316
+ }
317
+
318
+ type DynamicConfigUserPositionLiquidationFeeVariation {
319
+ reserveId: ReserveId!
320
+ token: Erc20Token!
321
+ current: PercentNumber!
322
+ after: PercentNumber!
323
+ }
324
+
325
+ type DynamicConfigUserPositionMaxLiquidationBonusVariation {
326
+ reserveId: ReserveId!
327
+ token: Erc20Token!
328
+ current: PercentNumber!
329
+ after: PercentNumber!
330
+ }
331
+
250
332
  input ERC20PermitSignature {
251
333
  """The signature for the erc721"""
252
334
  value: Signature!
@@ -255,15 +337,19 @@ input ERC20PermitSignature {
255
337
  deadline: Int!
256
338
  }
257
339
 
340
+ enum EarningPeriod {
341
+ ANNUAL
342
+ }
343
+
258
344
  type Erc20Amount {
259
345
  """The value"""
260
346
  amount: DecimalNumber!
261
347
 
262
- """The fiat amount"""
263
- fiatAmount(currency: Currency! = USD): FiatAmount!
348
+ """The exchange amount"""
349
+ exchange(currency: Currency! = USD): ExchangeAmount!
264
350
 
265
- """The fiat rate"""
266
- fiatRate(currency: Currency! = USD): DecimalNumber!
351
+ """The exchange rate"""
352
+ exchangeRate(currency: Currency! = USD): DecimalNumber!
267
353
  isWrappedNative: Boolean!
268
354
  token: Erc20Token!
269
355
  }
@@ -316,6 +402,24 @@ type Erc20Token {
316
402
 
317
403
  scalar EvmAddress
318
404
 
405
+ type ExchangeAmount {
406
+ value: BigDecimal!
407
+ name: String!
408
+ symbol: String!
409
+ icon: String!
410
+ decimals: Int!
411
+ }
412
+
413
+ type ExchangeAmountValueVariation {
414
+ current: ExchangeAmount!
415
+ after: ExchangeAmount!
416
+ }
417
+
418
+ type ExchangeAmountWithChange {
419
+ current: ExchangeAmount!
420
+ change(window: TimeWindow! = LAST_DAY): PercentNumber!
421
+ }
422
+
319
423
  input ExchangeRateRequest {
320
424
  """The from criteria"""
321
425
  from: ExchangeRateRequestFrom!
@@ -342,22 +446,6 @@ input ExchangeRateRequestFrom @oneOf {
342
446
 
343
447
  union ExecutionPlan = TransactionRequest | Erc20ApprovalRequired | PreContractActionRequired | InsufficientBalanceError
344
448
 
345
- type FiatAmount {
346
- value: BigDecimal!
347
- name: String!
348
- symbol: String!
349
- }
350
-
351
- type FiatAmountValueVariation {
352
- current: FiatAmount!
353
- after: FiatAmount!
354
- }
355
-
356
- type FiatAmountWithChange {
357
- current: FiatAmount!
358
- change(window: TimeWindow! = LAST_DAY): PercentNumber!
359
- }
360
-
361
449
  input ForkTopUpErc20 {
362
450
  """The token address"""
363
451
  currency: EvmAddress!
@@ -542,29 +630,46 @@ input HubRequestQuery @oneOf {
542
630
 
543
631
  type HubSummary {
544
632
  """
545
- The total spoke reserves aggregated borrowed using this hub, showed in fiat as each asset has a different value
633
+ The total spoke reserves aggregated borrowed using this hub, showed in exchange amount as each asset has a different value
546
634
  """
547
- totalBorrowed: FiatAmount!
635
+ totalBorrowed: ExchangeAmountWithChange!
548
636
 
549
637
  """
550
- The total spoke reserves aggregated borrow caps using this hub, showed in fiat as each asset has a different value
638
+ The total spoke reserves aggregated borrow caps using this hub, showed in exchange amount as each asset has a different value
551
639
  """
552
- totalBorrowCap: FiatAmount!
640
+ totalBorrowCap: ExchangeAmount!
553
641
 
554
642
  """
555
- The total spoke reserves aggregated supplied using this hub, showed in fiat as each asset has a different value
643
+ The total spoke reserves aggregated supplied using this hub, showed in exchange amount as each asset has a different value
556
644
  """
557
- totalSupplied: FiatAmount!
645
+ totalSupplied: ExchangeAmountWithChange!
558
646
 
559
647
  """
560
- The total spoke reserves aggregated supply caps using this hub, showed in fiat as each asset has a different value
648
+ The total spoke reserves aggregated supply caps using this hub, showed in exchange amount as each asset has a different value
561
649
  """
562
- totalSupplyCap: FiatAmount!
650
+ totalSupplyCap: ExchangeAmount!
563
651
 
564
- """
565
- The utilization rate"
566
- """
567
- utilizationRate: BigDecimal!
652
+ """The utilization rate"""
653
+ utilizationRate: PercentNumber!
654
+ }
655
+
656
+ input HubSummaryHistoryRequest {
657
+ query: HubSummaryHistoryRequestQuery!
658
+ currency: Currency! = USD
659
+ window: TimeWindow! = LAST_DAY
660
+ }
661
+
662
+ input HubSummaryHistoryRequestQuery @oneOf {
663
+ hubInput: HubInput
664
+ hubId: HubId
665
+ }
666
+
667
+ type HubSummarySample {
668
+ date: DateTime!
669
+ deposits: ExchangeAmount!
670
+ borrows: ExchangeAmount!
671
+ availableLiquidity: ExchangeAmount!
672
+ utilizationRate: PercentNumber!
568
673
  }
569
674
 
570
675
  input HubTokenInput {
@@ -659,11 +764,11 @@ type NativeAmount {
659
764
  """The value"""
660
765
  amount: DecimalNumber!
661
766
 
662
- """The fiat amount"""
663
- fiatAmount(currency: Currency! = USD): FiatAmount!
767
+ """The exchange amount"""
768
+ exchange(currency: Currency! = USD): ExchangeAmount!
664
769
 
665
- """The fiat rate"""
666
- fiatRate(currency: Currency! = USD): DecimalNumber!
770
+ """The exchange rate"""
771
+ exchangeRate(currency: Currency! = USD): DecimalNumber!
667
772
  }
668
773
 
669
774
  type NativeToken {
@@ -741,6 +846,11 @@ type PercentNumber {
741
846
  normalized: BigDecimal!
742
847
  }
743
848
 
849
+ type PercentNumberChangeSnapshot {
850
+ before: PercentNumber!
851
+ after: PercentNumber!
852
+ }
853
+
744
854
  type PercentNumberVariation {
745
855
  current: PercentNumber!
746
856
  after: PercentNumber!
@@ -822,7 +932,8 @@ input PreviewAction @oneOf {
822
932
  borrow: BorrowRequest
823
933
  repay: RepayRequest
824
934
  withdraw: WithdrawRequest
825
- setUserSupplyAsCollateral: SetUserSupplyAsCollateralRequest
935
+ setUserSuppliesAsCollateral: SetUserSuppliesAsCollateralRequest
936
+ updateUserPositionConditions: UpdateUserPositionConditionsRequest
826
937
  }
827
938
 
828
939
  input PreviewRequest {
@@ -836,22 +947,40 @@ type PreviewUserPosition {
836
947
 
837
948
  """The net APY for one user position on a current spoke"""
838
949
  netApy: PercentNumberVariation!
839
- netCollateral(currency: Currency! = USD): FiatAmountValueVariation!
840
- netBalance(currency: Currency! = USD): FiatAmountValueVariation!
950
+ netCollateral(currency: Currency! = USD): ExchangeAmountValueVariation!
951
+ netBalance(currency: Currency! = USD): ExchangeAmountValueVariation!
952
+ projectedEarnings(period: EarningPeriod! = ANNUAL): ExchangeAmountValueVariation!
953
+ borrowingPower: ExchangeAmountValueVariation!
954
+ changedDynamicConfigConditions: [ChangedDynamicConfigUserPositionConditions!]!
955
+ }
956
+
957
+ input ProtocolHistoryRequest {
958
+ currency: Currency! = USD
959
+ window: TimeWindow! = LAST_DAY
960
+ }
961
+
962
+ type ProtocolHistorySample {
963
+ date: DateTime!
964
+ deposits: ExchangeAmount!
965
+ borrows: ExchangeAmount!
966
+ earnings: ExchangeAmount!
841
967
  }
842
968
 
843
969
  type Query {
844
970
  health: Boolean!
845
971
  chain(request: ChainRequest!): Chain
846
- chains(filter: ChainsFilter!): [Chain!]!
972
+ chains(request: ChainsRequest!): [Chain!]!
847
973
 
848
974
  """Generate EIP-712 typed data for EIP-2612 permit signature"""
849
975
  permitTypedData(request: PermitRequest!): PermitTypedDataResponse!
850
976
 
851
977
  """Get the exchange rate of tokens > currency or currency > currency"""
852
- exchangeRate(request: ExchangeRateRequest!): FiatAmount!
978
+ exchangeRate(request: ExchangeRateRequest!): ExchangeAmount!
979
+ protocolHistory(request: ProtocolHistoryRequest!): [ProtocolHistorySample!]!
853
980
  asset(request: AssetRequest!): Asset
854
981
  assetSupplyHistory(request: AssetSupplyHistoryRequest!): [AssetSupplySample!]!
982
+ assetCategoryBorrowHistory(request: AssetCategoryBorrowHistoryRequest!): [AssetCategoryBorrowSample!]!
983
+ assetCategorySupplyHistory(request: AssetCategorySupplyHistoryRequest!): [AssetCategorySupplySample!]!
855
984
  assetBorrowHistory(request: AssetBorrowHistoryRequest!): [AssetBorrowSample!]!
856
985
  assetPriceHistory(request: AssetPriceHistoryRequest!): [AssetPriceSample!]!
857
986
 
@@ -859,6 +988,7 @@ type Query {
859
988
  hubs(request: HubsRequest!): [Hub!]!
860
989
  hub(request: HubRequest!): Hub
861
990
  hubAssets(request: HubAssetsRequest!): [HubAsset!]!
991
+ hubSummaryHistory(request: HubSummaryHistoryRequest!): [HubSummarySample!]!
862
992
  reserve(request: ReserveRequest!): Reserve
863
993
  reserves(request: ReservesRequest!): [Reserve!]!
864
994
  supply(request: SupplyRequest!): ExecutionPlan!
@@ -869,10 +999,9 @@ type Query {
869
999
  spokeUserPositionManagers(request: SpokeUserPositionManagersRequest!): PaginatedSpokeUserPositionManagerResult!
870
1000
  setSpokeUserPositionManager(request: SetSpokeUserPositionManagerRequest!): TransactionRequest!
871
1001
  renounceSpokeUserPositionManager(request: RenounceSpokeUserPositionManagerRequest!): TransactionRequest!
872
- setUserSupplyAsCollateral(request: SetUserSupplyAsCollateralRequest!): TransactionRequest!
1002
+ setUserSuppliesAsCollateral(request: SetUserSuppliesAsCollateralRequest!): TransactionRequest!
873
1003
  liquidatePosition(request: LiquidatePositionRequest!): LiquidatePositionExecutionPlan!
874
- updateUserRiskPremium(request: UpdateUserRiskPremiumRequest!): TransactionRequest!
875
- updateUserDynamicConfig(request: UpdateUserDynamicConfigRequest!): TransactionRequest!
1004
+ updateUserPositionConditions(request: UpdateUserPositionConditionsRequest!): TransactionRequest!
876
1005
  preview(request: PreviewRequest!): PreviewUserPosition!
877
1006
  borrowApyHistory(request: BorrowAPYHistoryRequest!): [APYSample!]!
878
1007
  supplyApyHistory(request: SupplyAPYHistoryRequest!): [APYSample!]!
@@ -892,6 +1021,7 @@ type Query {
892
1021
  userPositions(request: UserPositionsRequest!): [UserPosition!]!
893
1022
  userPosition(request: UserPositionRequest!): UserPosition
894
1023
  userSupplies(request: UserSuppliesRequest!): [UserSupplyItem!]!
1024
+ userRiskPremiumBreakdown(request: UserRiskPremiumBreakdownRequest!): [UserRiskPremiumBreakdownItem!]!
895
1025
 
896
1026
  """
897
1027
  This lets you know the API has processed the known transaction hash, as the API uses caching to make things as fast
@@ -1058,10 +1188,12 @@ input ReserveRequestQuery @oneOf {
1058
1188
  type ReserveSettings {
1059
1189
  collateralFactor: PercentNumber!
1060
1190
  maxLiquidationBonus: PercentNumber!
1191
+ liquidationFee: PercentNumber!
1061
1192
  collateralRisk: PercentNumber!
1062
1193
  borrowable: Boolean!
1063
1194
  collateral: Boolean!
1064
1195
  suppliable: Boolean!
1196
+ latestDynamicConfigKey: DynamicConfigKey!
1065
1197
  }
1066
1198
 
1067
1199
  type ReserveStatus {
@@ -1081,7 +1213,13 @@ type ReserveUserState {
1081
1213
  balance: Erc20Amount!
1082
1214
  suppliable: Erc20Amount!
1083
1215
  borrowable: Erc20Amount!
1216
+ borrowingPower: Erc20Amount!
1084
1217
  borrowApy: PercentNumber!
1218
+ collateralFactor: PercentNumber!
1219
+ maxLiquidationBonus: PercentNumber!
1220
+ liquidationFee: PercentNumber!
1221
+ dynamicConfigKey: DynamicConfigKey!
1222
+ isUsingLatestDynamicConfigKey: Boolean!
1085
1223
  }
1086
1224
 
1087
1225
  input ReservesRequest {
@@ -1103,6 +1241,7 @@ input ReservesRequest {
1103
1241
  enum ReservesRequestFilter {
1104
1242
  SUPPLY
1105
1243
  BORROW
1244
+ COLLATERAL
1106
1245
  ALL
1107
1246
  }
1108
1247
 
@@ -1146,6 +1285,9 @@ input ReservesRequestQuery @oneOf {
1146
1285
 
1147
1286
  """Get all the reserves on based on user position id"""
1148
1287
  userPositionId: UserPositionId
1288
+
1289
+ """Get all the reserves based on the token categories"""
1290
+ categories: [TokenCategory!]
1149
1291
  }
1150
1292
 
1151
1293
  input SetSpokeUserPositionManagerRequest {
@@ -1165,15 +1307,12 @@ input SetSpokeUserPositionManagerRequest {
1165
1307
  signature: ERC20PermitSignature
1166
1308
  }
1167
1309
 
1168
- input SetUserSupplyAsCollateralRequest {
1169
- """The reserve id"""
1170
- reserve: ReserveId!
1310
+ input SetUserSuppliesAsCollateralRequest {
1311
+ """The collateral to make changes to"""
1312
+ changes: [UserSupplyAsCollateral!]!
1171
1313
 
1172
1314
  """The user sending the transaction (normally the user's wallet address)"""
1173
1315
  sender: EvmAddress!
1174
-
1175
- """If you want to enable the collateral or disable"""
1176
- enableCollateral: Boolean!
1177
1316
  }
1178
1317
 
1179
1318
  scalar Signature
@@ -1499,7 +1638,15 @@ union Token = NativeToken | Erc20Token
1499
1638
 
1500
1639
  union TokenAmount = NativeAmount | Erc20Amount
1501
1640
 
1641
+ enum TokenCategory {
1642
+ STABLECOIN
1643
+ ETH_CORRELATED
1644
+ }
1645
+
1502
1646
  type TokenInfo {
1647
+ """The token info id"""
1648
+ id: TokenInfoId!
1649
+
1503
1650
  """The token name"""
1504
1651
  name: String!
1505
1652
 
@@ -1511,8 +1658,13 @@ type TokenInfo {
1511
1658
 
1512
1659
  """The token decimals"""
1513
1660
  decimals: Int!
1661
+
1662
+ """The token category,"""
1663
+ categories: [TokenCategory!]!
1514
1664
  }
1515
1665
 
1666
+ scalar TokenInfoId
1667
+
1516
1668
  input TokenInput @oneOf {
1517
1669
  """Native token"""
1518
1670
  native: AlwaysTrue
@@ -1547,26 +1699,33 @@ type TypeField {
1547
1699
  type: String!
1548
1700
  }
1549
1701
 
1550
- input UpdateUserDynamicConfigRequest {
1551
- """The spoke id"""
1552
- spoke: SpokeId!
1553
-
1554
- """The user sending the transaction (normally the user's wallet address)"""
1555
- sender: EvmAddress!
1556
-
1557
- """If not supplied, this will use \`sender\` which is the normal route"""
1558
- onBehalfOf: EvmAddress
1702
+ input UpdateUserPositionConditionsRequest {
1703
+ userPositionId: UserPositionId!
1704
+ dynamicConfig: Boolean!
1705
+ riskPremium: Boolean!
1559
1706
  }
1560
1707
 
1561
- input UpdateUserRiskPremiumRequest {
1562
- """The spoke id"""
1563
- spoke: SpokeId!
1564
-
1565
- """The user sending the transaction (normally the user's wallet address)"""
1566
- sender: EvmAddress!
1708
+ type UpdatedDynamicConfigActivity {
1709
+ id: ID!
1710
+ user: EvmAddress!
1711
+ timestamp: DateTime!
1712
+ txHash: TxHash!
1713
+ spoke: Spoke!
1714
+ reserve: ReserveInfo!
1715
+ collateralFactor: PercentNumberChangeSnapshot!
1716
+ maxLiquidationBonus: PercentNumberChangeSnapshot!
1717
+ liquidationFee: PercentNumberChangeSnapshot!
1718
+ chain: Chain!
1719
+ }
1567
1720
 
1568
- """If not supplied, this will use \`sender\` which is the normal route"""
1569
- onBehalfOf: EvmAddress
1721
+ type UpdatedRiskPremiumActivity {
1722
+ id: ID!
1723
+ user: EvmAddress!
1724
+ timestamp: DateTime!
1725
+ txHash: TxHash!
1726
+ spoke: Spoke!
1727
+ premium: PercentNumberChangeSnapshot!
1728
+ chain: Chain!
1570
1729
  }
1571
1730
 
1572
1731
  type UserBalance {
@@ -1582,14 +1741,15 @@ type UserBalance {
1582
1741
  """The total amount summed across all balances"""
1583
1742
  totalAmount: DecimalNumber!
1584
1743
 
1585
- """The total fiat amount summed across all balances"""
1586
- fiatAmount(currency: Currency! = USD): FiatAmount!
1744
+ """The total exchange amount summed across all balances"""
1745
+ exchange(currency: Currency! = USD): ExchangeAmount!
1587
1746
 
1588
1747
  """The supply APY dependent on what you pass in for the \`metric\`"""
1589
1748
  supplyApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1590
1749
 
1591
1750
  """The borrow APY dependent on what you pass in for the \`metric\`"""
1592
1751
  borrowApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1752
+ collateralFactor(metric: CollateralMetric! = HIGHEST): PercentNumber
1593
1753
  }
1594
1754
 
1595
1755
  scalar UserBalanceId
@@ -1684,6 +1844,9 @@ input UserBalancesRequestFilter @oneOf {
1684
1844
  The balances for the tokens of the spoke associated with the given user position
1685
1845
  """
1686
1846
  userPosition: UserBalancesByUserPosition
1847
+
1848
+ """The balances for the chains tokens"""
1849
+ tokens: [ChainTokenInput!]
1687
1850
  }
1688
1851
 
1689
1852
  input UserBalancesRequestOrderBy @oneOf {
@@ -1721,15 +1884,13 @@ type UserBorrowItem {
1721
1884
 
1722
1885
  scalar UserBorrowItemId
1723
1886
 
1724
- input UserBorrowsQueryRequest @oneOf {
1887
+ input UserBorrowsAPYBreakdownRequestQuery @oneOf {
1725
1888
  userSpoke: UserSpokeInput
1726
- userToken: UserToken
1727
1889
  userPositionId: UserPositionId
1728
- userChains: UserChains
1729
1890
  }
1730
1891
 
1731
1892
  input UserBorrowsRequest {
1732
- query: UserBorrowsQueryRequest!
1893
+ query: UserBorrowsRequestQuery!
1733
1894
  orderBy: UserBorrowsRequestOrderBy! = {amount: DESC}
1734
1895
 
1735
1896
  """If you wish to include zero balances in the results"""
@@ -1743,11 +1904,32 @@ input UserBorrowsRequestOrderBy @oneOf {
1743
1904
  apy: OrderDirection
1744
1905
  }
1745
1906
 
1907
+ input UserBorrowsRequestQuery @oneOf {
1908
+ userSpoke: UserSpokeInput
1909
+ userToken: UserToken
1910
+ userPositionId: UserPositionId
1911
+ userChains: UserChains
1912
+ userHub: UserHub
1913
+ }
1914
+
1746
1915
  input UserChains {
1747
1916
  user: EvmAddress!
1748
1917
  chainIds: [ChainId!]!
1749
1918
  }
1750
1919
 
1920
+ input UserHub {
1921
+ """The user address"""
1922
+ user: EvmAddress!
1923
+
1924
+ """The user hub input"""
1925
+ hub: UserHubInput!
1926
+ }
1927
+
1928
+ input UserHubInput @oneOf {
1929
+ input: HubInput
1930
+ id: HubId
1931
+ }
1932
+
1751
1933
  type UserPosition {
1752
1934
  """The user position ID"""
1753
1935
  id: UserPositionId!
@@ -1755,27 +1937,29 @@ type UserPosition {
1755
1937
  """The user holding this position"""
1756
1938
  user: EvmAddress!
1757
1939
  createdAt: DateTime!
1758
- totalSupplied(currency: Currency! = USD): FiatAmountWithChange!
1940
+ totalSupplied(currency: Currency! = USD): ExchangeAmountWithChange!
1759
1941
 
1760
1942
  """
1761
1943
  Total collateral which is the full some of the assets supplied which are enabled as collateral
1762
1944
  """
1763
- totalCollateral(currency: Currency! = USD): FiatAmountWithChange!
1945
+ totalCollateral(currency: Currency! = USD): ExchangeAmountWithChange!
1764
1946
 
1765
1947
  """Total debt which is the total amount borrowed plus the accrued premium"""
1766
- totalDebt(currency: Currency! = USD): FiatAmountWithChange!
1948
+ totalDebt(currency: Currency! = USD): ExchangeAmountWithChange!
1767
1949
 
1768
1950
  """The net balance which is \`total_supplied\` - \`borrows\`"""
1769
- netBalance(currency: Currency! = USD): FiatAmountWithChange!
1951
+ netBalance(currency: Currency! = USD): ExchangeAmountWithChange!
1770
1952
 
1771
1953
  """The net collateral which is \`totalCollateral\` - \`totalDebt\`"""
1772
- netCollateral(currency: Currency! = USD): FiatAmountWithChange!
1954
+ netCollateral(currency: Currency! = USD): ExchangeAmountWithChange!
1773
1955
  netApy: PercentNumber!
1774
1956
  netSupplyApy: PercentNumberWithChange!
1775
1957
  netBorrowApy: PercentNumberWithChange!
1776
1958
  healthFactor: HealthFactorWithChange!
1777
- betterRiskPremium: PercentNumber
1778
- riskPremium: PercentNumber!
1959
+ riskPremium: UserPositionRiskPremium
1960
+ liquidationPrice(currency: Currency! = USD): ExchangeAmount
1961
+ borrowingPower(currency: Currency! = USD): ExchangeAmount!
1962
+ isUsingLatestDynamicConfigKey: Boolean!
1779
1963
  netBalancePercentChange(window: TimeWindow! = LAST_DAY): PercentNumber!
1780
1964
  spoke: Spoke!
1781
1965
  averageCollateralFactor: PercentNumber!
@@ -1788,6 +1972,12 @@ input UserPositionRequest @oneOf {
1788
1972
  id: UserPositionId
1789
1973
  }
1790
1974
 
1975
+ type UserPositionRiskPremium {
1976
+ current: PercentNumber!
1977
+ better: PercentNumber
1978
+ breakdown: [UserRiskPremiumBreakdownItem!]!
1979
+ }
1980
+
1791
1981
  input UserPositionsRequest {
1792
1982
  """The user to get the positions for"""
1793
1983
  user: EvmAddress!
@@ -1812,6 +2002,17 @@ input UserPositionsRequestOrderBy @oneOf {
1812
2002
  netCollateral: OrderDirection
1813
2003
  }
1814
2004
 
2005
+ type UserRiskPremiumBreakdownItem {
2006
+ token: Erc20Token!
2007
+ riskPremiumWeight: PercentNumber!
2008
+ collateral: PercentNumber!
2009
+ }
2010
+
2011
+ input UserRiskPremiumBreakdownRequest {
2012
+ query: UserBorrowsAPYBreakdownRequestQuery!
2013
+ user: EvmAddress!
2014
+ }
2015
+
1815
2016
  input UserSpokeInput {
1816
2017
  spoke: SpokeId!
1817
2018
  user: EvmAddress!
@@ -1821,16 +2022,16 @@ type UserSummary {
1821
2022
  totalPositions: Int!
1822
2023
 
1823
2024
  """Net balance = supply - debt"""
1824
- netBalance(currency: Currency! = USD): FiatAmountWithChange!
2025
+ netBalance(currency: Currency! = USD): ExchangeAmountWithChange!
1825
2026
 
1826
2027
  """Total supply where is_collateral is true"""
1827
- totalCollateral(currency: Currency! = USD): FiatAmount!
2028
+ totalCollateral(currency: Currency! = USD): ExchangeAmount!
1828
2029
 
1829
2030
  """Total supplied across all positions"""
1830
- totalSupplied(currency: Currency! = USD): FiatAmount!
2031
+ totalSupplied(currency: Currency! = USD): ExchangeAmount!
1831
2032
 
1832
2033
  """Total debt across all positions"""
1833
- totalDebt(currency: Currency! = USD): FiatAmount!
2034
+ totalDebt(currency: Currency! = USD): ExchangeAmount!
1834
2035
 
1835
2036
  """
1836
2037
  Net APY = (\u03A3 (supplied_amount_i * supply_apy_i) - \u03A3 (borrowed_amount_j * borrow_apy_j)) / (\u03A3 supplied_amount_i)
@@ -1838,7 +2039,7 @@ type UserSummary {
1838
2039
  netApy: PercentNumber!
1839
2040
 
1840
2041
  """Interest earned (net fee earned)"""
1841
- netFeeEarned: FiatAmount!
2042
+ netFeeEarned: ExchangeAmount!
1842
2043
 
1843
2044
  """Lowest health factor across all positions"""
1844
2045
  lowestHealthFactor: BigDecimal
@@ -1856,13 +2057,13 @@ type UserSummaryHistoryItem {
1856
2057
  date: DateTime!
1857
2058
 
1858
2059
  """The aggregated net balance for the time period"""
1859
- netBalance(currency: Currency! = USD): FiatAmount!
2060
+ netBalance(currency: Currency! = USD): ExchangeAmount!
1860
2061
 
1861
2062
  """The aggregated borrows for the time period"""
1862
- borrows(currency: Currency! = USD): FiatAmount!
2063
+ borrows(currency: Currency! = USD): ExchangeAmount!
1863
2064
 
1864
2065
  """The aggregated supplies for the time period"""
1865
- supplies(currency: Currency! = USD): FiatAmount!
2066
+ supplies(currency: Currency! = USD): ExchangeAmount!
1866
2067
  }
1867
2068
 
1868
2069
  input UserSummaryHistoryRequest {
@@ -1876,15 +2077,8 @@ input UserSummaryRequest {
1876
2077
  filter: UserSummaryFilter
1877
2078
  }
1878
2079
 
1879
- input UserSuppliesQueryRequest @oneOf {
1880
- userSpoke: UserSpokeInput
1881
- userToken: UserToken
1882
- userPositionId: UserPositionId
1883
- userChains: UserChains
1884
- }
1885
-
1886
2080
  input UserSuppliesRequest {
1887
- query: UserSuppliesQueryRequest!
2081
+ query: UserSuppliesRequestQuery!
1888
2082
  orderBy: UserSuppliesRequestOrderBy! = {amount: DESC}
1889
2083
 
1890
2084
  """If you wish to include zero balances in the results"""
@@ -1898,6 +2092,22 @@ input UserSuppliesRequestOrderBy @oneOf {
1898
2092
  apy: OrderDirection
1899
2093
  }
1900
2094
 
2095
+ input UserSuppliesRequestQuery @oneOf {
2096
+ userSpoke: UserSpokeInput
2097
+ userToken: UserToken
2098
+ userPositionId: UserPositionId
2099
+ userChains: UserChains
2100
+ userHub: UserHub
2101
+ }
2102
+
2103
+ input UserSupplyAsCollateral {
2104
+ """The reserve id"""
2105
+ reserve: ReserveId!
2106
+
2107
+ """If you want to enable the collateral or disable"""
2108
+ enableCollateral: Boolean!
2109
+ }
2110
+
1901
2111
  type UserSupplyItem {
1902
2112
  """The user supply item id"""
1903
2113
  id: UserSupplyItemId!