@aave/graphql 1.0.0-next.4 → 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
@@ -195,6 +229,8 @@ type Chain {
195
229
  nativeInfo: TokenInfo!
196
230
  nativeGateway: EvmAddress!
197
231
  signatureGateway: EvmAddress!
232
+ rpcUrl: String!
233
+ isFork: Boolean!
198
234
  }
199
235
 
200
236
  """A supported blockchain chain ID"""
@@ -205,12 +241,36 @@ input ChainRequest {
205
241
  chainId: ChainId!
206
242
  }
207
243
 
244
+ input ChainTokenInput {
245
+ """The chain id"""
246
+ chainId: ChainId!
247
+
248
+ """The token input"""
249
+ token: TokenInput!
250
+ }
251
+
208
252
  enum ChainsFilter {
209
253
  TESTNET_ONLY
210
254
  MAINNET_ONLY
211
255
  ALL
212
256
  }
213
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
+
214
274
  enum Currency {
215
275
  USD
216
276
  GBP
@@ -246,6 +306,29 @@ type DomainData {
246
306
  verifyingContract: EvmAddress!
247
307
  }
248
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
+
249
332
  input ERC20PermitSignature {
250
333
  """The signature for the erc721"""
251
334
  value: Signature!
@@ -254,15 +337,19 @@ input ERC20PermitSignature {
254
337
  deadline: Int!
255
338
  }
256
339
 
340
+ enum EarningPeriod {
341
+ ANNUAL
342
+ }
343
+
257
344
  type Erc20Amount {
258
345
  """The value"""
259
346
  amount: DecimalNumber!
260
347
 
261
- """The fiat amount"""
262
- fiatAmount(currency: Currency! = USD): FiatAmount!
348
+ """The exchange amount"""
349
+ exchange(currency: Currency! = USD): ExchangeAmount!
263
350
 
264
- """The fiat rate"""
265
- fiatRate(currency: Currency! = USD): DecimalNumber!
351
+ """The exchange rate"""
352
+ exchangeRate(currency: Currency! = USD): DecimalNumber!
266
353
  isWrappedNative: Boolean!
267
354
  token: Erc20Token!
268
355
  }
@@ -315,6 +402,24 @@ type Erc20Token {
315
402
 
316
403
  scalar EvmAddress
317
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
+
318
423
  input ExchangeRateRequest {
319
424
  """The from criteria"""
320
425
  from: ExchangeRateRequestFrom!
@@ -341,22 +446,6 @@ input ExchangeRateRequestFrom @oneOf {
341
446
 
342
447
  union ExecutionPlan = TransactionRequest | Erc20ApprovalRequired | PreContractActionRequired | InsufficientBalanceError
343
448
 
344
- type FiatAmount {
345
- value: BigDecimal!
346
- name: String!
347
- symbol: String!
348
- }
349
-
350
- type FiatAmountValueVariation {
351
- current: FiatAmount!
352
- after: FiatAmount!
353
- }
354
-
355
- type FiatAmountWithChange {
356
- current: FiatAmount!
357
- change(window: TimeWindow! = LAST_DAY): PercentNumber!
358
- }
359
-
360
449
  input ForkTopUpErc20 {
361
450
  """The token address"""
362
451
  currency: EvmAddress!
@@ -541,29 +630,46 @@ input HubRequestQuery @oneOf {
541
630
 
542
631
  type HubSummary {
543
632
  """
544
- 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
545
634
  """
546
- totalBorrowed: FiatAmount!
635
+ totalBorrowed: ExchangeAmountWithChange!
547
636
 
548
637
  """
549
- 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
550
639
  """
551
- totalBorrowCap: FiatAmount!
640
+ totalBorrowCap: ExchangeAmount!
552
641
 
553
642
  """
554
- 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
555
644
  """
556
- totalSupplied: FiatAmount!
645
+ totalSupplied: ExchangeAmountWithChange!
557
646
 
558
647
  """
559
- 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
560
649
  """
561
- totalSupplyCap: FiatAmount!
650
+ totalSupplyCap: ExchangeAmount!
562
651
 
563
- """
564
- The utilization rate"
565
- """
566
- 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!
567
673
  }
568
674
 
569
675
  input HubTokenInput {
@@ -658,11 +764,11 @@ type NativeAmount {
658
764
  """The value"""
659
765
  amount: DecimalNumber!
660
766
 
661
- """The fiat amount"""
662
- fiatAmount(currency: Currency! = USD): FiatAmount!
767
+ """The exchange amount"""
768
+ exchange(currency: Currency! = USD): ExchangeAmount!
663
769
 
664
- """The fiat rate"""
665
- fiatRate(currency: Currency! = USD): DecimalNumber!
770
+ """The exchange rate"""
771
+ exchangeRate(currency: Currency! = USD): DecimalNumber!
666
772
  }
667
773
 
668
774
  type NativeToken {
@@ -740,6 +846,11 @@ type PercentNumber {
740
846
  normalized: BigDecimal!
741
847
  }
742
848
 
849
+ type PercentNumberChangeSnapshot {
850
+ before: PercentNumber!
851
+ after: PercentNumber!
852
+ }
853
+
743
854
  type PercentNumberVariation {
744
855
  current: PercentNumber!
745
856
  after: PercentNumber!
@@ -821,7 +932,8 @@ input PreviewAction @oneOf {
821
932
  borrow: BorrowRequest
822
933
  repay: RepayRequest
823
934
  withdraw: WithdrawRequest
824
- setUserSupplyAsCollateral: SetUserSupplyAsCollateralRequest
935
+ setUserSuppliesAsCollateral: SetUserSuppliesAsCollateralRequest
936
+ updateUserPositionConditions: UpdateUserPositionConditionsRequest
825
937
  }
826
938
 
827
939
  input PreviewRequest {
@@ -835,22 +947,40 @@ type PreviewUserPosition {
835
947
 
836
948
  """The net APY for one user position on a current spoke"""
837
949
  netApy: PercentNumberVariation!
838
- netCollateral(currency: Currency! = USD): FiatAmountValueVariation!
839
- 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!
840
967
  }
841
968
 
842
969
  type Query {
843
970
  health: Boolean!
844
971
  chain(request: ChainRequest!): Chain
845
- chains(filter: ChainsFilter!): [Chain!]!
972
+ chains(request: ChainsRequest!): [Chain!]!
846
973
 
847
974
  """Generate EIP-712 typed data for EIP-2612 permit signature"""
848
975
  permitTypedData(request: PermitRequest!): PermitTypedDataResponse!
849
976
 
850
977
  """Get the exchange rate of tokens > currency or currency > currency"""
851
- exchangeRate(request: ExchangeRateRequest!): FiatAmount!
978
+ exchangeRate(request: ExchangeRateRequest!): ExchangeAmount!
979
+ protocolHistory(request: ProtocolHistoryRequest!): [ProtocolHistorySample!]!
852
980
  asset(request: AssetRequest!): Asset
853
981
  assetSupplyHistory(request: AssetSupplyHistoryRequest!): [AssetSupplySample!]!
982
+ assetCategoryBorrowHistory(request: AssetCategoryBorrowHistoryRequest!): [AssetCategoryBorrowSample!]!
983
+ assetCategorySupplyHistory(request: AssetCategorySupplyHistoryRequest!): [AssetCategorySupplySample!]!
854
984
  assetBorrowHistory(request: AssetBorrowHistoryRequest!): [AssetBorrowSample!]!
855
985
  assetPriceHistory(request: AssetPriceHistoryRequest!): [AssetPriceSample!]!
856
986
 
@@ -858,6 +988,7 @@ type Query {
858
988
  hubs(request: HubsRequest!): [Hub!]!
859
989
  hub(request: HubRequest!): Hub
860
990
  hubAssets(request: HubAssetsRequest!): [HubAsset!]!
991
+ hubSummaryHistory(request: HubSummaryHistoryRequest!): [HubSummarySample!]!
861
992
  reserve(request: ReserveRequest!): Reserve
862
993
  reserves(request: ReservesRequest!): [Reserve!]!
863
994
  supply(request: SupplyRequest!): ExecutionPlan!
@@ -868,10 +999,9 @@ type Query {
868
999
  spokeUserPositionManagers(request: SpokeUserPositionManagersRequest!): PaginatedSpokeUserPositionManagerResult!
869
1000
  setSpokeUserPositionManager(request: SetSpokeUserPositionManagerRequest!): TransactionRequest!
870
1001
  renounceSpokeUserPositionManager(request: RenounceSpokeUserPositionManagerRequest!): TransactionRequest!
871
- setUserSupplyAsCollateral(request: SetUserSupplyAsCollateralRequest!): TransactionRequest!
1002
+ setUserSuppliesAsCollateral(request: SetUserSuppliesAsCollateralRequest!): TransactionRequest!
872
1003
  liquidatePosition(request: LiquidatePositionRequest!): LiquidatePositionExecutionPlan!
873
- updateUserRiskPremium(request: UpdateUserRiskPremiumRequest!): TransactionRequest!
874
- updateUserDynamicConfig(request: UpdateUserDynamicConfigRequest!): TransactionRequest!
1004
+ updateUserPositionConditions(request: UpdateUserPositionConditionsRequest!): TransactionRequest!
875
1005
  preview(request: PreviewRequest!): PreviewUserPosition!
876
1006
  borrowApyHistory(request: BorrowAPYHistoryRequest!): [APYSample!]!
877
1007
  supplyApyHistory(request: SupplyAPYHistoryRequest!): [APYSample!]!
@@ -891,6 +1021,7 @@ type Query {
891
1021
  userPositions(request: UserPositionsRequest!): [UserPosition!]!
892
1022
  userPosition(request: UserPositionRequest!): UserPosition
893
1023
  userSupplies(request: UserSuppliesRequest!): [UserSupplyItem!]!
1024
+ userRiskPremiumBreakdown(request: UserRiskPremiumBreakdownRequest!): [UserRiskPremiumBreakdownItem!]!
894
1025
 
895
1026
  """
896
1027
  This lets you know the API has processed the known transaction hash, as the API uses caching to make things as fast
@@ -1057,10 +1188,12 @@ input ReserveRequestQuery @oneOf {
1057
1188
  type ReserveSettings {
1058
1189
  collateralFactor: PercentNumber!
1059
1190
  maxLiquidationBonus: PercentNumber!
1191
+ liquidationFee: PercentNumber!
1060
1192
  collateralRisk: PercentNumber!
1061
1193
  borrowable: Boolean!
1062
1194
  collateral: Boolean!
1063
1195
  suppliable: Boolean!
1196
+ latestDynamicConfigKey: DynamicConfigKey!
1064
1197
  }
1065
1198
 
1066
1199
  type ReserveStatus {
@@ -1080,7 +1213,13 @@ type ReserveUserState {
1080
1213
  balance: Erc20Amount!
1081
1214
  suppliable: Erc20Amount!
1082
1215
  borrowable: Erc20Amount!
1216
+ borrowingPower: Erc20Amount!
1083
1217
  borrowApy: PercentNumber!
1218
+ collateralFactor: PercentNumber!
1219
+ maxLiquidationBonus: PercentNumber!
1220
+ liquidationFee: PercentNumber!
1221
+ dynamicConfigKey: DynamicConfigKey!
1222
+ isUsingLatestDynamicConfigKey: Boolean!
1084
1223
  }
1085
1224
 
1086
1225
  input ReservesRequest {
@@ -1102,6 +1241,7 @@ input ReservesRequest {
1102
1241
  enum ReservesRequestFilter {
1103
1242
  SUPPLY
1104
1243
  BORROW
1244
+ COLLATERAL
1105
1245
  ALL
1106
1246
  }
1107
1247
 
@@ -1145,6 +1285,9 @@ input ReservesRequestQuery @oneOf {
1145
1285
 
1146
1286
  """Get all the reserves on based on user position id"""
1147
1287
  userPositionId: UserPositionId
1288
+
1289
+ """Get all the reserves based on the token categories"""
1290
+ categories: [TokenCategory!]
1148
1291
  }
1149
1292
 
1150
1293
  input SetSpokeUserPositionManagerRequest {
@@ -1164,15 +1307,12 @@ input SetSpokeUserPositionManagerRequest {
1164
1307
  signature: ERC20PermitSignature
1165
1308
  }
1166
1309
 
1167
- input SetUserSupplyAsCollateralRequest {
1168
- """The reserve id"""
1169
- reserve: ReserveId!
1310
+ input SetUserSuppliesAsCollateralRequest {
1311
+ """The collateral to make changes to"""
1312
+ changes: [UserSupplyAsCollateral!]!
1170
1313
 
1171
1314
  """The user sending the transaction (normally the user's wallet address)"""
1172
1315
  sender: EvmAddress!
1173
-
1174
- """If you want to enable the collateral or disable"""
1175
- enableCollateral: Boolean!
1176
1316
  }
1177
1317
 
1178
1318
  scalar Signature
@@ -1498,7 +1638,15 @@ union Token = NativeToken | Erc20Token
1498
1638
 
1499
1639
  union TokenAmount = NativeAmount | Erc20Amount
1500
1640
 
1641
+ enum TokenCategory {
1642
+ STABLECOIN
1643
+ ETH_CORRELATED
1644
+ }
1645
+
1501
1646
  type TokenInfo {
1647
+ """The token info id"""
1648
+ id: TokenInfoId!
1649
+
1502
1650
  """The token name"""
1503
1651
  name: String!
1504
1652
 
@@ -1510,8 +1658,13 @@ type TokenInfo {
1510
1658
 
1511
1659
  """The token decimals"""
1512
1660
  decimals: Int!
1661
+
1662
+ """The token category,"""
1663
+ categories: [TokenCategory!]!
1513
1664
  }
1514
1665
 
1666
+ scalar TokenInfoId
1667
+
1515
1668
  input TokenInput @oneOf {
1516
1669
  """Native token"""
1517
1670
  native: AlwaysTrue
@@ -1546,26 +1699,33 @@ type TypeField {
1546
1699
  type: String!
1547
1700
  }
1548
1701
 
1549
- input UpdateUserDynamicConfigRequest {
1550
- """The spoke id"""
1551
- spoke: SpokeId!
1552
-
1553
- """The user sending the transaction (normally the user's wallet address)"""
1554
- sender: EvmAddress!
1555
-
1556
- """If not supplied, this will use \`sender\` which is the normal route"""
1557
- onBehalfOf: EvmAddress
1702
+ input UpdateUserPositionConditionsRequest {
1703
+ userPositionId: UserPositionId!
1704
+ dynamicConfig: Boolean!
1705
+ riskPremium: Boolean!
1558
1706
  }
1559
1707
 
1560
- input UpdateUserRiskPremiumRequest {
1561
- """The spoke id"""
1562
- spoke: SpokeId!
1563
-
1564
- """The user sending the transaction (normally the user's wallet address)"""
1565
- 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
+ }
1566
1720
 
1567
- """If not supplied, this will use \`sender\` which is the normal route"""
1568
- 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!
1569
1729
  }
1570
1730
 
1571
1731
  type UserBalance {
@@ -1581,14 +1741,15 @@ type UserBalance {
1581
1741
  """The total amount summed across all balances"""
1582
1742
  totalAmount: DecimalNumber!
1583
1743
 
1584
- """The total fiat amount summed across all balances"""
1585
- fiatAmount(currency: Currency! = USD): FiatAmount!
1744
+ """The total exchange amount summed across all balances"""
1745
+ exchange(currency: Currency! = USD): ExchangeAmount!
1586
1746
 
1587
1747
  """The supply APY dependent on what you pass in for the \`metric\`"""
1588
1748
  supplyApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1589
1749
 
1590
1750
  """The borrow APY dependent on what you pass in for the \`metric\`"""
1591
1751
  borrowApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1752
+ collateralFactor(metric: CollateralMetric! = HIGHEST): PercentNumber
1592
1753
  }
1593
1754
 
1594
1755
  scalar UserBalanceId
@@ -1683,6 +1844,9 @@ input UserBalancesRequestFilter @oneOf {
1683
1844
  The balances for the tokens of the spoke associated with the given user position
1684
1845
  """
1685
1846
  userPosition: UserBalancesByUserPosition
1847
+
1848
+ """The balances for the chains tokens"""
1849
+ tokens: [ChainTokenInput!]
1686
1850
  }
1687
1851
 
1688
1852
  input UserBalancesRequestOrderBy @oneOf {
@@ -1720,15 +1884,13 @@ type UserBorrowItem {
1720
1884
 
1721
1885
  scalar UserBorrowItemId
1722
1886
 
1723
- input UserBorrowsQueryRequest @oneOf {
1887
+ input UserBorrowsAPYBreakdownRequestQuery @oneOf {
1724
1888
  userSpoke: UserSpokeInput
1725
- userToken: UserToken
1726
1889
  userPositionId: UserPositionId
1727
- userChains: UserChains
1728
1890
  }
1729
1891
 
1730
1892
  input UserBorrowsRequest {
1731
- query: UserBorrowsQueryRequest!
1893
+ query: UserBorrowsRequestQuery!
1732
1894
  orderBy: UserBorrowsRequestOrderBy! = {amount: DESC}
1733
1895
 
1734
1896
  """If you wish to include zero balances in the results"""
@@ -1742,11 +1904,32 @@ input UserBorrowsRequestOrderBy @oneOf {
1742
1904
  apy: OrderDirection
1743
1905
  }
1744
1906
 
1907
+ input UserBorrowsRequestQuery @oneOf {
1908
+ userSpoke: UserSpokeInput
1909
+ userToken: UserToken
1910
+ userPositionId: UserPositionId
1911
+ userChains: UserChains
1912
+ userHub: UserHub
1913
+ }
1914
+
1745
1915
  input UserChains {
1746
1916
  user: EvmAddress!
1747
1917
  chainIds: [ChainId!]!
1748
1918
  }
1749
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
+
1750
1933
  type UserPosition {
1751
1934
  """The user position ID"""
1752
1935
  id: UserPositionId!
@@ -1754,27 +1937,29 @@ type UserPosition {
1754
1937
  """The user holding this position"""
1755
1938
  user: EvmAddress!
1756
1939
  createdAt: DateTime!
1757
- totalSupplied(currency: Currency! = USD): FiatAmountWithChange!
1940
+ totalSupplied(currency: Currency! = USD): ExchangeAmountWithChange!
1758
1941
 
1759
1942
  """
1760
1943
  Total collateral which is the full some of the assets supplied which are enabled as collateral
1761
1944
  """
1762
- totalCollateral(currency: Currency! = USD): FiatAmountWithChange!
1945
+ totalCollateral(currency: Currency! = USD): ExchangeAmountWithChange!
1763
1946
 
1764
1947
  """Total debt which is the total amount borrowed plus the accrued premium"""
1765
- totalDebt(currency: Currency! = USD): FiatAmountWithChange!
1948
+ totalDebt(currency: Currency! = USD): ExchangeAmountWithChange!
1766
1949
 
1767
1950
  """The net balance which is \`total_supplied\` - \`borrows\`"""
1768
- netBalance(currency: Currency! = USD): FiatAmountWithChange!
1951
+ netBalance(currency: Currency! = USD): ExchangeAmountWithChange!
1769
1952
 
1770
1953
  """The net collateral which is \`totalCollateral\` - \`totalDebt\`"""
1771
- netCollateral(currency: Currency! = USD): FiatAmountWithChange!
1954
+ netCollateral(currency: Currency! = USD): ExchangeAmountWithChange!
1772
1955
  netApy: PercentNumber!
1773
1956
  netSupplyApy: PercentNumberWithChange!
1774
1957
  netBorrowApy: PercentNumberWithChange!
1775
1958
  healthFactor: HealthFactorWithChange!
1776
- betterRiskPremium: PercentNumber
1777
- riskPremium: PercentNumber!
1959
+ riskPremium: UserPositionRiskPremium
1960
+ liquidationPrice(currency: Currency! = USD): ExchangeAmount
1961
+ borrowingPower(currency: Currency! = USD): ExchangeAmount!
1962
+ isUsingLatestDynamicConfigKey: Boolean!
1778
1963
  netBalancePercentChange(window: TimeWindow! = LAST_DAY): PercentNumber!
1779
1964
  spoke: Spoke!
1780
1965
  averageCollateralFactor: PercentNumber!
@@ -1787,6 +1972,12 @@ input UserPositionRequest @oneOf {
1787
1972
  id: UserPositionId
1788
1973
  }
1789
1974
 
1975
+ type UserPositionRiskPremium {
1976
+ current: PercentNumber!
1977
+ better: PercentNumber
1978
+ breakdown: [UserRiskPremiumBreakdownItem!]!
1979
+ }
1980
+
1790
1981
  input UserPositionsRequest {
1791
1982
  """The user to get the positions for"""
1792
1983
  user: EvmAddress!
@@ -1811,6 +2002,17 @@ input UserPositionsRequestOrderBy @oneOf {
1811
2002
  netCollateral: OrderDirection
1812
2003
  }
1813
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
+
1814
2016
  input UserSpokeInput {
1815
2017
  spoke: SpokeId!
1816
2018
  user: EvmAddress!
@@ -1820,16 +2022,16 @@ type UserSummary {
1820
2022
  totalPositions: Int!
1821
2023
 
1822
2024
  """Net balance = supply - debt"""
1823
- netBalance(currency: Currency! = USD): FiatAmountWithChange!
2025
+ netBalance(currency: Currency! = USD): ExchangeAmountWithChange!
1824
2026
 
1825
2027
  """Total supply where is_collateral is true"""
1826
- totalCollateral(currency: Currency! = USD): FiatAmount!
2028
+ totalCollateral(currency: Currency! = USD): ExchangeAmount!
1827
2029
 
1828
2030
  """Total supplied across all positions"""
1829
- totalSupplied(currency: Currency! = USD): FiatAmount!
2031
+ totalSupplied(currency: Currency! = USD): ExchangeAmount!
1830
2032
 
1831
2033
  """Total debt across all positions"""
1832
- totalDebt(currency: Currency! = USD): FiatAmount!
2034
+ totalDebt(currency: Currency! = USD): ExchangeAmount!
1833
2035
 
1834
2036
  """
1835
2037
  Net APY = (\u03A3 (supplied_amount_i * supply_apy_i) - \u03A3 (borrowed_amount_j * borrow_apy_j)) / (\u03A3 supplied_amount_i)
@@ -1837,7 +2039,7 @@ type UserSummary {
1837
2039
  netApy: PercentNumber!
1838
2040
 
1839
2041
  """Interest earned (net fee earned)"""
1840
- netFeeEarned: FiatAmount!
2042
+ netFeeEarned: ExchangeAmount!
1841
2043
 
1842
2044
  """Lowest health factor across all positions"""
1843
2045
  lowestHealthFactor: BigDecimal
@@ -1855,13 +2057,13 @@ type UserSummaryHistoryItem {
1855
2057
  date: DateTime!
1856
2058
 
1857
2059
  """The aggregated net balance for the time period"""
1858
- netBalance(currency: Currency! = USD): FiatAmount!
2060
+ netBalance(currency: Currency! = USD): ExchangeAmount!
1859
2061
 
1860
2062
  """The aggregated borrows for the time period"""
1861
- borrows(currency: Currency! = USD): FiatAmount!
2063
+ borrows(currency: Currency! = USD): ExchangeAmount!
1862
2064
 
1863
2065
  """The aggregated supplies for the time period"""
1864
- supplies(currency: Currency! = USD): FiatAmount!
2066
+ supplies(currency: Currency! = USD): ExchangeAmount!
1865
2067
  }
1866
2068
 
1867
2069
  input UserSummaryHistoryRequest {
@@ -1875,15 +2077,8 @@ input UserSummaryRequest {
1875
2077
  filter: UserSummaryFilter
1876
2078
  }
1877
2079
 
1878
- input UserSuppliesQueryRequest @oneOf {
1879
- userSpoke: UserSpokeInput
1880
- userToken: UserToken
1881
- userPositionId: UserPositionId
1882
- userChains: UserChains
1883
- }
1884
-
1885
2080
  input UserSuppliesRequest {
1886
- query: UserSuppliesQueryRequest!
2081
+ query: UserSuppliesRequestQuery!
1887
2082
  orderBy: UserSuppliesRequestOrderBy! = {amount: DESC}
1888
2083
 
1889
2084
  """If you wish to include zero balances in the results"""
@@ -1897,6 +2092,22 @@ input UserSuppliesRequestOrderBy @oneOf {
1897
2092
  apy: OrderDirection
1898
2093
  }
1899
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
+
1900
2111
  type UserSupplyItem {
1901
2112
  """The user supply item id"""
1902
2113
  id: UserSupplyItemId!