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

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.
@@ -1,12 +1,7 @@
1
- import {buildSchema}from'graphql';var e=`type APYSample {
2
- date: DateTime!
3
- avgRate: PercentNumber!
4
- }
5
-
6
- input ActivitiesRequest {
1
+ import {buildSchema}from'graphql';var e=`input ActivitiesRequest {
7
2
  query: ActivitiesRequestQuery!
8
3
  user: EvmAddress
9
- types: [ActivityFeedType!]! = [BORROW, SUPPLY, WITHDRAW, REPAY, LIQUIDATED, SET_AS_COLLATERAL]
4
+ types: [ActivityType!]! = [BORROW, SUPPLY, WITHDRAW, REPAY, LIQUIDATED, SET_AS_COLLATERAL, UPDATED_DYNAMIC_CONFIG, UPDATED_RISK_PREMIUM]
10
5
  pageSize: PageSize! = FIFTY
11
6
  cursor: Cursor
12
7
  }
@@ -18,19 +13,22 @@ input ActivitiesRequestQuery @oneOf {
18
13
  spokeId: SpokeId
19
14
  chainIds: [ChainId!]
20
15
  txHash: TxHashInput
16
+ userPositionId: UserPositionId
21
17
  }
22
18
 
23
- enum ActivityFeedType {
19
+ union ActivityItem = BorrowActivity | SupplyActivity | WithdrawActivity | RepayActivity | LiquidatedActivity | UsingAsCollateralActivity | UpdatedDynamicConfigActivity | UpdatedRiskPremiumActivity
20
+
21
+ enum ActivityType {
24
22
  SUPPLY
25
23
  BORROW
26
24
  REPAY
27
25
  WITHDRAW
28
26
  LIQUIDATED
29
27
  SET_AS_COLLATERAL
28
+ UPDATED_DYNAMIC_CONFIG
29
+ UPDATED_RISK_PREMIUM
30
30
  }
31
31
 
32
- union ActivityItem = BorrowActivity | SupplyActivity | WithdrawActivity | RepayActivity | LiquidatedActivity | UsingAsCollateralActivity
33
-
34
32
  scalar AlwaysTrue
35
33
 
36
34
  input AmountInput @oneOf {
@@ -47,11 +45,21 @@ enum ApyMetric {
47
45
  AVERAGE
48
46
  }
49
47
 
48
+ type ApySample {
49
+ date: DateTime!
50
+ avgRate: PercentNumber!
51
+ }
52
+
50
53
  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,15 +132,13 @@ 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
- """The supply APY dependent on what you pass in for the \`metric\`"""
141
+ """The supply apy dependent on what you pass in for the \`metric\`"""
110
142
  supplyApy(metric: ApyMetric! = AVERAGE): PercentNumber!
111
143
 
112
144
  """The borrow APY dependent on what you pass in for the \`metric\`"""
@@ -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
@@ -134,11 +168,6 @@ scalar BigInt
134
168
 
135
169
  scalar BlockchainData
136
170
 
137
- input BorrowAPYHistoryRequest {
138
- reserve: ReserveId!
139
- window: TimeWindow! = LAST_DAY
140
- }
141
-
142
171
  type BorrowActivity {
143
172
  id: ID!
144
173
  user: EvmAddress!
@@ -150,6 +179,11 @@ type BorrowActivity {
150
179
  chain: Chain!
151
180
  }
152
181
 
182
+ input BorrowApyHistoryRequest {
183
+ reserve: ReserveId!
184
+ window: TimeWindow! = LAST_DAY
185
+ }
186
+
153
187
  input BorrowRequest {
154
188
  """The reserve id"""
155
189
  reserve: ReserveId!
@@ -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!
@@ -480,13 +568,13 @@ type HubAssetSummary {
480
568
  """The available liquidity"""
481
569
  availableLiquidity: Erc20Amount!
482
570
 
483
- """The supply APY"""
571
+ """The supply apy"""
484
572
  supplyApy: PercentNumber!
485
573
 
486
- """The borrow APY"""
574
+ """The borrow apy"""
487
575
  borrowApy: PercentNumber!
488
576
 
489
- """The net APY"""
577
+ """The net apy"""
490
578
  netApy: PercentNumber!
491
579
 
492
580
  """The utilization rate"""
@@ -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 {
@@ -834,24 +945,42 @@ type PreviewUserPosition {
834
945
  healthFactor: HealthFactorResult!
835
946
  riskPremium: PercentNumberVariation!
836
947
 
837
- """The net APY for one user position on a current spoke"""
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,13 +999,12 @@ 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
- borrowApyHistory(request: BorrowAPYHistoryRequest!): [APYSample!]!
878
- supplyApyHistory(request: SupplyAPYHistoryRequest!): [APYSample!]!
1006
+ borrowApyHistory(request: BorrowApyHistoryRequest!): [ApySample!]!
1007
+ supplyApyHistory(request: SupplyApyHistoryRequest!): [ApySample!]!
879
1008
  spoke(request: SpokeRequest!): Spoke
880
1009
 
881
1010
  """Lists all spokes"""
@@ -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
@@ -1271,11 +1410,6 @@ input SpokesRequestQuery @oneOf {
1271
1410
  chainIds: [ChainId!]
1272
1411
  }
1273
1412
 
1274
- input SupplyAPYHistoryRequest {
1275
- reserve: ReserveId!
1276
- window: TimeWindow! = LAST_DAY
1277
- }
1278
-
1279
1413
  type SupplyActivity {
1280
1414
  id: ID!
1281
1415
  user: EvmAddress!
@@ -1287,6 +1421,11 @@ type SupplyActivity {
1287
1421
  chain: Chain!
1288
1422
  }
1289
1423
 
1424
+ input SupplyApyHistoryRequest {
1425
+ reserve: ReserveId!
1426
+ window: TimeWindow! = LAST_DAY
1427
+ }
1428
+
1290
1429
  input SupplyPermitRequest {
1291
1430
  """The reserve id"""
1292
1431
  reserve: ReserveId!
@@ -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
- """The supply APY dependent on what you pass in for the \`metric\`"""
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
@@ -1640,6 +1800,16 @@ input UserBalancesBySpoke {
1640
1800
  byReservesType: ReservesRequestFilter! = ALL
1641
1801
  }
1642
1802
 
1803
+ input UserBalancesByTokens {
1804
+ """The chain token input"""
1805
+ chainTokens: [ChainTokenInput!]!
1806
+
1807
+ """
1808
+ The type of reserve to use when determine the tokens to retrieve balances for
1809
+ """
1810
+ byReservesType: ReservesRequestFilter! = ALL
1811
+ }
1812
+
1643
1813
  input UserBalancesByUserPosition {
1644
1814
  """The user position id"""
1645
1815
  userPositionId: UserPositionId!
@@ -1684,6 +1854,9 @@ input UserBalancesRequestFilter @oneOf {
1684
1854
  The balances for the tokens of the spoke associated with the given user position
1685
1855
  """
1686
1856
  userPosition: UserBalancesByUserPosition
1857
+
1858
+ """The balances for the chains tokens"""
1859
+ tokens: UserBalancesByTokens
1687
1860
  }
1688
1861
 
1689
1862
  input UserBalancesRequestOrderBy @oneOf {
@@ -1721,15 +1894,8 @@ type UserBorrowItem {
1721
1894
 
1722
1895
  scalar UserBorrowItemId
1723
1896
 
1724
- input UserBorrowsQueryRequest @oneOf {
1725
- userSpoke: UserSpokeInput
1726
- userToken: UserToken
1727
- userPositionId: UserPositionId
1728
- userChains: UserChains
1729
- }
1730
-
1731
1897
  input UserBorrowsRequest {
1732
- query: UserBorrowsQueryRequest!
1898
+ query: UserBorrowsRequestQuery!
1733
1899
  orderBy: UserBorrowsRequestOrderBy! = {amount: DESC}
1734
1900
 
1735
1901
  """If you wish to include zero balances in the results"""
@@ -1743,11 +1909,32 @@ input UserBorrowsRequestOrderBy @oneOf {
1743
1909
  apy: OrderDirection
1744
1910
  }
1745
1911
 
1912
+ input UserBorrowsRequestQuery @oneOf {
1913
+ userSpoke: UserSpokeInput
1914
+ userToken: UserToken
1915
+ userPositionId: UserPositionId
1916
+ userChains: UserChains
1917
+ userHub: UserHub
1918
+ }
1919
+
1746
1920
  input UserChains {
1747
1921
  user: EvmAddress!
1748
1922
  chainIds: [ChainId!]!
1749
1923
  }
1750
1924
 
1925
+ input UserHub {
1926
+ """The user address"""
1927
+ user: EvmAddress!
1928
+
1929
+ """The user hub input"""
1930
+ hub: UserHubInput!
1931
+ }
1932
+
1933
+ input UserHubInput @oneOf {
1934
+ input: HubInput
1935
+ id: HubId
1936
+ }
1937
+
1751
1938
  type UserPosition {
1752
1939
  """The user position ID"""
1753
1940
  id: UserPositionId!
@@ -1755,27 +1942,29 @@ type UserPosition {
1755
1942
  """The user holding this position"""
1756
1943
  user: EvmAddress!
1757
1944
  createdAt: DateTime!
1758
- totalSupplied(currency: Currency! = USD): FiatAmountWithChange!
1945
+ totalSupplied(currency: Currency! = USD): ExchangeAmountWithChange!
1759
1946
 
1760
1947
  """
1761
1948
  Total collateral which is the full some of the assets supplied which are enabled as collateral
1762
1949
  """
1763
- totalCollateral(currency: Currency! = USD): FiatAmountWithChange!
1950
+ totalCollateral(currency: Currency! = USD): ExchangeAmountWithChange!
1764
1951
 
1765
1952
  """Total debt which is the total amount borrowed plus the accrued premium"""
1766
- totalDebt(currency: Currency! = USD): FiatAmountWithChange!
1953
+ totalDebt(currency: Currency! = USD): ExchangeAmountWithChange!
1767
1954
 
1768
1955
  """The net balance which is \`total_supplied\` - \`borrows\`"""
1769
- netBalance(currency: Currency! = USD): FiatAmountWithChange!
1956
+ netBalance(currency: Currency! = USD): ExchangeAmountWithChange!
1770
1957
 
1771
1958
  """The net collateral which is \`totalCollateral\` - \`totalDebt\`"""
1772
- netCollateral(currency: Currency! = USD): FiatAmountWithChange!
1959
+ netCollateral(currency: Currency! = USD): ExchangeAmountWithChange!
1773
1960
  netApy: PercentNumber!
1774
1961
  netSupplyApy: PercentNumberWithChange!
1775
1962
  netBorrowApy: PercentNumberWithChange!
1776
1963
  healthFactor: HealthFactorWithChange!
1777
- betterRiskPremium: PercentNumber
1778
- riskPremium: PercentNumber!
1964
+ riskPremium: UserPositionRiskPremium
1965
+ liquidationPrice(currency: Currency! = USD): ExchangeAmount
1966
+ borrowingPower(currency: Currency! = USD): ExchangeAmount!
1967
+ isUsingLatestDynamicConfigKey: Boolean!
1779
1968
  netBalancePercentChange(window: TimeWindow! = LAST_DAY): PercentNumber!
1780
1969
  spoke: Spoke!
1781
1970
  averageCollateralFactor: PercentNumber!
@@ -1788,6 +1977,12 @@ input UserPositionRequest @oneOf {
1788
1977
  id: UserPositionId
1789
1978
  }
1790
1979
 
1980
+ type UserPositionRiskPremium {
1981
+ current: PercentNumber!
1982
+ better: PercentNumber
1983
+ breakdown: [UserRiskPremiumBreakdownItem!]!
1984
+ }
1985
+
1791
1986
  input UserPositionsRequest {
1792
1987
  """The user to get the positions for"""
1793
1988
  user: EvmAddress!
@@ -1812,6 +2007,22 @@ input UserPositionsRequestOrderBy @oneOf {
1812
2007
  netCollateral: OrderDirection
1813
2008
  }
1814
2009
 
2010
+ type UserRiskPremiumBreakdownItem {
2011
+ token: Erc20Token!
2012
+ riskPremiumWeight: PercentNumber!
2013
+ collateral: PercentNumber!
2014
+ }
2015
+
2016
+ input UserRiskPremiumBreakdownRequest {
2017
+ query: UserRiskPremiumBreakdownRequestQuery!
2018
+ user: EvmAddress!
2019
+ }
2020
+
2021
+ input UserRiskPremiumBreakdownRequestQuery @oneOf {
2022
+ userSpoke: UserSpokeInput
2023
+ userPositionId: UserPositionId
2024
+ }
2025
+
1815
2026
  input UserSpokeInput {
1816
2027
  spoke: SpokeId!
1817
2028
  user: EvmAddress!
@@ -1821,16 +2032,16 @@ type UserSummary {
1821
2032
  totalPositions: Int!
1822
2033
 
1823
2034
  """Net balance = supply - debt"""
1824
- netBalance(currency: Currency! = USD): FiatAmountWithChange!
2035
+ netBalance(currency: Currency! = USD): ExchangeAmountWithChange!
1825
2036
 
1826
2037
  """Total supply where is_collateral is true"""
1827
- totalCollateral(currency: Currency! = USD): FiatAmount!
2038
+ totalCollateral(currency: Currency! = USD): ExchangeAmount!
1828
2039
 
1829
2040
  """Total supplied across all positions"""
1830
- totalSupplied(currency: Currency! = USD): FiatAmount!
2041
+ totalSupplied(currency: Currency! = USD): ExchangeAmount!
1831
2042
 
1832
2043
  """Total debt across all positions"""
1833
- totalDebt(currency: Currency! = USD): FiatAmount!
2044
+ totalDebt(currency: Currency! = USD): ExchangeAmount!
1834
2045
 
1835
2046
  """
1836
2047
  Net APY = (\u03A3 (supplied_amount_i * supply_apy_i) - \u03A3 (borrowed_amount_j * borrow_apy_j)) / (\u03A3 supplied_amount_i)
@@ -1838,7 +2049,7 @@ type UserSummary {
1838
2049
  netApy: PercentNumber!
1839
2050
 
1840
2051
  """Interest earned (net fee earned)"""
1841
- netFeeEarned: FiatAmount!
2052
+ netFeeEarned: ExchangeAmount!
1842
2053
 
1843
2054
  """Lowest health factor across all positions"""
1844
2055
  lowestHealthFactor: BigDecimal
@@ -1856,13 +2067,13 @@ type UserSummaryHistoryItem {
1856
2067
  date: DateTime!
1857
2068
 
1858
2069
  """The aggregated net balance for the time period"""
1859
- netBalance(currency: Currency! = USD): FiatAmount!
2070
+ netBalance(currency: Currency! = USD): ExchangeAmount!
1860
2071
 
1861
2072
  """The aggregated borrows for the time period"""
1862
- borrows(currency: Currency! = USD): FiatAmount!
2073
+ borrows(currency: Currency! = USD): ExchangeAmount!
1863
2074
 
1864
2075
  """The aggregated supplies for the time period"""
1865
- supplies(currency: Currency! = USD): FiatAmount!
2076
+ supplies(currency: Currency! = USD): ExchangeAmount!
1866
2077
  }
1867
2078
 
1868
2079
  input UserSummaryHistoryRequest {
@@ -1876,15 +2087,8 @@ input UserSummaryRequest {
1876
2087
  filter: UserSummaryFilter
1877
2088
  }
1878
2089
 
1879
- input UserSuppliesQueryRequest @oneOf {
1880
- userSpoke: UserSpokeInput
1881
- userToken: UserToken
1882
- userPositionId: UserPositionId
1883
- userChains: UserChains
1884
- }
1885
-
1886
2090
  input UserSuppliesRequest {
1887
- query: UserSuppliesQueryRequest!
2091
+ query: UserSuppliesRequestQuery!
1888
2092
  orderBy: UserSuppliesRequestOrderBy! = {amount: DESC}
1889
2093
 
1890
2094
  """If you wish to include zero balances in the results"""
@@ -1898,6 +2102,22 @@ input UserSuppliesRequestOrderBy @oneOf {
1898
2102
  apy: OrderDirection
1899
2103
  }
1900
2104
 
2105
+ input UserSuppliesRequestQuery @oneOf {
2106
+ userSpoke: UserSpokeInput
2107
+ userToken: UserToken
2108
+ userPositionId: UserPositionId
2109
+ userChains: UserChains
2110
+ userHub: UserHub
2111
+ }
2112
+
2113
+ input UserSupplyAsCollateral {
2114
+ """The reserve id"""
2115
+ reserve: ReserveId!
2116
+
2117
+ """If you want to enable the collateral or disable"""
2118
+ enableCollateral: Boolean!
2119
+ }
2120
+
1901
2121
  type UserSupplyItem {
1902
2122
  """The user supply item id"""
1903
2123
  id: UserSupplyItemId!