@aave/graphql 0.8.0 → 1.0.0-next.0

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,133 +1,188 @@
1
1
  'use strict';var graphql=require('graphql');var e=`type APYSample {
2
- """The avg rate"""
3
- avgRate: PercentValue!
4
-
5
- """The date"""
6
2
  date: DateTime!
3
+ avgRate: PercentNumber!
4
+ }
5
+
6
+ input ActivitiesRequest {
7
+ query: ActivitiesRequestQuery!
8
+ user: EvmAddress
9
+ types: [ActivityFeedType!]! = [BORROW, SUPPLY, WITHDRAW, REPAY, LIQUIDATED, SET_AS_COLLATERAL]
10
+ pageSize: PageSize! = FIFTY
11
+ cursor: Cursor
7
12
  }
8
13
 
9
- type AaveBorrowIncentive {
10
- borrowAprDiscount: PercentValue!
11
- rewardTokenAddress: EvmAddress!
12
- rewardTokenSymbol: String!
14
+ input ActivitiesRequestQuery @oneOf {
15
+ hub: HubInput
16
+ hubId: HubId
17
+ spoke: SpokeInput
18
+ spokeId: SpokeId
19
+ chainIds: [ChainId!]
20
+ txHash: TxHashInput
13
21
  }
14
22
 
15
- type AaveSupplyIncentive {
16
- extraSupplyApr: PercentValue!
17
- rewardTokenAddress: EvmAddress!
18
- rewardTokenSymbol: String!
23
+ enum ActivityFeedType {
24
+ SUPPLY
25
+ BORROW
26
+ REPAY
27
+ WITHDRAW
28
+ LIQUIDATED
29
+ SET_AS_COLLATERAL
19
30
  }
20
31
 
32
+ union ActivityItem = BorrowActivity | SupplyActivity | WithdrawActivity | RepayActivity | LiquidatedActivity | UsingAsCollateralActivity
33
+
21
34
  scalar AlwaysTrue
22
35
 
23
36
  input AmountInput @oneOf {
24
- """The native amount"""
25
- native: BigDecimal
37
+ """Exact amount"""
38
+ exact: BigDecimal
26
39
 
27
- """The erc20 amount input"""
28
- erc20: Erc20AmountInput
40
+ """Max amount"""
41
+ max: AlwaysTrue
29
42
  }
30
43
 
31
- """
32
- Indicates that an approval transaction must be performed before proceeding to the next step.
33
- """
34
- type ApprovalRequired {
35
- """The transaction requires an approval first"""
36
- approval: TransactionRequest!
37
-
38
- """The reason for the approval"""
39
- reason: String!
44
+ enum ApyMetric {
45
+ HIGHEST
46
+ LOWEST
47
+ AVERAGE
48
+ }
40
49
 
41
- """The required amount missing to be able to do the original transaction"""
42
- requiredAmount: DecimalValue!
50
+ type Asset {
51
+ id: AssetId!
52
+ token: Erc20Token!
53
+ summary: AssetSummary!
54
+ price(currency: Currency! = USD): FiatAmountWithChange!
55
+ }
43
56
 
44
- """The current allowance approved"""
45
- currentAllowance: DecimalValue!
57
+ input AssetBorrowHistoryRequest {
58
+ query: AssetBorrowHistoryRequestQuery!
59
+ window: TimeWindow! = LAST_DAY
60
+ }
46
61
 
47
- """The transaction to send after the approval is complete"""
48
- originalTransaction: TransactionRequest!
62
+ input AssetBorrowHistoryRequestQuery @oneOf {
63
+ token: Erc20Input
64
+ assetId: AssetId
49
65
  }
50
66
 
51
- input ApproveBorrowCreditDelegatorRequest {
52
- """The market pool address"""
53
- market: EvmAddress!
67
+ type AssetBorrowSample {
68
+ date: DateTime!
69
+ amount: DecimalNumber!
70
+ }
54
71
 
55
- """The underlying token address."""
56
- underlyingToken: EvmAddress!
72
+ scalar AssetId
57
73
 
58
- """
59
- Token value in its main unit to approve (e.g., 1.5 DAI), not in the smallest fraction (e.g. wei).
60
- """
61
- amount: BigDecimal!
74
+ input AssetPriceHistoryRequest {
75
+ query: AssetPriceHistoryRequestQuery!
76
+ currency: Currency! = USD
77
+ window: TimeWindow! = LAST_DAY
78
+ }
62
79
 
63
- """The user allowing the delegation from"""
64
- user: EvmAddress!
80
+ input AssetPriceHistoryRequestQuery @oneOf {
81
+ token: Erc20Input
82
+ assetId: AssetId
83
+ }
65
84
 
66
- """The delegatee to approve the ability to borrow on the \`user\` behalf"""
67
- delegatee: EvmAddress!
85
+ type AssetPriceSample {
86
+ date: DateTime!
87
+ price: BigDecimal!
88
+ }
68
89
 
69
- """The chain id"""
70
- chainId: ChainId!
90
+ input AssetRequest {
91
+ query: AssetRequestQuery!
71
92
  }
72
93
 
73
- scalar BigDecimal
94
+ input AssetRequestQuery @oneOf {
95
+ token: Erc20Input
96
+ assetId: AssetId
97
+ }
74
98
 
75
- scalar BigInt
99
+ type AssetSummary {
100
+ totalSupplyCap: DecimalNumberWithChange!
101
+ totalSupplied: DecimalNumberWithChange!
102
+ totalSuppliable: DecimalNumberWithChange!
103
+ totalBorrowCap: DecimalNumberWithChange!
104
+ totalBorrowed: DecimalNumberWithChange!
105
+ totalBorrowable: DecimalNumberWithChange!
106
+ totalSuppliedFiat(currency: Currency! = USD): FiatAmountWithChange!
107
+ totalBorrowedFiat(currency: Currency! = USD): FiatAmountWithChange!
76
108
 
77
- scalar BlockchainData
109
+ """The supply APY dependent on what you pass in for the \`metric\`"""
110
+ supplyApy(metric: ApyMetric! = AVERAGE): PercentNumber!
78
111
 
79
- input BorrowAPYHistoryRequest {
80
- """The market pool address"""
81
- market: EvmAddress!
112
+ """The borrow APY dependent on what you pass in for the \`metric\`"""
113
+ borrowApy(metric: ApyMetric! = AVERAGE): PercentNumber!
114
+ }
82
115
 
83
- """The underlying token for the reserve"""
84
- underlyingToken: EvmAddress!
116
+ input AssetSupplyHistoryRequest {
117
+ query: AssetSupplyHistoryRequestQuery!
118
+ window: TimeWindow! = LAST_DAY
119
+ }
85
120
 
86
- """The time windows for the history"""
87
- window: TimeWindow!
121
+ input AssetSupplyHistoryRequestQuery @oneOf {
122
+ token: Erc20Input
123
+ assetId: AssetId
124
+ }
88
125
 
89
- """The chain id"""
90
- chainId: ChainId!
126
+ type AssetSupplySample {
127
+ date: DateTime!
128
+ amount: DecimalNumber!
91
129
  }
92
130
 
93
- input BorrowAmountInput @oneOf {
94
- """The native amount"""
95
- native: BigDecimal
131
+ scalar BigDecimal
96
132
 
97
- """The erc20 amount input"""
98
- erc20: BorrowErc20AmountInput
99
- }
133
+ scalar BigInt
100
134
 
101
- input BorrowErc20AmountInput {
102
- """The token address."""
103
- currency: EvmAddress!
135
+ scalar BlockchainData
104
136
 
105
- """
106
- Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction (e.g.,
107
- wei).
108
- """
109
- value: BigDecimal!
137
+ input BorrowAPYHistoryRequest {
138
+ reserve: ReserveId!
139
+ window: TimeWindow! = LAST_DAY
140
+ }
141
+
142
+ type BorrowActivity {
143
+ id: ID!
144
+ user: EvmAddress!
145
+ timestamp: DateTime!
146
+ txHash: TxHash!
147
+ spoke: Spoke!
148
+ reserve: ReserveInfo!
149
+ borrowed: Erc20Amount!
150
+ chain: Chain!
110
151
  }
111
152
 
112
153
  input BorrowRequest {
113
- """The market pool address"""
114
- market: EvmAddress!
154
+ """The reserve id"""
155
+ reserve: ReserveId!
115
156
 
116
- """The amount borrowing"""
117
- amount: BorrowAmountInput!
157
+ """The amount supplying"""
158
+ amount: ReserveAmountInput!
118
159
 
119
160
  """The user sending the transaction (normally the user's wallet address)"""
120
161
  sender: EvmAddress!
162
+ }
121
163
 
122
- """
123
- If not supplied, this will use \`sender\` in most cases this is what the user wants if they want
124
- to borrow themselves. You can also pass in the credit delegator if the caller has
125
- been given credit delegation allowance. You can approve those with \`approveBorrowCreditDelegation\`.
126
- """
127
- onBehalfOf: EvmAddress
164
+ input CancelIntentSwapInput {
165
+ id: SwapId!
166
+ signature: Signature!
167
+ }
128
168
 
129
- """The chain id"""
130
- chainId: ChainId!
169
+ union CancelSwapExecutionPlan = TransactionRequest | SwapCancelled
170
+
171
+ input CancelSwapRequest @oneOf {
172
+ intent: CancelIntentSwapInput
173
+ transaction: SwapId
174
+ }
175
+
176
+ type CancelSwapTypeDefinition {
177
+ EIP712Domain: [TypeField!]!
178
+ OrderCancellations: [TypeField!]!
179
+ }
180
+
181
+ type CancelSwapTypedData {
182
+ types: CancelSwapTypeDefinition!
183
+ primaryType: String!
184
+ domain: DomainData!
185
+ message: JSON!
131
186
  }
132
187
 
133
188
  type Chain {
@@ -137,96 +192,53 @@ type Chain {
137
192
  explorerUrl: String!
138
193
  isTestnet: Boolean!
139
194
  nativeWrappedToken: EvmAddress!
195
+ nativeInfo: TokenInfo!
196
+ nativeGateway: EvmAddress!
197
+ signatureGateway: EvmAddress!
140
198
  }
141
199
 
142
200
  """A supported blockchain chain ID"""
143
201
  scalar ChainId
144
202
 
145
- enum ChainsFilter {
146
- TESTNET_ONLY
147
- MAINNET_ONLY
148
- ALL
149
- }
150
-
151
- type ClaimableMeritReward {
152
- currency: Currency!
153
- amount: TokenAmount!
154
- }
155
-
156
- input CollateralToggleRequest {
157
- """The pool address for the market"""
158
- market: EvmAddress!
159
-
160
- """The underlying token for the reserve"""
161
- underlyingToken: EvmAddress!
162
-
163
- """The user to toggle emode on"""
164
- user: EvmAddress!
165
-
203
+ input ChainRequest {
166
204
  """The chain id"""
167
205
  chainId: ChainId!
168
206
  }
169
207
 
170
- input CreditDelegateeAmountRequest {
171
- """The market pool address"""
172
- market: EvmAddress!
173
-
174
- """The underlying token address."""
175
- underlyingToken: EvmAddress!
176
-
177
- """The user allowing the delegation from"""
178
- user: EvmAddress!
179
-
180
- """The delegatee to approve the ability to borrow on the \`user\` behalf"""
181
- delegatee: EvmAddress!
182
-
183
- """The chain id"""
184
- chainId: ChainId!
208
+ enum ChainsFilter {
209
+ TESTNET_ONLY
210
+ MAINNET_ONLY
211
+ ALL
185
212
  }
186
213
 
187
- type Currency {
188
- """The token address"""
189
- address: EvmAddress!
190
-
191
- """The chain id"""
192
- chainId: ChainId!
193
-
194
- """The token name"""
195
- name: String!
196
-
197
- """The token image"""
198
- imageUrl: String!
199
-
200
- """The token symbol"""
201
- symbol: String!
202
-
203
- """The token decimals"""
204
- decimals: Int!
214
+ enum Currency {
215
+ USD
216
+ GBP
217
+ EUR
205
218
  }
206
219
 
207
220
  scalar Cursor
208
221
 
209
222
  scalar DateTime
210
223
 
211
- input DebtToCover @oneOf {
212
- """Exact debt amount to cover"""
213
- exact: BigDecimal
214
-
215
- """Maximum debt amount (equivalent to uint(-1))"""
216
- max: AlwaysTrue
217
- }
218
-
219
- type DecimalValue {
220
- """The raw none formatted value"""
221
- raw: BigInt!
224
+ type DecimalNumber {
225
+ """The on-chain representation of \`value\`, stored as an integer."""
226
+ onChainValue: BigInt!
222
227
 
223
- """The decimals the value formatted into"""
228
+ """
229
+ The number of decimals defining how many fractional digits the number supports.
230
+ """
224
231
  decimals: Int!
225
232
 
226
- """The formatted value"""
233
+ """The normalized value computed as \`onChainValue / 10^decimals\`."""
227
234
  value: BigDecimal!
228
235
  }
229
236
 
237
+ type DecimalNumberWithChange {
238
+ current: DecimalNumber!
239
+ change(window: TimeWindow! = LAST_DAY): DecimalNumber!
240
+ }
241
+
230
242
  type DomainData {
231
243
  name: String!
232
244
  version: String!
@@ -234,7 +246,7 @@ type DomainData {
234
246
  verifyingContract: EvmAddress!
235
247
  }
236
248
 
237
- input ERC712Signature {
249
+ input ERC20PermitSignature {
238
250
  """The signature for the erc721"""
239
251
  value: Signature!
240
252
 
@@ -242,84 +254,108 @@ input ERC712Signature {
242
254
  deadline: Int!
243
255
  }
244
256
 
245
- type EmodeMarketCategory {
246
- """The eMode id for the market"""
247
- id: Int!
248
-
249
- """The eMode label"""
250
- label: String!
257
+ type Erc20Amount {
258
+ """The value"""
259
+ amount: DecimalNumber!
251
260
 
252
- """The maximum loan-to-value ratio in efficiency mode"""
253
- maxLTV: PercentValue!
261
+ """The fiat amount"""
262
+ fiatAmount(currency: Currency! = USD): FiatAmount!
254
263
 
255
- """The liquidation threshold in efficiency mode"""
256
- liquidationThreshold: PercentValue!
264
+ """The fiat rate"""
265
+ fiatRate(currency: Currency! = USD): DecimalNumber!
266
+ isWrappedNative: Boolean!
267
+ token: Erc20Token!
268
+ }
257
269
 
258
- """The liquidation penalty applied in efficiency mode"""
259
- liquidationPenalty: PercentValue!
270
+ type Erc20ApprovalRequired {
271
+ """The transaction requires an approval first"""
272
+ transaction: TransactionRequest!
260
273
 
261
- """The list of reserves which will tailor for this eMode"""
262
- reserves: [EmodeMarketReserveInfo!]!
263
- }
274
+ """The reason for the approval"""
275
+ reason: String!
264
276
 
265
- type EmodeMarketReserveInfo {
266
- """The underlying token used on the reserve"""
267
- underlyingToken: Currency!
277
+ """The required amount missing to be able to do the original transaction"""
278
+ requiredAmount: DecimalNumber!
268
279
 
269
- """If the underlying token can be collateral with this eMode on"""
270
- canBeCollateral: Boolean!
280
+ """The current allowance approved"""
281
+ currentAllowance: DecimalNumber!
271
282
 
272
- """If the underlying token can be borrowed with this eMode on"""
273
- canBeBorrowed: Boolean!
283
+ """The transaction to send after the approval is complete"""
284
+ originalTransaction: TransactionRequest!
274
285
  }
275
286
 
276
- """The emode reserve information"""
277
- type EmodeReserveInfo {
278
- """The eMode category id for the market"""
279
- categoryId: Int!
287
+ input Erc20Input {
288
+ """The token address"""
289
+ address: EvmAddress!
280
290
 
281
- """The eMode label"""
282
- label: String!
291
+ """The token chain id"""
292
+ chainId: ChainId!
293
+ }
283
294
 
284
- """The maximum loan-to-value ratio in efficiency mode"""
285
- maxLTV: PercentValue!
295
+ type Erc20Token {
296
+ """The token address"""
297
+ address: EvmAddress!
286
298
 
287
- """The liquidation threshold in efficiency mode"""
288
- liquidationThreshold: PercentValue!
299
+ """The chain its deployed to"""
300
+ chain: Chain!
289
301
 
290
- """The liquidation penalty applied in efficiency mode"""
291
- liquidationPenalty: PercentValue!
302
+ """The ERC20 token info"""
303
+ info: TokenInfo!
292
304
 
293
- """If the underlying token can be collateral with this eMode on"""
294
- canBeCollateral: Boolean!
305
+ """
306
+ The protocol only deals with ERC20 this allows you to understand if
307
+ the token is a wrapped native token to allow you to maybe change \`WETH\` > \`ETH\`
308
+ on the display screen, or whatever you decide makes sense
309
+ """
310
+ isWrappedNativeToken: Boolean!
295
311
 
296
- """If the underlying token can be borrowed with this eMode on"""
297
- canBeBorrowed: Boolean!
312
+ """If permit is supported for the ERC20 token"""
313
+ permitSupported: Boolean!
298
314
  }
299
315
 
300
- input Erc20AmountInput {
301
- """The token address."""
302
- currency: EvmAddress!
316
+ scalar EvmAddress
303
317
 
304
- """
305
- Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction (e.g.,
306
- wei).
307
- """
308
- value: BigDecimal!
318
+ input ExchangeRateRequest {
319
+ """The from criteria"""
320
+ from: ExchangeRateRequestFrom!
321
+
322
+ """The currency to get the result in"""
323
+ to: Currency!
309
324
 
310
325
  """
311
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
326
+ The date time to get the exchange rate at, if not provided the latest rate is returned
312
327
  """
313
- permitSig: ERC712Signature
328
+ at: DateTime
314
329
  }
315
330
 
316
- scalar EvmAddress
331
+ input ExchangeRateRequestFrom @oneOf {
332
+ """The currency"""
333
+ fiat: Currency
334
+
335
+ """The erc20 token"""
336
+ erc20: Erc20Input
337
+
338
+ """The native token"""
339
+ native: ChainId
340
+ }
341
+
342
+ union ExecutionPlan = TransactionRequest | Erc20ApprovalRequired | PreContractActionRequired | InsufficientBalanceError
343
+
344
+ type FiatAmount {
345
+ value: BigDecimal!
346
+ name: String!
347
+ symbol: String!
348
+ }
349
+
350
+ type FiatAmountValueVariation {
351
+ current: FiatAmount!
352
+ after: FiatAmount!
353
+ }
317
354
 
318
- """
319
- An execution plan represents what needs to happen to fulfill a requested operation.
320
- It could be an immediate transaction, an approval followed by a transaction, or indicate insufficient balance.
321
- """
322
- union ExecutionPlan = TransactionRequest | ApprovalRequired | InsufficientBalanceError
355
+ type FiatAmountWithChange {
356
+ current: FiatAmount!
357
+ change(window: TimeWindow! = LAST_DAY): PercentNumber!
358
+ }
323
359
 
324
360
  input ForkTopUpErc20 {
325
361
  """The token address"""
@@ -353,342 +389,295 @@ type ForkTopUpResponse {
353
389
 
354
390
  input HasProcessedKnownTransactionRequest {
355
391
  """
356
- The operation type this is given to you on the TransactionRequest::operation
392
+ The operation types this is given to you on the TransactionRequest::operations
357
393
  """
358
- operation: OperationType!
394
+ operations: [OperationType!]!
359
395
 
360
396
  """The tx hash"""
361
397
  txHash: TxHash!
362
398
  }
363
399
 
364
- input HealthFactorPreviewRequest {
365
- """The action to simulate"""
366
- action: PreviewAction!
400
+ type HealthFactorError {
401
+ reason: String!
402
+ current: BigDecimal
403
+ after: BigDecimal
367
404
  }
368
405
 
369
- type HealthFactorPreviewResponse {
370
- """
371
- The user health factor before - if null, they don't have one because they are not borrowing
372
- """
373
- before: BigDecimal
406
+ union HealthFactorResult = HealthFactorVariation | HealthFactorError
374
407
 
375
- """
376
- The user health factor after - if null, they don't have one because they are not borrowing
377
- """
408
+ type HealthFactorVariation {
409
+ current: BigDecimal
378
410
  after: BigDecimal
379
411
  }
380
412
 
381
- """
382
- Indicates the user does not have enough balance to perform the operation.
383
- """
384
- type InsufficientBalanceError {
385
- """The amount required to do the original transaction"""
386
- required: DecimalValue!
387
-
388
- """The amount available in the wallet"""
389
- available: DecimalValue!
413
+ type HealthFactorWithChange {
414
+ current: BigDecimal
415
+ change(window: TimeWindow! = LAST_DAY): PercentNumber!
390
416
  }
391
417
 
392
- input LiquidateRequest {
393
- """The market pool address"""
394
- market: EvmAddress!
418
+ type Hub {
419
+ """The id for the hub"""
420
+ id: HubId!
395
421
 
396
- """
397
- The address of the token used as collateral, to receive as result of the liquidation
398
- """
399
- collateralToken: EvmAddress!
422
+ """The hub name"""
423
+ name: String!
400
424
 
401
- """
402
- The address of the underlying borrowed token to be repaid with the liquidation
403
- """
404
- underlyingToken: EvmAddress!
425
+ """The hub address"""
426
+ address: EvmAddress!
405
427
 
406
- """The address of the borrower getting liquidated"""
407
- user: EvmAddress!
428
+ """The chain the hub is deployed on"""
429
+ chain: Chain!
408
430
 
409
- """
410
- The debt amount of the underlying borrowed token the liquidator will repay
411
- """
412
- debtToCover: DebtToCover! = {max: true}
431
+ """The hub summary"""
432
+ summary(currency: Currency! = USD): HubSummary!
433
+ }
413
434
 
414
- """
415
- true if the liquidator wants to receive the aTokens equivalent of the purchased collateral, false if they want to receive the collateral asset directly
416
- """
417
- receiveAToken: Boolean! = false
435
+ type HubAsset {
436
+ """The id for the hub asset"""
437
+ id: HubAssetId!
418
438
 
419
- """The chain id"""
420
- chainId: ChainId!
421
- }
439
+ """The onchain asset id"""
440
+ onchainAssetId: OnChainHubAssetId!
422
441
 
423
- """Information about collateral liquidated in a liquidation call."""
424
- type LiquidationCollateral {
425
- """Reserve of the collateral."""
426
- reserve: ReserveInfo!
442
+ """The hub"""
443
+ hub: Hub!
427
444
 
428
- """Amount of collateral liquidated"""
429
- amount: TokenAmount
430
- }
445
+ """The underlying token"""
446
+ underlying: Erc20Token!
431
447
 
432
- """Information about debt repaid in a liquidation call."""
433
- type LiquidationRepaidDebt {
434
- """Reserve of the repaid debt."""
435
- reserve: ReserveInfo!
448
+ """The hub asset summary"""
449
+ summary: HubAssetSummary!
436
450
 
437
- """Amount of debt repaid."""
438
- amount: TokenAmount!
451
+ """The hub asset settings"""
452
+ settings: HubAssetSettings!
453
+ userState: HubAssetUserState
439
454
  }
440
455
 
441
- type Market {
442
- """The human-friendly name for the market"""
443
- name: String!
456
+ scalar HubAssetId
444
457
 
445
- """The chain"""
446
- chain: Chain!
458
+ type HubAssetSettings {
459
+ """The fee receiver"""
460
+ feeReceiver: EvmAddress!
447
461
 
448
- """The liquidity pool address for the market"""
449
- address: EvmAddress!
462
+ """The liquidity fee"""
463
+ liquidityFee: PercentNumber!
450
464
 
451
- """A list eModes the market can support"""
452
- eModeCategories: [EmodeMarketCategory!]!
453
- userState: MarketUserState
465
+ """The ir strategy"""
466
+ irStrategy: EvmAddress!
454
467
 
455
- """The market icon"""
456
- icon: String!
468
+ """The reinvestment strategy"""
469
+ reinvestmentController: EvmAddress
470
+ }
457
471
 
458
- """The market reserves"""
459
- reserves(request: MarketReservesRequest! = {reserveType: BOTH, orderBy: {tokenName: ASC}}): [Reserve!]!
472
+ type HubAssetSummary {
473
+ """The supplied amount"""
474
+ supplied: Erc20Amount!
460
475
 
461
- """The total market size"""
462
- totalMarketSize: BigDecimal!
476
+ """The borrowed amount"""
477
+ borrowed: Erc20Amount!
463
478
 
464
- """The total available liquidity in USD"""
465
- totalAvailableLiquidity: BigDecimal!
466
- }
479
+ """The available liquidity"""
480
+ availableLiquidity: Erc20Amount!
467
481
 
468
- type MarketInfo {
469
- """The human-friendly name for the market"""
470
- name: String!
482
+ """The supply APY"""
483
+ supplyApy: PercentNumber!
471
484
 
472
- """The chain"""
473
- chain: Chain!
485
+ """The borrow APY"""
486
+ borrowApy: PercentNumber!
474
487
 
475
- """The liquidity pool address for the market"""
476
- address: EvmAddress!
488
+ """The net APY"""
489
+ netApy: PercentNumber!
477
490
 
478
- """The market icon"""
479
- icon: String!
491
+ """The utilization rate"""
492
+ utilizationRate: PercentNumber!
480
493
  }
481
494
 
482
- input MarketInput {
483
- """The address of the market pool"""
484
- address: EvmAddress!
485
-
486
- """The chain id the market is deployed on"""
487
- chainId: ChainId!
495
+ type HubAssetUserState {
496
+ """The hub asset balance"""
497
+ balance: Erc20Amount!
488
498
  }
489
499
 
490
- input MarketRequest {
491
- """The pool address for the market"""
492
- address: EvmAddress!
493
-
494
- """The chain id the market pool address is deployed on"""
495
- chainId: ChainId!
496
-
497
- """
498
- The user viewing it (can be connected wallet) - this caters for stuff like eMode and other user features
499
- """
500
+ input HubAssetsRequest {
501
+ query: HubAssetsRequestQuery!
500
502
  user: EvmAddress
503
+ orderBy: HubAssetsRequestOrderBy! = {assetName: ASC}
501
504
  }
502
505
 
503
- input MarketReservesRequest {
504
- """The reserve type"""
505
- reserveType: MarketReservesRequestType! = BOTH
506
-
507
- """The way the reserve gets ordered on the return result"""
508
- orderBy: MarketReservesRequestOrderBy! = {tokenName: ASC}
509
- }
510
-
511
- input MarketReservesRequestOrderBy @oneOf {
512
- """Order by the borrow APY"""
513
- borrowApy: OrderDirection
514
-
515
- """Order by the supply APY"""
506
+ input HubAssetsRequestOrderBy @oneOf {
507
+ assetName: OrderDirection
508
+ availableLiquidity: OrderDirection
516
509
  supplyApy: OrderDirection
517
-
518
- """Order by the token name"""
519
- tokenName: OrderDirection
510
+ borrowApy: OrderDirection
520
511
  }
521
512
 
522
- enum MarketReservesRequestType {
523
- SUPPLY
524
- BORROW
525
- BOTH
513
+ input HubAssetsRequestQuery @oneOf {
514
+ hubInput: HubInput
515
+ hubId: HubId
526
516
  }
527
517
 
528
- type MarketUserReserveBorrowPosition {
529
- """The market address where this position exists"""
530
- market: MarketInfo!
518
+ scalar HubId
531
519
 
532
- """The currency being borrowed"""
533
- currency: Currency!
534
-
535
- """The user's debt balance in this reserve"""
536
- debt: TokenAmount!
520
+ input HubInput {
521
+ """The hub address"""
522
+ address: EvmAddress!
537
523
 
538
- """The annual percentage yield for this borrow position"""
539
- apy: PercentValue!
524
+ """The hub chain id"""
525
+ chainId: ChainId!
540
526
  }
541
527
 
542
- type MarketUserReserveSupplyPosition {
543
- """The market address where this position exists"""
544
- market: MarketInfo!
545
-
546
- """The currency being supplied"""
547
- currency: Currency!
548
-
549
- """The user's supply balance in this reserve"""
550
- balance: TokenAmount!
551
-
552
- """The annual percentage yield for this supply position"""
553
- apy: PercentValue!
554
-
555
- """Whether this position is being used as collateral"""
556
- isCollateral: Boolean!
557
-
558
- """If the asset can be used for collateral"""
559
- canBeCollateral: Boolean!
528
+ input HubRequest {
529
+ query: HubRequestQuery!
560
530
  }
561
531
 
562
- type MarketUserState {
563
- """The user's total net worth in the market"""
564
- netWorth: BigDecimal!
565
-
566
- """The user's net annual percentage yield across all positions"""
567
- netAPY: PercentValue!
568
-
569
- """The user's earned annual percentage yield across all supply positions"""
570
- userEarnedAPY: PercentValue!
571
-
572
- """The user's debt annual percentage yield across all borrow positions"""
573
- userDebtAPY: PercentValue!
532
+ input HubRequestQuery @oneOf {
533
+ hubInput: HubInput
534
+ hubId: HubId
535
+ }
574
536
 
537
+ type HubSummary {
575
538
  """
576
- The user's health factor (risk metric for liquidation) - if null, the user does not have a borrow
539
+ The total spoke reserves aggregated borrowed using this hub, showed in fiat as each asset has a different value
577
540
  """
578
- healthFactor: BigDecimal
541
+ totalBorrowed: FiatAmount!
579
542
 
580
- """Whether efficiency mode is enabled for the user"""
581
- eModeEnabled: Boolean!
543
+ """
544
+ The total spoke reserves aggregated borrow caps using this hub, showed in fiat as each asset has a different value
545
+ """
546
+ totalBorrowCap: FiatAmount!
582
547
 
583
548
  """
584
- The total collateral of the user in the base currency used by the price feed
549
+ The total spoke reserves aggregated supplied using this hub, showed in fiat as each asset has a different value
585
550
  """
586
- totalCollateralBase: BigDecimal!
551
+ totalSupplied: FiatAmount!
587
552
 
588
- """The total debt of the user in the base currency used by the price feed"""
589
- totalDebtBase: BigDecimal!
553
+ """
554
+ The total spoke reserves aggregated supply caps using this hub, showed in fiat as each asset has a different value
555
+ """
556
+ totalSupplyCap: FiatAmount!
590
557
 
591
558
  """
592
- The borrowing power left of the user in the base currency used by the price feed
559
+ The utilization rate"
593
560
  """
594
- availableBorrowsBase: BigDecimal!
561
+ utilizationRate: BigDecimal!
562
+ }
595
563
 
596
- """The liquidation threshold of the user"""
597
- currentLiquidationThreshold: PercentValue!
564
+ input HubTokenInput {
565
+ chainId: ChainId!
566
+ hub: EvmAddress!
567
+ token: EvmAddress!
568
+ }
598
569
 
599
- """The loan to value of the user"""
600
- ltv: PercentValue!
570
+ input HubsRequest {
571
+ query: HubsRequestQuery!
572
+ orderBy: HubsRequestOrderBy! = {name: ASC}
573
+ }
601
574
 
602
- """One of the user collateral is in isolation mode"""
603
- isInIsolationMode: Boolean!
575
+ input HubsRequestOrderBy @oneOf {
576
+ name: OrderDirection
577
+ totalBorrowed: OrderDirection
578
+ totalSupplied: OrderDirection
604
579
  }
605
580
 
606
- input MarketsRequest {
607
- """The markets you want to see based on the chain ids"""
608
- chainIds: [ChainId!]!
581
+ input HubsRequestQuery @oneOf {
582
+ """Get back all the hubs which have one of the underlying tokens supplied"""
583
+ tokens: [Erc20Input!]
609
584
 
610
- """
611
- The user viewing it (can be connected wallet) - this caters for stuff like eMode and other
612
- user features
613
- """
614
- user: EvmAddress
585
+ """Get back all the hubs based on the chain ids passed in"""
586
+ chainIds: [ChainId!]
615
587
  }
616
588
 
617
- type MeritBorrowAndSupplyIncentiveCondition {
618
- """The APR incentive for meeting the conditions"""
619
- extraApr: PercentValue!
589
+ type InsufficientBalanceError {
590
+ """The amount required to do the original transaction"""
591
+ required: DecimalNumber!
620
592
 
621
- """The token that must be supplied as collateral"""
622
- supplyToken: Currency!
593
+ """The amount available in the wallet"""
594
+ available: DecimalNumber!
595
+ }
623
596
 
624
- """The token that must be borrowed"""
625
- borrowToken: Currency!
597
+ """A scalar that can represent any JSON value."""
598
+ scalar JSON
626
599
 
627
- """Where you can go and claim the incentives"""
628
- claimLink: URL!
600
+ input LiquidatePositionDebtAmount @oneOf {
601
+ """Exact amount"""
602
+ exact: BigDecimal
603
+
604
+ """The most you can liquidate"""
605
+ max: AlwaysTrue
629
606
  }
630
607
 
631
- type MeritBorrowIncentive {
632
- """Extra APR for borrowing this asset from AAVE Merit program"""
633
- borrowAprDiscount: PercentValue!
608
+ union LiquidatePositionExecutionPlan = TransactionRequest | Erc20ApprovalRequired | InsufficientBalanceError
634
609
 
635
- """Where you can go and claim the incentives"""
636
- claimLink: URL!
637
- }
610
+ input LiquidatePositionRequest {
611
+ """The collateral reserve id"""
612
+ collateral: ReserveId!
613
+
614
+ """The debt reserve id"""
615
+ debt: ReserveId!
638
616
 
639
- type MeritSupplyIncentive {
640
- """Extra APR for supplying this asset from AAVE Merit program"""
641
- extraSupplyApr: PercentValue!
617
+ """The amount to liquidate"""
618
+ amount: LiquidatePositionDebtAmount!
619
+
620
+ """The person liquidating the position"""
621
+ liquidator: EvmAddress!
622
+
623
+ """The user to liquidate"""
624
+ user: EvmAddress!
642
625
 
643
- """Where you can go and claim the incentives"""
644
- claimLink: URL!
626
+ """If you would like to receive shares over the asset"""
627
+ receiveShares: Boolean! = false
645
628
  }
646
629
 
647
- type MessageData {
648
- owner: EvmAddress!
649
- spender: EvmAddress!
650
- value: BigInt!
651
- nonce: BigInt!
652
- deadline: Int!
630
+ type LiquidatedActivity {
631
+ id: ID!
632
+ user: EvmAddress!
633
+ timestamp: DateTime!
634
+ txHash: TxHash!
635
+ spoke: Spoke!
636
+ collateralReserve: ReserveInfo!
637
+ debtReserve: ReserveInfo!
638
+ collateral: Erc20Amount!
639
+ debt: Erc20Amount!
640
+ liquidator: EvmAddress!
641
+ chain: Chain!
653
642
  }
654
643
 
655
- type NativeCurrency {
656
- """The token image"""
657
- imageUrl: String!
644
+ type Mutation {
645
+ """Top up a balance for a user or yourself on the fork"""
646
+ forkTopUp(request: ForkTopUpRequest!): ForkTopUpResponse!
647
+ }
658
648
 
659
- """The token name"""
660
- name: String!
649
+ type NativeAmount {
650
+ """The native token"""
651
+ token: NativeToken!
661
652
 
662
- """The token symbol"""
663
- symbol: String!
653
+ """The value"""
654
+ amount: DecimalNumber!
664
655
 
665
- """The token decimals"""
666
- decimals: Int!
656
+ """The fiat amount"""
657
+ fiatAmount(currency: Currency! = USD): FiatAmount!
667
658
 
668
- """The chain id"""
669
- chainId: ChainId!
659
+ """The fiat rate"""
660
+ fiatRate(currency: Currency! = USD): DecimalNumber!
661
+ }
670
662
 
671
- """The wrapped version of this token"""
672
- wrappedToken: EvmAddress!
663
+ type NativeToken {
664
+ info: TokenInfo!
665
+ chain: Chain!
673
666
  }
674
667
 
668
+ scalar OnChainHubAssetId
669
+
670
+ scalar OnChainReserveId
671
+
675
672
  enum OperationType {
676
- BORROW
677
- REPAY
678
- RESERVE_USED_AS_COLLATERAL_ENABLED
679
- RESERVE_USED_AS_COLLATERAL_DISABLED
680
- SUPPLY
681
- USER_EMODE_SET
682
- WITHDRAW
683
- VAULT_DEPLOYED
684
- VAULT_DEPOSIT
685
- VAULT_FEE_UPDATED
686
- VAULT_FEE_WITHDRAWN
687
- VAULT_WITHDRAW
688
- VAULT_OWNERSHIP_TRANSFERRED
689
- REVENUE_SPLITTER_OWNER_DEPLOYED
690
- REVENUE_SPLITTER_OWNER_TRANSFER
691
- LIQUIDATION
673
+ SPOKE_BORROW
674
+ SPOKE_REPAY
675
+ SPOKE_SUPPLY
676
+ SPOKE_WITHDRAW
677
+ SPOKE_UPDATE_USER_RISK_PREMIUM
678
+ SPOKE_SET_USER_USING_AS_COLLATERAL
679
+ SPOKE_SET_USER_POSITION_MANAGER
680
+ RENOUNCE_SPOKE_USER_POSITION_MANAGER
692
681
  }
693
682
 
694
683
  enum OrderDirection {
@@ -701,6 +690,11 @@ enum PageSize {
701
690
  FIFTY
702
691
  }
703
692
 
693
+ type PaginatedActivitiesResult {
694
+ items: [ActivityItem!]!
695
+ pageInfo: PaginatedResultInfo!
696
+ }
697
+
704
698
  type PaginatedResultInfo {
705
699
  """The cursor to the previous page of results, if any."""
706
700
  prev: Cursor
@@ -709,234 +703,188 @@ type PaginatedResultInfo {
709
703
  next: Cursor
710
704
  }
711
705
 
712
- """Paginated result of user transaction history."""
713
- type PaginatedUserTransactionHistoryResult {
714
- """List of user transaction items."""
715
- items: [UserTransactionItem!]!
716
-
717
- """Pagination information."""
706
+ type PaginatedSpokePositionManagerResult {
707
+ items: [SpokePositionManger!]!
718
708
  pageInfo: PaginatedResultInfo!
719
709
  }
720
710
 
721
- type PaginatedVaultUserTransactionHistoryResult {
722
- items: [VaultUserTransactionItem!]!
711
+ type PaginatedSpokeUserPositionManagerResult {
712
+ items: [SpokeUserPositionManager!]!
723
713
  pageInfo: PaginatedResultInfo!
724
714
  }
725
715
 
726
- type PaginatedVaultsResult {
727
- items: [Vault!]!
716
+ type PaginatedUserSwapsResult {
717
+ items: [SwapStatus!]!
728
718
  pageInfo: PaginatedResultInfo!
729
719
  }
730
720
 
731
- type PercentValue {
732
- """The raw none normalized percentage (the value that lives onchain)"""
733
- raw: BigInt!
721
+ type PercentNumber {
722
+ """
723
+ The on-chain representation of the percentage, stored in basis points (bps).
724
+ """
725
+ onChainValue: BigInt!
734
726
 
735
- """The decimals representing the precision of the onchain raw value"""
727
+ """The number of decimals defining the precision of \`bps\`."""
736
728
  decimals: Int!
737
729
 
738
- """The normalized percentage (1.0 = 100%)"""
730
+ """The percentage value where 1.0 represents 100%."""
739
731
  value: BigDecimal!
740
732
 
741
- """
742
- The human-readable formatted value you can render on a UI straight away.
743
- For example, this will turn \`0.01232343\` to \`1.23\`, it will always round to \`2\` decimal points.
744
- """
745
- formatted: BigDecimal!
733
+ """The human-friendly percentage value formatted for display."""
734
+ normalized: BigDecimal!
746
735
  }
747
736
 
748
- input PermitRequest {
749
- """The spender (when doing this with aave this is the market address)"""
750
- spender: EvmAddress!
751
-
752
- """The token you want to do the permit with"""
753
- currency: EvmAddress!
754
-
755
- """
756
- The amount to permit - in human-readable form aka 0.001 eth is 0.001 eth here
757
- """
758
- amount: BigDecimal!
737
+ type PercentNumberVariation {
738
+ current: PercentNumber!
739
+ after: PercentNumber!
740
+ }
759
741
 
760
- """The chain id the pool is deployed on"""
761
- chainId: ChainId!
742
+ type PercentNumberWithChange {
743
+ current: PercentNumber!
744
+ change(window: TimeWindow! = LAST_DAY): PercentNumber!
745
+ }
762
746
 
763
- """The owner of the funds"""
747
+ type PermitMessageData {
764
748
  owner: EvmAddress!
749
+ spender: EvmAddress!
750
+ value: BigInt!
751
+ nonce: BigInt!
752
+ deadline: Int!
753
+ }
754
+
755
+ input PermitRequest @oneOf {
756
+ supply: SupplyPermitRequest
757
+ repay: RepayPermitRequest
765
758
  }
766
759
 
767
760
  type PermitTypedDataResponse {
768
761
  types: TypeDefinition!
769
762
  primaryType: String!
770
763
  domain: DomainData!
771
- message: MessageData!
772
- }
773
-
774
- input PreviewAction @oneOf {
775
- supply: SupplyRequest
776
- borrow: BorrowRequest
777
- repay: RepayRequest
778
- withdraw: WithdrawRequest
764
+ message: PermitMessageData!
779
765
  }
780
766
 
781
- type Query {
782
- """Get if the API is healthy"""
783
- health: Boolean!
784
-
785
- """Chains the protocol supports"""
786
- chains(filter: ChainsFilter! = ALL): [Chain!]!
787
-
788
- """
789
- Deposits assets (underlying tokens or its related aTokens) into the vault and mints a corresponding amount of vault shares to the receiver.
790
- """
791
- vaultDeposit(request: VaultDepositRequest!): ExecutionPlan!
792
-
793
- """
794
- Redeems shares (vault shares) for the underlying assets or a tokens, which are sent to the receiver. The shares are burned from the owner.
795
- """
796
- vaultRedeemShares(request: VaultRedeemSharesRequest!): TransactionRequest!
797
-
798
- """Get a vault"""
799
- vault(request: VaultRequest!): Vault
800
-
801
- """Get vaults"""
802
- vaults(request: VaultsRequest!): PaginatedVaultsResult!
803
-
804
- """User vaults they have shares in"""
805
- userVaults(request: UserVaultsRequest!): PaginatedVaultsResult!
806
-
807
- """Deploy a vault and earn fees from the yield"""
808
- vaultDeploy(request: VaultDeployRequest!): ExecutionPlan!
809
-
810
- """
811
- Update a vault's fee. You MUST be the owner of the vault to send this tx request.
812
- """
813
- vaultSetFee(request: VaultSetFeeRequest!): TransactionRequest!
814
-
815
- """
816
- Withdraws accumulated fees from the specified vault. You MUST be the owner of the vault to send this tx request.
817
- """
818
- vaultWithdrawFees(request: VaultWithdrawFeesRequest!): TransactionRequest!
819
-
820
- """User vault transaction history"""
821
- vaultUserTransactionHistory(request: VaultUserTransactionHistoryRequest!): PaginatedVaultUserTransactionHistoryResult!
822
-
823
- """
824
- Vault user activity for a given vault and user, within a specified time window.
825
- """
826
- vaultUserActivity(request: VaultUserActivityRequest!): VaultUserActivityResult!
827
-
828
- """
829
- Withdraws assets (underlying tokens or its related aTokens) from the vault and sends them to the receiver. The corresponding vault shares are burned from the owner.
830
- """
831
- vaultWithdraw(request: VaultWithdrawRequest!): TransactionRequest!
832
-
833
- """
834
- Mints an exact amount of shares (vault shares) to the receiver by depositing the calculated amount of underlying or aTokens assets.
835
- """
836
- vaultMintShares(request: VaultMintSharesRequest!): ExecutionPlan!
837
-
838
- """
839
- This will return you the amount of shares that would be minted to the receiver
840
- """
841
- vaultPreviewDeposit(request: VaultOperationPreviewRequest!): TokenAmount!
842
-
843
- """
844
- This will return you the amount of assets that would be deposited by the caller
845
- """
846
- vaultPreviewMint(request: VaultOperationPreviewRequest!): TokenAmount!
847
-
848
- """
849
- This will return you the number of shares burnt based on the amount of assets you want to withdraw
850
- """
851
- vaultPreviewWithdraw(request: VaultOperationPreviewRequest!): TokenAmount!
852
-
853
- """
854
- This will return you the amount of assets that would be withdrawn by the receiver.
855
- """
856
- vaultPreviewRedeem(request: VaultOperationPreviewRequest!): TokenAmount!
857
-
858
- """
859
- Update a vault owner. You MUST be the owner of the vault to send this tx request.
860
- """
861
- vaultTransferOwnership(request: VaultTransferOwnershipRequest!): TransactionRequest!
862
-
863
- """
864
- Deploy a new recipients configuration contract for fee distribution.
865
- You MUST be the owner of the vault to send this tx request.
866
- """
867
- vaultCreateRecipientsConfiguration(request: VaultCreateRecipientsConfigurationRequest!): TransactionRequest!
868
-
869
- """
870
- Set the recipients configuration for the vault. You MUST be the owner of the vault to send this tx request.
871
- """
872
- vaultSetRecipientsConfiguration(request: VaultSetRecipientsConfigurationRequest!): TransactionRequest!
873
-
874
- """Get a vault recipients configuration"""
875
- vaultRecipientConfiguration(request: VaultRecipientConfigurationRequest!): VaultFeesRecipientsConfiguration
876
-
877
- """Lists all the markets"""
878
- markets(request: MarketsRequest!): [Market!]!
879
-
880
- """Get a market"""
881
- market(request: MarketRequest!): Market
882
-
883
- """Create the transaction to borrow from a market"""
884
- borrow(request: BorrowRequest!): ExecutionPlan!
767
+ type PreContractActionRequired {
768
+ """The transaction requires a pre-contract action first"""
769
+ transaction: TransactionRequest!
885
770
 
886
- """Approve a credit borrow delegator to be able to borrow on your behalf"""
887
- approveBorrowCreditDelegation(request: ApproveBorrowCreditDelegatorRequest!): TransactionRequest!
771
+ """The reason for the pre-contract action"""
772
+ reason: String!
888
773
 
889
- """
890
- Gets the amount delegated to the credit delegatee that can borrow on your behalf
891
- """
892
- creditDelegateeAllowance(request: CreditDelegateeAmountRequest!): TokenAmount!
774
+ """The transaction to send after the approval is complete"""
775
+ originalTransaction: TransactionRequest!
776
+ }
893
777
 
894
- """Create the transaction to supply to a market"""
895
- supply(request: SupplyRequest!): ExecutionPlan!
778
+ input PrepareLimitOrderSwapInput {
779
+ quoteId: SwapQuoteId!
780
+ newSellAmount: BigDecimal
781
+ newBuyAmount: BigDecimal
896
782
 
897
- """Create the transaction to repay to a market"""
898
- repay(request: RepayRequest!): ExecutionPlan!
783
+ """Slippage in basis points"""
784
+ newSlippage: BigDecimal
785
+ newReceiver: EvmAddress
786
+ }
899
787
 
900
- """Create the transaction to withdraw from a market"""
901
- withdraw(request: WithdrawRequest!): ExecutionPlan!
788
+ input PrepareMarketOrderSwapInput {
789
+ chainId: ChainId!
790
+ buy: TokenInput!
791
+ sell: TokenInput!
792
+ amount: BigDecimal!
793
+ kind: SwapKind!
794
+ user: EvmAddress!
795
+ receiver: EvmAddress
796
+ }
902
797
 
903
- """Create the transaction to toggle eMode for a market"""
904
- userSetEmode(request: UserSetEmodeRequest!): TransactionRequest!
798
+ input PrepareSwapCancelRequest {
799
+ id: SwapId!
800
+ }
905
801
 
906
- """Enable/disable a specific supplied asset as collateral"""
907
- collateralToggle(request: CollateralToggleRequest!): TransactionRequest!
802
+ type PrepareSwapCancelResult {
803
+ data: CancelSwapTypedData!
804
+ }
908
805
 
909
- """
910
- liquidate a non-healthy position collateral-wise, with Health Factor below 1
911
- """
912
- liquidate(request: LiquidateRequest!): TransactionRequest!
806
+ input PrepareSwapRequest @oneOf {
807
+ market: PrepareMarketOrderSwapInput
808
+ limit: PrepareLimitOrderSwapInput
809
+ }
913
810
 
914
- """Returns the user account market data across all the reserves."""
915
- userMarketState(request: UserMarketStateRequest!): MarketUserState!
811
+ union PrepareSwapResult = SwapByIntent | SwapByIntentWithApprovalRequired | SwapByTransaction | InsufficientBalanceError
916
812
 
917
- """The usd exchange rates for different tokens on a given market"""
918
- usdExchangeRates(request: UsdExchangeRatesRequest!): [UsdExchangeRate!]!
813
+ input PreviewAction @oneOf {
814
+ supply: SupplyRequest
815
+ borrow: BorrowRequest
816
+ repay: RepayRequest
817
+ withdraw: WithdrawRequest
818
+ setUserSupplyAsCollateral: SetUserSupplyAsCollateralRequest
819
+ }
919
820
 
920
- """Get all the user borrows positions"""
921
- userBorrows(request: UserBorrowsRequest!): [MarketUserReserveBorrowPosition!]!
821
+ input PreviewRequest {
822
+ action: PreviewAction!
823
+ }
922
824
 
923
- """Get all the user supplies positions"""
924
- userSupplies(request: UserSuppliesRequest!): [MarketUserReserveSupplyPosition!]!
825
+ type PreviewUserPosition {
826
+ id: UserPositionId!
827
+ healthFactor: HealthFactorResult!
828
+ riskPremium: PercentNumberVariation!
925
829
 
926
- """Get the borrow APY history"""
927
- borrowAPYHistory(request: BorrowAPYHistoryRequest!): [APYSample!]!
830
+ """The net APY for one user position on a current spoke"""
831
+ netApy: PercentNumberVariation!
832
+ netCollateral(currency: Currency! = USD): FiatAmountValueVariation!
833
+ netBalance(currency: Currency! = USD): FiatAmountValueVariation!
834
+ }
928
835
 
929
- """Get the supply APY history"""
930
- supplyAPYHistory(request: SupplyAPYHistoryRequest!): [APYSample!]!
836
+ type Query {
837
+ health: Boolean!
838
+ chain(request: ChainRequest!): Chain
839
+ chains(filter: ChainsFilter!): [Chain!]!
931
840
 
932
841
  """Generate EIP-712 typed data for EIP-2612 permit signature"""
933
842
  permitTypedData(request: PermitRequest!): PermitTypedDataResponse!
934
843
 
935
- """Get the reserve for on a market"""
844
+ """Get the exchange rate of tokens > currency or currency > currency"""
845
+ exchangeRate(request: ExchangeRateRequest!): FiatAmount!
846
+ asset(request: AssetRequest!): Asset
847
+ assetSupplyHistory(request: AssetSupplyHistoryRequest!): [AssetSupplySample!]!
848
+ assetBorrowHistory(request: AssetBorrowHistoryRequest!): [AssetBorrowSample!]!
849
+ assetPriceHistory(request: AssetPriceHistoryRequest!): [AssetPriceSample!]!
850
+
851
+ """Fetch a list of hubs depending on your search criteria"""
852
+ hubs(request: HubsRequest!): [Hub!]!
853
+ hub(request: HubRequest!): Hub
854
+ hubAssets(request: HubAssetsRequest!): [HubAsset!]!
936
855
  reserve(request: ReserveRequest!): Reserve
937
-
938
- """The user's market transaction history"""
939
- userTransactionHistory(request: UserTransactionHistoryRequest!): PaginatedUserTransactionHistoryResult!
856
+ reserves(request: ReservesRequest!): [Reserve!]!
857
+ supply(request: SupplyRequest!): ExecutionPlan!
858
+ borrow(request: BorrowRequest!): ExecutionPlan!
859
+ withdraw(request: WithdrawRequest!): ExecutionPlan!
860
+ repay(request: RepayRequest!): ExecutionPlan!
861
+ spokePositionManagers(request: SpokePositionManagersRequest!): PaginatedSpokePositionManagerResult!
862
+ spokeUserPositionManagers(request: SpokeUserPositionManagersRequest!): PaginatedSpokeUserPositionManagerResult!
863
+ setSpokeUserPositionManager(request: SetSpokeUserPositionManagerRequest!): TransactionRequest!
864
+ renounceSpokeUserPositionManager(request: RenounceSpokeUserPositionManagerRequest!): TransactionRequest!
865
+ setUserSupplyAsCollateral(request: SetUserSupplyAsCollateralRequest!): TransactionRequest!
866
+ liquidatePosition(request: LiquidatePositionRequest!): LiquidatePositionExecutionPlan!
867
+ updateUserRiskPremium(request: UpdateUserRiskPremiumRequest!): TransactionRequest!
868
+ updateUserDynamicConfig(request: UpdateUserDynamicConfigRequest!): TransactionRequest!
869
+ preview(request: PreviewRequest!): PreviewUserPosition!
870
+ borrowApyHistory(request: BorrowAPYHistoryRequest!): [APYSample!]!
871
+ supplyApyHistory(request: SupplyAPYHistoryRequest!): [APYSample!]!
872
+ spoke(request: SpokeRequest!): Spoke
873
+
874
+ """Lists all spokes"""
875
+ spokes(request: SpokesRequest!): [Spoke!]!
876
+
877
+ """
878
+ Get the user balances for the protocol
879
+ This will only return assets that can be used on the protocol
880
+ """
881
+ userBalances(request: UserBalancesRequest!): [UserBalance!]!
882
+ userBorrows(request: UserBorrowsRequest!): [UserBorrowItem!]!
883
+ userSummary(request: UserSummaryRequest!): UserSummary!
884
+ userSummaryHistory(request: UserSummaryHistoryRequest!): [UserSummaryHistoryItem!]!
885
+ userPositions(request: UserPositionsRequest!): [UserPosition!]!
886
+ userPosition(request: UserPositionRequest!): UserPosition
887
+ userSupplies(request: UserSuppliesRequest!): [UserSupplyItem!]!
940
888
 
941
889
  """
942
890
  This lets you know the API has processed the known transaction hash, as the API uses caching to make things as fast
@@ -946,1352 +894,1065 @@ type Query {
946
894
  cater for the race condition.
947
895
  """
948
896
  hasProcessedKnownTransaction(request: HasProcessedKnownTransactionRequest!): Boolean!
949
- healthFactorPreview(request: HealthFactorPreviewRequest!): HealthFactorPreviewResponse!
950
-
951
- """Top up a balance for a user or yourself on the fork"""
952
- forkTopUp(request: ForkTopUpRequest!): ForkTopUpResponse!
897
+ activities(request: ActivitiesRequest!): PaginatedActivitiesResult!
898
+ swapQuote(request: SwapQuoteRequest!): SwapQuote!
899
+ prepareSwap(request: PrepareSwapRequest!): PrepareSwapResult!
900
+ swap(request: SwapRequest!): SwapExecutionPlan!
901
+ swapStatus(request: SwapStatusRequest!): SwapStatus!
902
+ userSwaps(request: UserSwapsRequest!): PaginatedUserSwapsResult!
903
+ prepareSwapCancel(request: PrepareSwapCancelRequest!): PrepareSwapCancelResult!
904
+ cancelSwap(request: CancelSwapRequest!): CancelSwapExecutionPlan!
905
+ swappableTokens(request: SwappableTokensRequest!): [Token!]!
906
+ }
953
907
 
954
- """
955
- The user merits reward information and transaction if you wish to claim
956
- """
957
- userMeritRewards(request: UserMeritRewardsRequest!): UserMeritRewards
908
+ input RenounceSpokeUserPositionManagerRequest {
909
+ """The spoke id"""
910
+ spoke: SpokeId!
958
911
 
959
- """
960
- Users saving GHO balance - note rewards are not paid out live onchain they paid out with the merit schema,
961
- this can be claimed using \`userMeritRewards\`
962
- """
963
- savingsGhoBalance(request: SavingsGhoBalanceRequest!): TokenAmount!
912
+ """The address to remove as a position manager"""
913
+ manager: EvmAddress!
964
914
 
965
- """Deposit into savings GHO"""
966
- savingsGhoDeposit(request: SavingsGhoDepositRequest!): ExecutionPlan!
915
+ """The address to remove \`manager\` as position manager"""
916
+ managing: EvmAddress!
917
+ }
967
918
 
968
- """Withdraw sGHO (savings GHO) back to GHO"""
969
- savingsGhoWithdraw(request: SavingsGhoWithdrawRequest!): ExecutionPlan!
919
+ type RepayActivity {
920
+ id: ID!
921
+ user: EvmAddress!
922
+ timestamp: DateTime!
923
+ txHash: TxHash!
924
+ spoke: Spoke!
925
+ reserve: ReserveInfo!
926
+ repaid: Erc20Amount!
927
+ chain: Chain!
970
928
  }
971
929
 
972
- input RepayAmountInput @oneOf {
930
+ input RepayAmountInputWithPermit @oneOf {
973
931
  """The native amount"""
974
- native: BigDecimal
932
+ native: AmountInput
975
933
 
976
934
  """The erc20 amount input"""
977
- erc20: RepayErc20AmountInput
935
+ erc20: RepayErc20AmountInputWithPermit
978
936
  }
979
937
 
980
- input RepayErc20Amount @oneOf {
938
+ input RepayErc20AmountInputWithPermit {
981
939
  """
982
- Exact amount to repay
983
- Token value in its main unit (e.g., 1.5 GHO), not in the smallest fraction (e.g., wei).
940
+ Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction (e.g., wei).
984
941
  """
985
- exact: BigDecimal
942
+ value: AmountInput!
986
943
 
987
- """Repay all the amount completely"""
988
- max: AlwaysTrue
944
+ """
945
+ The signed ERC20 permit message to operate on the relevant token without a need for an ERC20 Approval transaction.
946
+ """
947
+ permitSig: ERC20PermitSignature
989
948
  }
990
949
 
991
- input RepayErc20AmountInput {
992
- """The token address."""
993
- currency: EvmAddress!
950
+ input RepayPermitRequest {
951
+ """The reserve id"""
952
+ reserve: ReserveId!
994
953
 
995
- """The amount to repay"""
996
- value: RepayErc20Amount!
954
+ """The amount repaying"""
955
+ amount: AmountInput!
997
956
 
998
- """
999
- The signed ERC20 permit message to operate on the relevant token without the need for an ERC20 Approval transaction.
1000
- """
1001
- permitSig: ERC712Signature
957
+ """The user sending the transaction (normally the user's wallet address)"""
958
+ sender: EvmAddress!
1002
959
  }
1003
960
 
1004
961
  input RepayRequest {
1005
- """The market pool address"""
1006
- market: EvmAddress!
962
+ """The reserve id"""
963
+ reserve: ReserveId!
1007
964
 
1008
- """
1009
- The amount to repay - you can pass in the underlying or the aToken if you pass in the aToken address, it will repay with the aToken
1010
- """
1011
- amount: RepayAmountInput!
965
+ """The amount repaying"""
966
+ amount: RepayAmountInputWithPermit!
1012
967
 
1013
968
  """The user sending the transaction (normally the user's wallet address)"""
1014
969
  sender: EvmAddress!
1015
-
1016
- """
1017
- If not supplied, this will use \`sender\`. The address of the user who will get their debt reduced/removed. This should be the address of the user calling the function if they want to
1018
- """
1019
- onBehalfOf: EvmAddress
1020
-
1021
- """The chain id"""
1022
- chainId: ChainId!
1023
970
  }
1024
971
 
1025
972
  type Reserve {
1026
- """The market information the reserve is under"""
1027
- market: MarketInfo!
1028
-
1029
- """The reserve underlying currency"""
1030
- underlyingToken: Currency!
1031
-
1032
- """The reserve a token"""
1033
- aToken: Currency!
1034
-
1035
- """The reserve v token"""
1036
- vToken: Currency!
1037
-
1038
- """
1039
- If the reserve accepts native currency, for example, if you're on a reserve with asset WETH, it can
1040
- also accept ETH
1041
- """
1042
- acceptsNative: NativeCurrency
1043
-
1044
- """The reserve size"""
1045
- size: TokenAmount!
1046
-
1047
- """The usd exchange rate for the underlying token"""
1048
- usdExchangeRate: BigDecimal!
1049
-
1050
- """The usd oracle address it is pulling that price from"""
1051
- usdOracleAddress: EvmAddress!
1052
-
1053
- """The supply info for the reserve"""
1054
- supplyInfo: ReserveSupplyInfo!
1055
-
1056
- """
1057
- The borrow info for the reserve - if its null the underlying token cannot be borrowed
1058
- """
1059
- borrowInfo: ReserveBorrowInfo
1060
-
1061
- """The reserve has been frozen all actions are stopped"""
1062
- isFrozen: Boolean!
1063
-
1064
- """The reserve is paused you can still withdraw and some other actions"""
1065
- isPaused: Boolean!
1066
-
1067
- """
1068
- If the reserve supports isolation mode this is defined and the configs are defined
1069
- """
1070
- isolationModeConfig: ReserveIsolationModeConfig
1071
-
1072
- """If the reserve can use flash loans on it"""
1073
- flashLoanEnabled: Boolean!
1074
-
1075
- """The interest rate strategy address"""
1076
- interestRateStrategyAddress: EvmAddress!
1077
-
1078
- """Does the underlying reserve support permit"""
1079
- permitSupported: Boolean!
1080
-
1081
- """
1082
- This exposes the extra incentives you can earn from third parties (Merit) or from
1083
- incentives set by governance through the RewardsController.
1084
- Note Aave Labs does not guarantee third party program and accepts no liability to those
1085
- """
1086
- incentives: [ReserveIncentive!]!
1087
-
1088
- """The emode information for the reserve"""
1089
- eModeInfo: [EmodeReserveInfo!]!
1090
-
1091
- """Get the user state on the reserve"""
973
+ id: ReserveId!
974
+ onChainId: OnChainReserveId!
975
+ borrowCap: BigDecimal!
976
+ supplyCap: BigDecimal!
977
+ chain: Chain!
978
+ summary: ReserveSummary!
979
+ settings: ReserveSettings!
980
+ status: ReserveStatus!
981
+ canBorrow: Boolean!
982
+ canSupply: Boolean!
983
+ canUseAsCollateral: Boolean!
1092
984
  userState: ReserveUserState
985
+ asset: HubAsset!
986
+ spoke: Spoke!
1093
987
  }
1094
988
 
1095
- type ReserveBorrowInfo {
1096
- """The annual percentage yield for borrowing this asset"""
1097
- apy: PercentValue!
1098
-
1099
- """The total amount borrowed from this reserve"""
1100
- total: TokenAmount!
1101
-
1102
- """The reserve factor percentage"""
1103
- reserveFactor: PercentValue!
989
+ input ReserveAmountInput @oneOf {
990
+ """The native amount"""
991
+ native: BigDecimal
1104
992
 
1105
- """The available liquidity"""
1106
- availableLiquidity: TokenAmount!
993
+ """The erc20 amount input"""
994
+ erc20: ReserveErc20AmountInput
995
+ }
1107
996
 
1108
- """The reserve utilization rate"""
1109
- utilizationRate: PercentValue!
997
+ input ReserveAmountInputWithPermit @oneOf {
998
+ """The native amount"""
999
+ native: BigDecimal
1110
1000
 
1111
- """
1112
- Variable rate slope 1 - the rate of interest increase when utilization rate is below optimal
1113
- This is the slope of the interest rate curve in the first segment (0% to optimal utilization)
1114
- """
1115
- variableRateSlope1: PercentValue!
1001
+ """The erc20 amount input"""
1002
+ erc20: ReserveErc20AmountInputWithPermit
1003
+ }
1116
1004
 
1005
+ input ReserveErc20AmountInput {
1117
1006
  """
1118
- Variable rate slope 2 - the rate of interest increase when utilization rate is above optimal
1119
- This is the slope of the interest rate curve in the second segment (optimal to 100% utilization)
1120
- Typically much steeper than slope1 to discourage over-utilization
1007
+ Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction (e.g., wei).
1121
1008
  """
1122
- variableRateSlope2: PercentValue!
1009
+ value: BigDecimal!
1010
+ }
1123
1011
 
1012
+ input ReserveErc20AmountInputWithPermit {
1124
1013
  """
1125
- The optimal usage rate - the utilization rate at which the variable rate curve transitions
1126
- from slope1 to slope2. This represents the target utilization rate for the reserve
1014
+ Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction (e.g., wei).
1127
1015
  """
1128
- optimalUsageRate: PercentValue!
1016
+ value: BigDecimal!
1129
1017
 
1130
1018
  """
1131
- Borrowing can have different states based on the criteria of the user or the market
1019
+ The signed ERC20 permit message to operate on the relevant token without a need for an ERC20 Approval transaction.
1132
1020
  """
1133
- borrowingState: ReserveBorrowingState!
1134
-
1135
- """The borrow cap of the reserve"""
1136
- borrowCap: TokenAmount!
1137
-
1138
- """The borrow cap is now full"""
1139
- borrowCapReached: Boolean!
1140
- }
1141
-
1142
- enum ReserveBorrowingState {
1143
- """Borrowing is enabled"""
1144
- ENABLED
1145
-
1146
- """Borrowing is disabled"""
1147
- DISABLED
1148
-
1149
- """The user emode settings make this underlying not able to be borrowed"""
1150
- USER_EMODE_DISABLED_BORROW
1021
+ permitSig: ERC20PermitSignature
1151
1022
  }
1152
1023
 
1153
- union ReserveIncentive = MeritSupplyIncentive | MeritBorrowIncentive | MeritBorrowAndSupplyIncentiveCondition | AaveSupplyIncentive | AaveBorrowIncentive
1024
+ scalar ReserveId
1154
1025
 
1155
1026
  type ReserveInfo {
1156
- """The market information the reserve is under"""
1157
- market: MarketInfo!
1158
-
1159
- """The reserve underlying currency"""
1160
- underlyingToken: Currency!
1161
-
1162
- """The reserve a token"""
1163
- aToken: Currency!
1164
-
1165
- """The reserve v token"""
1166
- vToken: Currency!
1167
-
1168
- """The usd exchange rate for the underlying token"""
1169
- usdExchangeRate: BigDecimal!
1170
-
1171
- """Does the underlying reserve support permit"""
1172
- permitSupported: Boolean!
1173
-
1174
- """
1175
- This exposes the extra incentives you can earn from third parties (Merit) or from
1176
- incentives set by governance through the RewardsController.
1177
- Note Aave Labs does not guarantee third party program and accepts no liability to those
1178
- """
1179
- incentives: [ReserveIncentive!]!
1027
+ id: ReserveId!
1028
+ asset: HubAsset!
1180
1029
  }
1181
1030
 
1182
- type ReserveIsolationModeConfig {
1183
- """This means that it can be used to borrow"""
1184
- canBeCollateral: Boolean!
1185
- canBeBorrowed: Boolean!
1186
- debtCeiling: TokenAmount!
1187
-
1188
- """The decimals used for the debt ceiling"""
1189
- debtCeilingDecimals: Int!
1190
-
1191
- """Only the amount that is borrowed by the users in isolation"""
1192
- totalBorrows: TokenAmount!
1031
+ input ReserveInput {
1032
+ chainId: ChainId!
1033
+ spoke: EvmAddress!
1034
+ onChainId: OnChainReserveId!
1193
1035
  }
1194
1036
 
1195
1037
  input ReserveRequest {
1196
- """The pool address for the market"""
1197
- market: EvmAddress!
1198
-
1199
- """The underlying token for the reserve"""
1200
- underlyingToken: EvmAddress!
1201
-
1202
- """The chain id the pool is deployed on"""
1203
- chainId: ChainId!
1038
+ query: ReserveRequestQuery!
1204
1039
 
1205
1040
  """
1206
- The user viewing it (can be connected wallet) - this caters for stuff like eMode and other
1207
- user features
1041
+ The user who is doing the query (this injects user state into some of the return objects)
1208
1042
  """
1209
1043
  user: EvmAddress
1210
1044
  }
1211
1045
 
1212
- type ReserveSupplyInfo {
1213
- """The annual percentage yield for supplying this asset"""
1214
- apy: PercentValue!
1215
-
1216
- """The maximum loan-to-value ratio when used as collateral"""
1217
- maxLTV: PercentValue!
1218
-
1219
- """The liquidation threshold for this asset"""
1220
- liquidationThreshold: PercentValue!
1221
-
1222
- """The liquidation bonus applied when liquidated"""
1223
- liquidationBonus: PercentValue!
1224
-
1225
- """If the asset can be used for collateral"""
1226
- canBeCollateral: Boolean!
1227
-
1228
- """The supply cap"""
1229
- supplyCap: TokenAmount!
1230
-
1231
- """The supply cap is now full"""
1232
- supplyCapReached: Boolean!
1233
-
1234
- """The total amount supplied to this reserve"""
1235
- total: DecimalValue!
1046
+ input ReserveRequestQuery @oneOf {
1047
+ reserveId: ReserveId
1048
+ reserveInput: ReserveInput
1236
1049
  }
1237
1050
 
1238
- type ReserveUserState {
1239
- """The user's balance of this asset"""
1240
- balance: TokenAmount!
1241
-
1242
- """The amount the user can supply to this reserve"""
1243
- suppliable: TokenAmount!
1244
-
1245
- """The amount the user can borrow from this reserve"""
1246
- borrowable: TokenAmount!
1247
-
1248
- """The user emode info if enabled"""
1249
- emode: EmodeReserveInfo
1250
-
1251
- """
1252
- If the user is in a state to be able to supply taking into consideration their emode
1253
- """
1254
- canBeCollateral: Boolean!
1255
-
1256
- """If the user is in a state to be able to borrow from the reserve"""
1257
- canBeBorrowed: Boolean!
1258
-
1259
- """Is the user in isolation mode"""
1260
- isInIsolationMode: Boolean!
1051
+ type ReserveSettings {
1052
+ collateralFactor: PercentNumber!
1053
+ maxLiquidationBonus: PercentNumber!
1054
+ collateralRisk: PercentNumber!
1055
+ borrowable: Boolean!
1056
+ collateral: Boolean!
1057
+ suppliable: Boolean!
1261
1058
  }
1262
1059
 
1263
- input SavingsGhoBalanceRequest {
1264
- """The user to query the savings GHO balance"""
1265
- user: EvmAddress!
1266
-
1267
- """The chain id - savings GHO for now only works on Ethereum"""
1268
- chainId: ChainId
1060
+ type ReserveStatus {
1061
+ frozen: Boolean!
1062
+ paused: Boolean!
1063
+ active: Boolean!
1269
1064
  }
1270
1065
 
1271
- input SavingsGhoDepositRequest {
1272
- """The details of the amounts to deposit."""
1273
- amount: SayingsGhoDepositAmountInput!
1274
-
1275
- """The user who is depositing"""
1276
- depositor: EvmAddress!
1277
-
1278
- """
1279
- The address to which saving GHO shares will be minted to - defaults to \`depositor\`.
1280
- """
1281
- recipient: EvmAddress
1282
-
1283
- """The chain id - savings GHO for now only works on Ethereum"""
1284
- chainId: ChainId
1066
+ type ReserveSummary {
1067
+ supplied: Erc20Amount!
1068
+ borrowed: Erc20Amount!
1069
+ supplyApy: PercentNumber!
1070
+ borrowApy: PercentNumber!
1285
1071
  }
1286
1072
 
1287
- input SavingsGhoWithdrawAmount @oneOf {
1288
- """Exact amount to withdraw"""
1289
- exact: BigDecimal
1290
-
1291
- """Withdraw all"""
1292
- max: AlwaysTrue
1073
+ type ReserveUserState {
1074
+ balance: Erc20Amount!
1075
+ suppliable: Erc20Amount!
1076
+ borrowable: Erc20Amount!
1077
+ borrowApy: PercentNumber!
1293
1078
  }
1294
1079
 
1295
- input SavingsGhoWithdrawRequest {
1296
- """The amount of GHO to withdraw."""
1297
- amount: SavingsGhoWithdrawAmount!
1080
+ input ReservesRequest {
1081
+ """The reserve's request query"""
1082
+ query: ReservesRequestQuery!
1298
1083
 
1299
1084
  """
1300
- The address from which saving GHO shares will be burned in return for GHO (normally your own wallet).
1085
+ The user who is doing the query (this injects user state into some of the return objects)
1301
1086
  """
1302
- sharesOwner: EvmAddress!
1087
+ user: EvmAddress
1303
1088
 
1304
- """The address to which GHO will be minted to - defaults to \`depositor\`."""
1305
- recipient: EvmAddress
1089
+ """The reserve's filter"""
1090
+ filter: ReservesRequestFilter! = ALL
1306
1091
 
1307
- """The chain id - savings GHO for now only works on Ethereum"""
1308
- chainId: ChainId
1092
+ """The reserve's order by"""
1093
+ orderBy: ReservesRequestOrderBy! = {assetName: ASC}
1309
1094
  }
1310
1095
 
1311
- input SayingsGhoDepositAmountInput {
1312
- """The amount of GHO to deposit"""
1313
- value: BigDecimal!
1314
-
1315
- """
1316
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
1317
- """
1318
- permitSig: ERC712Signature
1096
+ enum ReservesRequestFilter {
1097
+ SUPPLY
1098
+ BORROW
1099
+ ALL
1319
1100
  }
1320
1101
 
1321
- scalar Signature
1322
-
1323
- input SupplyAPYHistoryRequest {
1324
- """The market pool address"""
1325
- market: EvmAddress!
1326
-
1327
- """The underlying token for the reserve"""
1328
- underlyingToken: EvmAddress!
1329
-
1330
- """The time windows for the history"""
1331
- window: TimeWindow!
1332
-
1333
- """The chain id"""
1334
- chainId: ChainId!
1102
+ input ReservesRequestOrderBy @oneOf {
1103
+ assetName: OrderDirection
1104
+ userBalance: OrderDirection
1105
+ supplyApy: OrderDirection
1106
+ supplyAvailable: OrderDirection
1107
+ borrowApy: OrderDirection
1108
+ borrowAvailable: OrderDirection
1109
+ collateralFactor: OrderDirection
1335
1110
  }
1336
1111
 
1337
- input SupplyRequest {
1338
- """The market pool address"""
1339
- market: EvmAddress!
1112
+ input ReservesRequestQuery @oneOf {
1113
+ """Get all the reserves for a spoke"""
1114
+ spoke: SpokeInput
1340
1115
 
1341
- """The amount supplying"""
1342
- amount: AmountInput!
1116
+ """Get all the reserves for a spoke"""
1117
+ spokeId: SpokeId
1343
1118
 
1344
- """The user sending the transaction (normally the users wallet address)"""
1345
- sender: EvmAddress!
1119
+ """Get all the reserves with underlying tokens"""
1120
+ tokens: [Erc20Input!]
1346
1121
 
1347
- """
1348
- If not supplied, this will use \`sender\`. The address that will receive the corresponding aTokens. This is the only address that will be able to withdraw the asset from the pool.
1349
- This will be the same as msg.sender if the user wants to receive aTokens into their own wallet, or use a different address if the beneficiary
1350
- of aTokens is a different wallet
1351
- """
1352
- onBehalfOf: EvmAddress
1122
+ """Get all the reserves on a hub for an underlying"""
1123
+ hubToken: HubTokenInput
1353
1124
 
1354
- """The chain id"""
1355
- chainId: ChainId!
1356
- }
1125
+ """Get all the reserves on a list of chains"""
1126
+ chainIds: [ChainId!]
1357
1127
 
1358
- enum TimeWindow {
1359
- LAST_DAY
1360
- LAST_WEEK
1361
- LAST_MONTH
1362
- LAST_SIX_MONTHS
1363
- LAST_YEAR
1364
- }
1128
+ """Get all the reserves for a spoke for an underlying"""
1129
+ spokeToken: SpokeTokenInput
1365
1130
 
1366
- type TokenAmount {
1367
- usdPerToken: BigDecimal!
1131
+ """Get all tokens on a hub"""
1132
+ hub: HubInput
1368
1133
 
1369
- """The amount"""
1370
- amount: DecimalValue!
1371
-
1372
- """The usd full amount"""
1373
- usd: BigDecimal!
1134
+ """Get all the reserves on based on user position id"""
1135
+ userPositionId: UserPositionId
1374
1136
  }
1375
1137
 
1376
- """
1377
- Represents a transaction that must be executed, such as a direct supply, borrow, etc.
1378
- """
1379
- type TransactionRequest {
1380
- """Who the transaction is going to (normally a contract)"""
1381
- to: EvmAddress!
1138
+ input SetSpokeUserPositionManagerRequest {
1139
+ """The spoke id"""
1140
+ spoke: SpokeId!
1382
1141
 
1383
- """Who is sending the transaction"""
1384
- from: EvmAddress!
1142
+ """The address to become the position manager"""
1143
+ manager: EvmAddress!
1385
1144
 
1386
- """The blockchain transaction encoded data"""
1387
- data: BlockchainData!
1388
-
1389
- """The native token value"""
1390
- value: BigInt!
1145
+ """Approve or remove the manager"""
1146
+ approve: Boolean!
1391
1147
 
1392
- """The chain id"""
1393
- chainId: ChainId!
1148
+ """The user to set the position \`manager\` for"""
1149
+ user: EvmAddress!
1394
1150
 
1395
- """
1396
- The primary well-known operation the transaction is - you use this to track hasProcessedKnownTransaction
1397
- If null the API does not track/require the outcome - once receipt is done, everything is ready to go
1398
- """
1399
- operation: OperationType
1151
+ """The signature"""
1152
+ signature: ERC20PermitSignature
1400
1153
  }
1401
1154
 
1402
- scalar TxHash
1155
+ input SetUserSupplyAsCollateralRequest {
1156
+ """The reserve id"""
1157
+ reserve: ReserveId!
1403
1158
 
1404
- type TypeDefinition {
1405
- EIP712Domain: [TypeField!]!
1406
- Permit: [TypeField!]!
1407
- }
1159
+ """The user sending the transaction (normally the user's wallet address)"""
1160
+ sender: EvmAddress!
1408
1161
 
1409
- type TypeField {
1410
- name: String!
1411
- type: String!
1162
+ """If you want to enable the collateral or disable"""
1163
+ enableCollateral: Boolean!
1412
1164
  }
1413
1165
 
1414
- scalar URL
1166
+ scalar Signature
1415
1167
 
1416
- type UsdExchangeRate {
1417
- currency: Currency!
1418
- rate: BigDecimal!
1419
- }
1168
+ type Spoke {
1169
+ """The id for the spoke"""
1170
+ id: SpokeId!
1420
1171
 
1421
- input UsdExchangeRatesRequest {
1422
- """The pool address for the market"""
1423
- market: EvmAddress!
1172
+ """The spoke name (offchain)"""
1173
+ name: String!
1424
1174
 
1425
- """The underlying tokens for the reserve"""
1426
- underlyingTokens: [EvmAddress!]!
1175
+ """The spoke address"""
1176
+ address: EvmAddress!
1427
1177
 
1428
- """The chain id"""
1429
- chainId: ChainId!
1178
+ """The spoke chain"""
1179
+ chain: Chain!
1430
1180
  }
1431
1181
 
1432
- """A transaction where the user borrowed assets from a reserve."""
1433
- type UserBorrowTransaction {
1434
- """Amount borrowed."""
1435
- amount: TokenAmount!
1182
+ scalar SpokeId
1436
1183
 
1437
- """Reserve from which assets were borrowed."""
1438
- reserve: ReserveInfo!
1439
-
1440
- """URL to view the transaction on a block explorer."""
1441
- blockExplorerUrl: String!
1442
-
1443
- """Transaction hash."""
1444
- txHash: TxHash!
1184
+ input SpokeInput {
1185
+ """The address of the spoke"""
1186
+ address: EvmAddress!
1445
1187
 
1446
- """Timestamp of the transaction."""
1447
- timestamp: DateTime!
1188
+ """The chain id the spoke is deployed to"""
1189
+ chainId: ChainId!
1448
1190
  }
1449
1191
 
1450
- input UserBorrowsRequest {
1451
- """The market addresses and chains ids to query"""
1452
- markets: [MarketInput!]!
1453
-
1454
- """The user address to get borrow positions for"""
1455
- user: EvmAddress!
1456
-
1457
- """How to order the results"""
1458
- orderBy: UserBorrowsRequestOrderBy! = {name: ASC}
1192
+ input SpokePositionManagersRequest {
1193
+ spoke: SpokeId!
1194
+ includeInactive: Boolean
1195
+ pageSize: PageSize!
1196
+ cursor: Cursor
1459
1197
  }
1460
1198
 
1461
- input UserBorrowsRequestOrderBy @oneOf {
1462
- """Order by the user's debt amount"""
1463
- debt: OrderDirection
1464
-
1465
- """Order by the asset name"""
1466
- name: OrderDirection
1467
-
1468
- """Order by the annual percentage yield"""
1469
- apy: OrderDirection
1199
+ type SpokePositionManger {
1200
+ name: String!
1201
+ address: EvmAddress!
1202
+ active: Boolean!
1470
1203
  }
1471
1204
 
1472
- """A transaction where the user was involved in a liquidation call."""
1473
- type UserLiquidationCallTransaction {
1474
- """Collateral liquidated."""
1475
- collateral: LiquidationCollateral!
1476
-
1477
- """Debt repaid."""
1478
- debtRepaid: LiquidationRepaidDebt!
1479
-
1480
- """URL to view the transaction on a block explorer."""
1481
- blockExplorerUrl: String!
1482
-
1483
- """Transaction hash."""
1484
- txHash: TxHash!
1485
-
1486
- """Timestamp of the transaction."""
1487
- timestamp: DateTime!
1205
+ input SpokeRequest {
1206
+ """The spoke request query"""
1207
+ query: SpokeRequestQuery!
1488
1208
  }
1489
1209
 
1490
- input UserMarketStateRequest {
1491
- """The pool address for the market"""
1492
- market: EvmAddress!
1493
-
1494
- """The user to toggle emode on"""
1495
- user: EvmAddress!
1496
-
1497
- """The chain id"""
1498
- chainId: ChainId!
1210
+ input SpokeRequestQuery @oneOf {
1211
+ spoke: SpokeInput
1212
+ spokeId: SpokeId
1499
1213
  }
1500
1214
 
1501
- type UserMeritRewards {
1502
- """The chain the transaction is on"""
1503
- chain: ChainId!
1215
+ input SpokeTokenInput {
1216
+ """The spoke id"""
1217
+ spoke: SpokeId!
1504
1218
 
1505
- """
1506
- The reward tokens being claimed in the transaction - this is aggregated
1507
- """
1508
- claimable: [ClaimableMeritReward!]!
1509
-
1510
- """The transaction to execute to claim the rewards"""
1511
- transaction: TransactionRequest!
1219
+ """The token"""
1220
+ token: EvmAddress!
1512
1221
  }
1513
1222
 
1514
- input UserMeritRewardsFilter {
1515
- """If you only care about certain tokens to claim and see details of"""
1516
- tokens: [EvmAddress!]
1223
+ type SpokeUserPositionManager {
1224
+ name: String!
1225
+ address: EvmAddress!
1226
+ approvedOn: DateTime!
1227
+ active: Boolean!
1517
1228
  }
1518
1229
 
1519
- input UserMeritRewardsRequest {
1520
- """The user to claim with"""
1230
+ input SpokeUserPositionManagersRequest {
1231
+ spoke: SpokeId!
1521
1232
  user: EvmAddress!
1522
-
1523
- """The chain id to claim on"""
1524
- chainId: ChainId!
1525
- filter: UserMeritRewardsFilter
1233
+ pageSize: PageSize!
1234
+ cursor: Cursor
1526
1235
  }
1527
1236
 
1528
- """A transaction where the user repaid borrowed assets."""
1529
- type UserRepayTransaction {
1530
- """Amount repaid."""
1531
- amount: TokenAmount!
1532
-
1533
- """Reserve to which assets were repaid."""
1534
- reserve: ReserveInfo!
1535
-
1536
- """URL to view the transaction on a block explorer."""
1537
- blockExplorerUrl: String!
1538
-
1539
- """Transaction hash."""
1540
- txHash: TxHash!
1541
-
1542
- """Timestamp of the transaction."""
1543
- timestamp: DateTime!
1237
+ input SpokesRequest {
1238
+ query: SpokesRequestQuery!
1544
1239
  }
1545
1240
 
1546
- input UserSetEmodeRequest {
1547
- """The pool address for the market"""
1548
- market: EvmAddress!
1549
-
1550
- """The user to toggle emode on"""
1551
- user: EvmAddress!
1552
-
1241
+ input SpokesRequestQuery @oneOf {
1553
1242
  """
1554
- The eMode category id for the market if you want to disable eMode, then pass in null
1243
+ The hub id
1244
+ Get all the spokes which hubs are linked to a spoke reserve
1555
1245
  """
1556
- categoryId: Int
1557
-
1558
- """The chain id"""
1559
- chainId: ChainId!
1560
- }
1561
-
1562
- input UserSuppliesRequest {
1563
- """The market addresses and chains ids to query"""
1564
- markets: [MarketInput!]!
1246
+ hubId: HubId
1565
1247
 
1566
- """The user address to get supply positions for"""
1567
- user: EvmAddress!
1568
-
1569
- """Only get back the supplies which can be used as collateral"""
1570
- collateralsOnly: Boolean! = false
1571
-
1572
- """How to order the results"""
1573
- orderBy: UserSuppliesRequestOrderBy! = {name: ASC}
1574
- }
1575
-
1576
- input UserSuppliesRequestOrderBy @oneOf {
1577
- """Order by the user's supply balance"""
1578
- balance: OrderDirection
1579
-
1580
- """Order by the asset name"""
1581
- name: OrderDirection
1582
-
1583
- """Order by the annual percentage yield"""
1584
- apy: OrderDirection
1248
+ """
1249
+ The hub address and chain id
1250
+ Get all the spokes which hubs are linked to a spoke reserve
1251
+ """
1252
+ hub: HubInput
1585
1253
 
1586
- """Order by whether the position is used as collateral"""
1587
- isCollateralized: OrderDirection
1254
+ """
1255
+ The chain ids
1256
+ Get all the spokes which are on the list of chain ids
1257
+ """
1258
+ chainIds: [ChainId!]
1588
1259
  }
1589
1260
 
1590
- """A transaction where the user supplied assets to a reserve."""
1591
- type UserSupplyTransaction {
1592
- """Amount supplied."""
1593
- amount: TokenAmount!
1594
-
1595
- """Reserve to which assets were supplied."""
1596
- reserve: ReserveInfo!
1597
-
1598
- """URL to view the transaction on a block explorer."""
1599
- blockExplorerUrl: String!
1600
-
1601
- """Transaction hash."""
1602
- txHash: TxHash!
1603
-
1604
- """Timestamp of the transaction."""
1605
- timestamp: DateTime!
1261
+ input SupplyAPYHistoryRequest {
1262
+ reserve: ReserveId!
1263
+ window: TimeWindow! = LAST_DAY
1606
1264
  }
1607
1265
 
1608
- input UserTransactionHistoryRequest {
1609
- """The market address"""
1610
- market: EvmAddress!
1611
-
1612
- """The filter to optionally filter the transactions by type"""
1613
- filter: [UserTransactionType!]! = [SUPPLY, WITHDRAW, BORROW, REPAY, USAGE_AS_COLLATERAL, LIQUIDATION_CALL]
1614
-
1615
- """The order by object to sort the transactions by"""
1616
- orderBy: UserTransactionHistoryRequestOrderBy! = {date: ASC}
1617
-
1618
- """The user that sent the transactions"""
1266
+ type SupplyActivity {
1267
+ id: ID!
1619
1268
  user: EvmAddress!
1620
-
1621
- """The chain id where the transactions were sent"""
1622
- chainId: ChainId!
1623
-
1624
- """The page size"""
1625
- pageSize: PageSize! = FIFTY
1626
-
1627
- """Pagination cursor"""
1628
- cursor: Cursor
1629
- }
1630
-
1631
- input UserTransactionHistoryRequestOrderBy {
1632
- """Order by the date of the transaction"""
1633
- date: OrderDirection
1269
+ timestamp: DateTime!
1270
+ txHash: TxHash!
1271
+ spoke: Spoke!
1272
+ reserve: ReserveInfo!
1273
+ supplied: Erc20Amount!
1274
+ chain: Chain!
1634
1275
  }
1635
1276
 
1636
- union UserTransactionItem = UserSupplyTransaction | UserWithdrawTransaction | UserBorrowTransaction | UserRepayTransaction | UserUsageAsCollateralTransaction | UserLiquidationCallTransaction
1277
+ input SupplyPermitRequest {
1278
+ """The reserve id"""
1279
+ reserve: ReserveId!
1637
1280
 
1638
- """The type of user transaction in the protocol."""
1639
- enum UserTransactionType {
1640
- """User supplied assets to the protocol."""
1641
- SUPPLY
1642
-
1643
- """User borrowed assets from the protocol."""
1644
- BORROW
1645
-
1646
- """User enabled or disabled usage of an asset as collateral."""
1647
- USAGE_AS_COLLATERAL
1648
-
1649
- """User was involved in a liquidation call."""
1650
- LIQUIDATION_CALL
1281
+ """The amount supplying"""
1282
+ amount: ReserveErc20AmountInput!
1651
1283
 
1652
- """User repaid a borrowed amount."""
1653
- REPAY
1284
+ """If you wish to enable collateral with it meaning you can borrow"""
1285
+ enableCollateral: Boolean! = true
1654
1286
 
1655
- """User withdrew supplied assets."""
1656
- WITHDRAW
1287
+ """The user sending the transaction (normally the user's wallet address)"""
1288
+ sender: EvmAddress!
1657
1289
  }
1658
1290
 
1659
- """
1660
- A transaction where the user enabled or disabled usage of an asset as collateral.
1661
- """
1662
- type UserUsageAsCollateralTransaction {
1663
- """Whether collateral usage was enabled."""
1664
- enabled: Boolean!
1665
-
1666
- """Reserve for which collateral usage was changed."""
1667
- reserve: ReserveInfo!
1668
-
1669
- """URL to view the transaction on a block explorer."""
1670
- blockExplorerUrl: String!
1671
-
1672
- """Transaction hash."""
1673
- txHash: TxHash!
1291
+ input SupplyRequest {
1292
+ """The reserve id"""
1293
+ reserve: ReserveId!
1674
1294
 
1675
- """Timestamp of the transaction."""
1676
- timestamp: DateTime!
1677
- }
1295
+ """The amount supplying"""
1296
+ amount: ReserveAmountInputWithPermit!
1678
1297
 
1679
- type UserVaultShares {
1680
- """The user's shares on the vault"""
1681
- shares: TokenAmount!
1298
+ """If you wish to enable collateral with it meaning you can borrow"""
1299
+ enableCollateral: Boolean! = true
1682
1300
 
1683
- """The balance you can withdraw"""
1684
- balance: TokenAmount!
1301
+ """The user sending the transaction (normally the user's wallet address)"""
1302
+ sender: EvmAddress!
1685
1303
  }
1686
1304
 
1687
- input UserVaultsFilter {
1688
- """Filter by markets"""
1689
- vaults: [VaultInput!]
1690
-
1691
- """Filter by underlying token addresses"""
1692
- underlyingTokens: [EvmAddress!]
1305
+ type SwapApprovalRequired {
1306
+ approval: TransactionRequest!
1307
+ originalTransaction: SwapTransactionRequest!
1693
1308
  }
1694
1309
 
1695
- input UserVaultsOrderBy @oneOf {
1696
- """Order by shares"""
1697
- shares: OrderDirection
1310
+ type SwapByIntent {
1311
+ quote: SwapQuote!
1312
+ data: SwapByIntentTypedData!
1313
+ }
1698
1314
 
1699
- """Order by fee"""
1700
- fee: OrderDirection
1315
+ input SwapByIntentInput {
1316
+ quoteId: SwapQuoteId!
1317
+ signature: Signature!
1701
1318
  }
1702
1319
 
1703
- input UserVaultsRequest {
1704
- """The user address"""
1705
- user: EvmAddress!
1320
+ type SwapByIntentTypeDefinition {
1321
+ EIP712Domain: [TypeField!]!
1322
+ Order: [TypeField!]!
1323
+ }
1706
1324
 
1707
- """Filter criteria"""
1708
- filters: UserVaultsFilter
1325
+ type SwapByIntentTypedData {
1326
+ types: SwapByIntentTypeDefinition!
1327
+ primaryType: String!
1328
+ domain: DomainData!
1329
+ message: JSON!
1330
+ }
1709
1331
 
1710
- """Ordering criteria"""
1711
- orderBy: UserVaultsOrderBy! = {shares: ASC}
1332
+ type SwapByIntentWithApprovalRequired {
1333
+ quote: SwapQuote!
1334
+ approval: TransactionRequest!
1335
+ data: SwapByIntentTypedData!
1336
+ }
1712
1337
 
1713
- """The page size"""
1714
- pageSize: PageSize! = FIFTY
1338
+ type SwapByTransaction {
1339
+ quote: SwapQuote!
1340
+ }
1715
1341
 
1716
- """Pagination cursor"""
1717
- cursor: Cursor
1342
+ type SwapCancelled {
1343
+ createdAt: DateTime!
1344
+ cancelledAt: DateTime
1345
+ explorerLink: String!
1718
1346
  }
1719
1347
 
1720
- """A transaction where the user withdrew assets from a reserve."""
1721
- type UserWithdrawTransaction {
1722
- """Amount withdrawn."""
1723
- amount: TokenAmount!
1348
+ union SwapExecutionPlan = SwapTransactionRequest | SwapApprovalRequired | InsufficientBalanceError | SwapReceipt
1724
1349
 
1725
- """Reserve from which assets were withdrawn."""
1726
- reserve: ReserveInfo!
1350
+ type SwapExpired {
1351
+ createdAt: DateTime!
1352
+ expiredAt: DateTime!
1353
+ explorerLink: String!
1354
+ }
1727
1355
 
1728
- """URL to view the transaction on a block explorer."""
1729
- blockExplorerUrl: String!
1356
+ type SwapFulfilled {
1357
+ txHash: String!
1358
+ desiredSell: TokenAmount!
1359
+ desiredBuy: TokenAmount!
1360
+ sold: TokenAmount!
1361
+ bought: TokenAmount!
1362
+ createdAt: DateTime!
1363
+ fulfilledAt: DateTime!
1364
+ explorerLink: String!
1365
+ refundTxHash: TxHash
1366
+ }
1730
1367
 
1731
- """Transaction hash."""
1732
- txHash: TxHash!
1368
+ scalar SwapId
1733
1369
 
1734
- """Timestamp of the transaction."""
1735
- timestamp: DateTime!
1370
+ enum SwapKind {
1371
+ BUY
1372
+ SELL
1736
1373
  }
1737
1374
 
1738
- type Vault {
1739
- """The vault address"""
1740
- address: EvmAddress!
1375
+ type SwapOpen {
1376
+ swapId: SwapId!
1377
+ createdAt: DateTime!
1378
+ deadline: DateTime!
1379
+ explorerLink: String!
1380
+ desiredSell: TokenAmount!
1381
+ desiredBuy: TokenAmount!
1382
+ }
1741
1383
 
1742
- """The name of the share"""
1743
- shareName: String!
1384
+ type SwapPendingSignature {
1385
+ createdAt: DateTime!
1386
+ deadline: DateTime!
1387
+ explorerLink: String!
1388
+ }
1744
1389
 
1745
- """The symbol of the share"""
1746
- shareSymbol: String!
1390
+ type SwapQuote {
1391
+ quoteId: SwapQuoteId!
1392
+ suggestedSlippage: PercentNumber!
1393
+ desiredSell: TokenAmount!
1394
+ desiredBuy: TokenAmount!
1395
+ costs: SwapQuoteCosts!
1747
1396
 
1748
- """The reserve the vault is using"""
1749
- usedReserve: Reserve!
1397
+ """Minimum received amount after all costs and slippage"""
1398
+ minimumReceived: TokenAmount!
1399
+ }
1750
1400
 
1751
- """The current fee percentage set for the vault."""
1752
- fee: PercentValue!
1401
+ type SwapQuoteCosts {
1402
+ """Network and provider costs"""
1403
+ networkCosts: TokenAmount!
1753
1404
 
1754
- """How much this vault has made in revenue"""
1755
- totalFeeRevenue: TokenAmount!
1405
+ """Aave partner fee amount"""
1406
+ partnerFee: TokenAmount!
1407
+ }
1756
1408
 
1757
- """
1758
- The last recorded balance of the vault's AToken. This value is updated when yield is accrued.
1759
- """
1760
- balance: TokenAmount!
1409
+ scalar SwapQuoteId
1761
1410
 
1762
- """The chain id the vault lives on"""
1411
+ input SwapQuoteRequest {
1763
1412
  chainId: ChainId!
1413
+ buy: TokenInput!
1414
+ sell: TokenInput!
1415
+ amount: BigDecimal!
1416
+ kind: SwapKind
1417
+ from: EvmAddress!
1418
+ receiver: EvmAddress
1419
+ }
1764
1420
 
1765
- """The user's shares info on the vault"""
1766
- userShares: UserVaultShares
1421
+ type SwapReceipt {
1422
+ id: SwapId!
1423
+ createdAt: DateTime!
1424
+ explorerLink: String!
1425
+ }
1767
1426
 
1768
- """The owner of the vault"""
1769
- owner: EvmAddress!
1427
+ input SwapRequest @oneOf {
1428
+ intent: SwapByIntentInput
1429
+ transaction: SwapWithTransactionInput
1430
+ }
1770
1431
 
1771
- """The total fees the owner can claim currently for the vault"""
1772
- feesBalance: TokenAmount!
1432
+ union SwapStatus = SwapOpen | SwapPendingSignature | SwapCancelled | SwapExpired | SwapFulfilled
1773
1433
 
1774
- """The total vault APR after their fee is taken off"""
1775
- vaultApr: PercentValue!
1434
+ enum SwapStatusFilter {
1435
+ CANCELLED
1436
+ EXPIRED
1437
+ FULFILLED
1438
+ OPEN
1439
+ PENDING_SIGNATURE
1440
+ }
1776
1441
 
1777
- """
1778
- The recipient configuration for distributing the vault fees.
1779
- Returns None if the vault doesn't have any recipients configured (in which case the owner is the sole fee recipient)
1780
- """
1781
- recipients: VaultFeesRecipientsConfiguration
1442
+ input SwapStatusRequest {
1443
+ id: SwapId!
1782
1444
  }
1783
1445
 
1784
- input VaultCreateRecipientsConfigurationRequest {
1785
- """The vault deployed address"""
1786
- vault: EvmAddress!
1446
+ type SwapTransactionRequest {
1447
+ transaction: TransactionRequest!
1448
+ orderReceipt: SwapReceipt!
1449
+ }
1787
1450
 
1788
- """The chain id"""
1789
- chainId: ChainId!
1451
+ input SwapWithTransactionInput {
1452
+ quoteId: SwapQuoteId!
1453
+ permitSig: Signature
1790
1454
 
1791
1455
  """
1792
- The recipients of the fee revenue, expressed as a percentage of the total fee revenue.
1793
- Vault revenue is split between the recipients and the Aave fee recipient (50/50 split).
1456
+ Whether the swap order creator is a smart contract wallet. If not provided, it will be inferred following the ERC-1271 standard.
1794
1457
  """
1795
- recipients: [VaultFeesRecipientSplitInput!]!
1458
+ isSenderSmartContractWallet: Boolean
1796
1459
  }
1797
1460
 
1798
- input VaultDeployRequest {
1799
- """Underlying token address."""
1800
- underlyingToken: EvmAddress!
1461
+ input SwappableTokenInput @oneOf {
1462
+ native: ChainId
1463
+ erc20: Erc20Input
1464
+ }
1801
1465
 
1802
- """The market address."""
1803
- market: EvmAddress!
1466
+ input SwappableTokensRequest {
1467
+ query: SwappableTokensRequestQuery
1468
+ }
1804
1469
 
1805
- """The chain id"""
1806
- chainId: ChainId!
1470
+ input SwappableTokensRequestQuery @oneOf {
1471
+ chainIds: [ChainId!]
1472
+ from: SwappableTokenInput
1473
+ to: SwappableTokenInput
1474
+ }
1807
1475
 
1808
- """
1809
- The address to set as which deploys the vault and will become an owner of the vault.
1810
- """
1811
- deployer: EvmAddress!
1476
+ enum TimeWindow {
1477
+ LAST_DAY
1478
+ LAST_WEEK
1479
+ LAST_MONTH
1480
+ LAST_SIX_MONTHS
1481
+ LAST_YEAR
1482
+ ALL
1483
+ }
1812
1484
 
1813
- """The owner of the vault - if not defined, it will be the deployer"""
1814
- owner: EvmAddress
1485
+ union Token = NativeToken | Erc20Token
1815
1486
 
1816
- """The initial fee to set, expressed in %."""
1817
- initialFee: BigDecimal!
1487
+ union TokenAmount = NativeAmount | Erc20Amount
1818
1488
 
1819
- """The name to set for the vault's shares."""
1820
- shareName: String!
1489
+ type TokenInfo {
1490
+ """The token name"""
1491
+ name: String!
1821
1492
 
1822
- """The symbol to set for the vault's shares."""
1823
- shareSymbol: String!
1493
+ """The token symbol"""
1494
+ symbol: String!
1824
1495
 
1825
- """
1826
- The initial amount of underlying assets to deposit. This must be a non-zero, non-trivial amount, depending on the underlying asset's decimals.
1827
- """
1828
- initialLockDeposit: BigDecimal!
1496
+ """The token icon"""
1497
+ icon: String!
1829
1498
 
1830
- """
1831
- The recipients of the fee revenue, expressed as a percentage of the total fee revenue.
1832
- If not provided, the fee revenue will be sent to the owner of the vault.
1833
- Vault revenue is split between the recipients and the Aave fee recipient (50/50 split).
1834
- """
1835
- recipients: [VaultFeesRecipientSplitInput!]
1499
+ """The token decimals"""
1500
+ decimals: Int!
1836
1501
  }
1837
1502
 
1838
- input VaultDepositAmountInput {
1839
- """The amount of assets to deposit."""
1840
- value: BigDecimal!
1841
-
1842
- """Whether you are depositing in as a token or normal underlying"""
1843
- asAToken: Boolean! = false
1503
+ input TokenInput @oneOf {
1504
+ """Native token"""
1505
+ native: AlwaysTrue
1844
1506
 
1845
- """
1846
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
1847
- """
1848
- permitSig: ERC712Signature
1507
+ """The erc20 address"""
1508
+ erc20: EvmAddress
1849
1509
  }
1850
1510
 
1851
- input VaultDepositRequest {
1852
- """The vault address"""
1853
- vault: EvmAddress!
1511
+ type TransactionRequest {
1512
+ to: EvmAddress!
1513
+ from: EvmAddress!
1514
+ data: BlockchainData!
1515
+ value: BigInt!
1516
+ chainId: ChainId!
1517
+ operations: [OperationType!]
1518
+ }
1854
1519
 
1855
- """The details of the amounts to deposit."""
1856
- amount: VaultDepositAmountInput!
1520
+ scalar TxHash
1857
1521
 
1858
- """The user who is depositing"""
1859
- depositor: EvmAddress!
1522
+ input TxHashInput {
1523
+ txHash: TxHash!
1524
+ chainId: ChainId!
1525
+ }
1860
1526
 
1861
- """
1862
- The address to which vault shares will be minted to - defaults to depositor.
1863
- """
1864
- sharesRecipient: EvmAddress
1527
+ type TypeDefinition {
1528
+ EIP712Domain: [TypeField!]!
1529
+ Permit: [TypeField!]!
1530
+ }
1865
1531
 
1866
- """The chain id"""
1867
- chainId: ChainId!
1532
+ type TypeField {
1533
+ name: String!
1534
+ type: String!
1868
1535
  }
1869
1536
 
1870
- type VaultFeesRecipientSplit {
1871
- """Address receiving the fee share"""
1872
- address: EvmAddress!
1537
+ input UpdateUserDynamicConfigRequest {
1538
+ """The spoke id"""
1539
+ spoke: SpokeId!
1873
1540
 
1874
- """Portion of the owner share allocated to this recipient"""
1875
- split: PercentValue!
1541
+ """The user sending the transaction (normally the user's wallet address)"""
1542
+ sender: EvmAddress!
1876
1543
 
1877
- """True, if it's an Aave Labs recipient address"""
1878
- isAaveLabs: Boolean!
1544
+ """If not supplied, this will use \`sender\` which is the normal route"""
1545
+ onBehalfOf: EvmAddress
1879
1546
  }
1880
1547
 
1881
- input VaultFeesRecipientSplitInput {
1882
- """Address of the recipient."""
1883
- address: EvmAddress!
1548
+ input UpdateUserRiskPremiumRequest {
1549
+ """The spoke id"""
1550
+ spoke: SpokeId!
1884
1551
 
1885
- """Percentage of the fee that will be sent to the recipient."""
1886
- percent: BigDecimal!
1552
+ """The user sending the transaction (normally the user's wallet address)"""
1553
+ sender: EvmAddress!
1554
+
1555
+ """If not supplied, this will use \`sender\` which is the normal route"""
1556
+ onBehalfOf: EvmAddress
1887
1557
  }
1888
1558
 
1889
- type VaultFeesRecipientsConfiguration {
1890
- """Revenue splitter contract address responsible for distributing fees"""
1891
- address: EvmAddress!
1559
+ type UserBalance {
1560
+ """The user balance id"""
1561
+ id: UserBalanceId!
1892
1562
 
1893
- """Recipients receiving the vault owner's share"""
1894
- entries: [VaultFeesRecipientSplit!]!
1895
- }
1563
+ """The token info"""
1564
+ info: TokenInfo!
1896
1565
 
1897
- input VaultInput {
1898
- """The address of the fault"""
1899
- address: EvmAddress!
1566
+ """The balances across chains it will be 1 item per chain"""
1567
+ balances: [TokenAmount!]!
1900
1568
 
1901
- """The chain id the vault is on"""
1902
- chainId: ChainId!
1903
- }
1569
+ """The total amount summed across all balances"""
1570
+ totalAmount: DecimalNumber!
1904
1571
 
1905
- input VaultMintShareInput {
1906
- """The amount of vault shares"""
1907
- amount: BigDecimal!
1572
+ """The total fiat amount summed across all balances"""
1573
+ fiatAmount(currency: Currency! = USD): FiatAmount!
1908
1574
 
1909
- """Whether the amount should be received as aToken."""
1910
- asAToken: Boolean! = false
1575
+ """The supply APY dependent on what you pass in for the \`metric\`"""
1576
+ supplyApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1911
1577
 
1912
- """
1913
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
1914
- """
1915
- permitSig: ERC712Signature
1578
+ """The borrow APY dependent on what you pass in for the \`metric\`"""
1579
+ borrowApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1916
1580
  }
1917
1581
 
1918
- input VaultMintSharesRequest {
1919
- """The vault address"""
1920
- vault: EvmAddress!
1582
+ scalar UserBalanceId
1921
1583
 
1922
- """The amount of shares to mint"""
1923
- shares: VaultMintShareInput!
1924
-
1925
- """The user who is wanting to mint the shares"""
1926
- minter: EvmAddress!
1584
+ input UserBalancesByChains {
1585
+ """List of chains"""
1586
+ chainIds: [ChainId!]!
1927
1587
 
1928
1588
  """
1929
- The address to which vault shares will be minted to - defaults to minter.
1589
+ The type of reserve to use when determine the tokens to retrieve balances for
1930
1590
  """
1931
- sharesRecipient: EvmAddress
1932
-
1933
- """The chain id"""
1934
- chainId: ChainId!
1591
+ byReservesType: ReservesRequestFilter! = ALL
1935
1592
  }
1936
1593
 
1937
- input VaultOperationPreviewRequest {
1938
- """The vault"""
1939
- vault: EvmAddress!
1594
+ input UserBalancesByHub {
1595
+ """The hub address"""
1596
+ address: EvmAddress!
1940
1597
 
1941
- """The chain id the vault is deployed on"""
1598
+ """The hub chain id"""
1942
1599
  chainId: ChainId!
1943
1600
 
1944
1601
  """
1945
- The amount in human-readable form
1946
- preview deposit = underlying
1947
- preview mint = shares
1948
- preview withdraw = underlying
1949
- preview redeem = shares
1602
+ The type of reserve to use when determine the tokens to retrieve balances for
1950
1603
  """
1951
- amount: BigDecimal!
1604
+ byReservesType: ReservesRequestFilter! = ALL
1952
1605
  }
1953
1606
 
1954
- input VaultRecipientConfigurationRequest {
1955
- """The retrieve criteria"""
1956
- by: VaultRecipientConfigurationRequestBy!
1607
+ input UserBalancesBySpoke {
1608
+ """The spoke address"""
1609
+ address: EvmAddress!
1957
1610
 
1958
- """The chain id the recipient configuration is deployed on"""
1611
+ """The chain id the spoke is deployed to"""
1959
1612
  chainId: ChainId!
1960
- }
1961
-
1962
- input VaultRecipientConfigurationRequestBy @oneOf {
1963
- """The vault recipient configuration address"""
1964
- address: EvmAddress
1965
1613
 
1966
1614
  """
1967
- You can use this if you deployed a recipient configuration and want to get information
1615
+ The type of reserve to use when determine the tokens to retrieve balances for
1968
1616
  """
1969
- txHash: TxHash
1617
+ byReservesType: ReservesRequestFilter! = ALL
1970
1618
  }
1971
1619
 
1972
- input VaultRedeemShareInput {
1973
- """The amount of vault shares"""
1974
- amount: BigDecimal!
1975
-
1976
- """Whether the amount should be sent as aToken."""
1977
- asAToken: Boolean! = false
1620
+ input UserBalancesByUserPosition {
1621
+ """The user position id"""
1622
+ userPositionId: UserPositionId!
1978
1623
 
1979
1624
  """
1980
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
1625
+ The type of reserve to use when determine the tokens to retrieve balances for
1981
1626
  """
1982
- permitSig: ERC712Signature
1627
+ byReservesType: ReservesRequestFilter! = ALL
1983
1628
  }
1984
1629
 
1985
- input VaultRedeemSharesRequest {
1986
- """The vault address"""
1987
- vault: EvmAddress!
1630
+ input UserBalancesRequest {
1631
+ """The user to get the balance for"""
1632
+ user: EvmAddress!
1988
1633
 
1989
- """The shares to redeem."""
1990
- shares: VaultRedeemShareInput!
1634
+ """The order by clause - defaults to the highest USD value"""
1635
+ orderBy: UserBalancesRequestOrderBy! = {balance: DESC}
1991
1636
 
1992
- """
1993
- The address from which vault shares will be burned (normally your own wallet).
1994
- """
1995
- sharesOwner: EvmAddress!
1637
+ """The user balance filter"""
1638
+ filter: UserBalancesRequestFilter!
1996
1639
 
1997
- """
1998
- If you are doing the redeem from a trusted wallet which can move funds on behalf of the shares owner (advanced usage)
1999
- """
2000
- authorizedUser: EvmAddress
1640
+ """If you want to include 0 balances in the return list"""
1641
+ includeZeroBalances: Boolean! = false
1642
+ }
2001
1643
 
2002
- """
2003
- The address to which the underlying assets will be sent; if not set it will go to the sharesOwner
2004
- """
2005
- recipient: EvmAddress
1644
+ input UserBalancesRequestFilter @oneOf {
1645
+ """The balances for the tokens on the specified chains"""
1646
+ chains: UserBalancesByChains
2006
1647
 
2007
- """The chain id"""
2008
- chainId: ChainId!
2009
- }
1648
+ """The balances for the tokens of hub assets on a given hub"""
1649
+ hub: UserBalancesByHub
2010
1650
 
2011
- input VaultRequest {
2012
- """The retrieve criteria"""
2013
- by: VaultRequestBy!
1651
+ """The balances for the tokens of reserves attached to a spoke"""
1652
+ spoke: UserBalancesBySpoke
2014
1653
 
2015
- """The chain id the vault is deployed on"""
2016
- chainId: ChainId!
1654
+ """The balances for the swappable tokens"""
1655
+ swappable: SwappableTokensRequestQuery
2017
1656
 
2018
1657
  """
2019
- The user viewing it (can be connected wallet) - this caters for stuff like userShares and other user features
1658
+ The balances for the tokens of the spoke associated with the given user position
2020
1659
  """
2021
- user: EvmAddress
1660
+ userPosition: UserBalancesByUserPosition
2022
1661
  }
2023
1662
 
2024
- input VaultRequestBy @oneOf {
2025
- """The vault address"""
2026
- address: EvmAddress
1663
+ input UserBalancesRequestOrderBy @oneOf {
1664
+ """The name of the token"""
1665
+ name: OrderDirection
2027
1666
 
2028
- """
2029
- You can use this if you deployed a vault and want to get the vault information using the tx hash after the receipt is given
2030
- """
2031
- txHash: TxHash
1667
+ """The balance of the token"""
1668
+ balance: OrderDirection
2032
1669
  }
2033
1670
 
2034
- input VaultSetFeeRequest {
2035
- """The vault deployed address"""
2036
- vault: EvmAddress!
1671
+ type UserBorrowItem {
1672
+ """The user borrow item id"""
1673
+ id: UserBorrowItemId!
2037
1674
 
2038
- """The new fee to set, expressed in %."""
2039
- newFee: BigDecimal!
1675
+ """The reserve borrowed from"""
1676
+ reserve: Reserve!
2040
1677
 
2041
- """The chain id"""
2042
- chainId: ChainId!
2043
- }
1678
+ """The amount borrowed on this reserve"""
1679
+ principal: Erc20Amount!
2044
1680
 
2045
- input VaultSetRecipientsConfigurationRequest {
2046
- """The vault deployed address"""
2047
- vault: EvmAddress!
1681
+ """The overall debt including accrued interests"""
1682
+ debt: Erc20Amount!
2048
1683
 
2049
- """The chain id"""
2050
- chainId: ChainId!
1684
+ """The interest incurred on the loan"""
1685
+ interest: Erc20Amount!
2051
1686
 
2052
- """The recipients configuration contract address to set for the vault."""
2053
- configuration: EvmAddress!
1687
+ """
1688
+ When the borrow was created.
1689
+ This is null if they have no supply item, for
1690
+ example, when using include_zero_balances this comes
1691
+ back as principal and debt as 0
1692
+ """
1693
+ createdAt: DateTime
2054
1694
  }
2055
1695
 
2056
- input VaultTransferOwnershipRequest {
2057
- """The vault deployed address"""
2058
- vault: EvmAddress!
1696
+ scalar UserBorrowItemId
2059
1697
 
2060
- """The chain id"""
2061
- chainId: ChainId!
2062
-
2063
- """The new vault owner address"""
2064
- newOwner: EvmAddress!
1698
+ input UserBorrowsQueryRequest @oneOf {
1699
+ userSpoke: UserSpokeInput
1700
+ userToken: UserToken
1701
+ userPositionId: UserPositionId
1702
+ userChains: UserChains
2065
1703
  }
2066
1704
 
2067
- type VaultUserActivityItem {
2068
- balance: TokenAmount!
2069
- earned: TokenAmount!
2070
- withdrew: TokenAmount
2071
- deposited: TokenAmount
2072
- date: DateTime!
2073
- }
1705
+ input UserBorrowsRequest {
1706
+ query: UserBorrowsQueryRequest!
1707
+ orderBy: UserBorrowsRequestOrderBy! = {amount: DESC}
2074
1708
 
2075
- input VaultUserActivityRequest {
2076
- """The vault"""
2077
- vault: EvmAddress!
1709
+ """If you wish to include zero balances in the results"""
1710
+ includeZeroBalances: Boolean! = false
1711
+ }
2078
1712
 
2079
- """The chain id the vault is deployed on"""
2080
- chainId: ChainId!
1713
+ input UserBorrowsRequestOrderBy @oneOf {
1714
+ assetName: OrderDirection
1715
+ created: OrderDirection
1716
+ amount: OrderDirection
1717
+ apy: OrderDirection
1718
+ }
2081
1719
 
2082
- """The user address"""
1720
+ input UserChains {
2083
1721
  user: EvmAddress!
2084
-
2085
- """The timing window for which to calculate user activity"""
2086
- window: VaultUserActivityTimeWindow!
1722
+ chainIds: [ChainId!]!
2087
1723
  }
2088
1724
 
2089
- type VaultUserActivityResult {
2090
- earned: TokenAmount!
2091
- breakdown: [VaultUserActivityItem!]!
2092
- }
1725
+ type UserPosition {
1726
+ """The user position ID"""
1727
+ id: UserPositionId!
2093
1728
 
2094
- enum VaultUserActivityTimeWindow {
2095
- """Samples data in days over the last week"""
2096
- LAST_WEEK
1729
+ """The user holding this position"""
1730
+ user: EvmAddress!
1731
+ createdAt: DateTime!
1732
+ totalSupplied(currency: Currency! = USD): FiatAmountWithChange!
2097
1733
 
2098
- """Samples data in days over the last month"""
2099
- LAST_MONTH
1734
+ """
1735
+ Total collateral which is the full some of the assets supplied which are enabled as collateral
1736
+ """
1737
+ totalCollateral(currency: Currency! = USD): FiatAmountWithChange!
2100
1738
 
2101
- """Samples data in months over the last year"""
2102
- LAST_YEAR
1739
+ """Total debt which is the total amount borrowed plus the accrued premium"""
1740
+ totalDebt(currency: Currency! = USD): FiatAmountWithChange!
2103
1741
 
2104
- """Samples data in years for the maximum available period"""
2105
- MAX
2106
- }
1742
+ """The net balance which is \`total_supplied\` - \`borrows\`"""
1743
+ netBalance(currency: Currency! = USD): FiatAmountWithChange!
2107
1744
 
2108
- """A transaction where the user supplied assets to a reserve."""
2109
- type VaultUserDepositItem {
2110
- asset: TokenAmount!
2111
- shares: TokenAmount!
2112
- blockExplorerUrl: String!
2113
- txHash: TxHash!
2114
- timestamp: DateTime!
1745
+ """The net collateral which is \`totalCollateral\` - \`totalDebt\`"""
1746
+ netCollateral(currency: Currency! = USD): FiatAmountWithChange!
1747
+ netApy: PercentNumber!
1748
+ netSupplyApy: PercentNumberWithChange!
1749
+ netBorrowApy: PercentNumberWithChange!
1750
+ healthFactor: HealthFactorWithChange!
1751
+ betterRiskPremium: PercentNumber
1752
+ riskPremium: PercentNumber!
1753
+ netBalancePercentChange(window: TimeWindow! = LAST_DAY): PercentNumber!
1754
+ spoke: Spoke!
1755
+ averageCollateralFactor: PercentNumber!
2115
1756
  }
2116
1757
 
2117
- enum VaultUserHistoryAction {
2118
- DEPOSIT
2119
- WITHDRAW
2120
- }
1758
+ scalar UserPositionId
2121
1759
 
2122
- input VaultUserTransactionHistoryOrderBy @oneOf {
2123
- """Order by shares"""
2124
- date: OrderDirection
1760
+ input UserPositionRequest @oneOf {
1761
+ userSpoke: UserSpokeInput
1762
+ id: UserPositionId
2125
1763
  }
2126
1764
 
2127
- input VaultUserTransactionHistoryRequest {
2128
- """The vault address"""
2129
- vault: EvmAddress!
2130
-
2131
- """The chain id where the transactions were sent"""
2132
- chainId: ChainId!
2133
-
2134
- """The user that sent the transactions"""
1765
+ input UserPositionsRequest {
1766
+ """The user to get the positions for"""
2135
1767
  user: EvmAddress!
2136
1768
 
2137
- """The filter to optionally filter the transactions by action type"""
2138
- filter: [VaultUserHistoryAction!]! = [DEPOSIT, WITHDRAW]
1769
+ """The filter for the user position"""
1770
+ filter: UserPositionsRequestFilter!
2139
1771
 
2140
- """Ordering criteria"""
2141
- orderBy: VaultUserTransactionHistoryOrderBy! = {date: ASC}
2142
-
2143
- """The page size"""
2144
- pageSize: PageSize! = FIFTY
1772
+ """The ordering for the positions"""
1773
+ orderBy: UserPositionsRequestOrderBy! = {created: ASC}
1774
+ }
2145
1775
 
2146
- """Pagination cursor"""
2147
- cursor: Cursor
1776
+ input UserPositionsRequestFilter @oneOf {
1777
+ tokens: [Erc20Input!]
1778
+ chainIds: [ChainId!]
2148
1779
  }
2149
1780
 
2150
- union VaultUserTransactionItem = VaultUserDepositItem | VaultUserWithdrawItem
1781
+ input UserPositionsRequestOrderBy @oneOf {
1782
+ created: OrderDirection
1783
+ balance: OrderDirection
1784
+ netApy: OrderDirection
1785
+ healthFactor: OrderDirection
1786
+ netCollateral: OrderDirection
1787
+ }
2151
1788
 
2152
- """A transaction where the user withdrew assets from a reserve."""
2153
- type VaultUserWithdrawItem {
2154
- asset: TokenAmount!
2155
- shares: TokenAmount!
2156
- blockExplorerUrl: String!
2157
- txHash: TxHash!
2158
- timestamp: DateTime!
1789
+ input UserSpokeInput {
1790
+ spoke: SpokeId!
1791
+ user: EvmAddress!
2159
1792
  }
2160
1793
 
2161
- input VaultWithdrawAmountInput {
2162
- """The amount of assets to withdraw."""
2163
- value: BigDecimal!
1794
+ type UserSummary {
1795
+ totalPositions: Int!
2164
1796
 
2165
- """Whether the amount should be sent/received as aToken."""
2166
- asAToken: Boolean! = false
1797
+ """Net balance = supply - debt"""
1798
+ netBalance(currency: Currency! = USD): FiatAmountWithChange!
2167
1799
 
2168
- """
2169
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
2170
- """
2171
- permitSig: ERC712Signature
2172
- }
1800
+ """Total supply where is_collateral is true"""
1801
+ totalCollateral(currency: Currency! = USD): FiatAmount!
1802
+
1803
+ """Total supplied across all positions"""
1804
+ totalSupplied(currency: Currency! = USD): FiatAmount!
2173
1805
 
2174
- input VaultWithdrawFeesRequest {
2175
- """The vault deployed address"""
2176
- vault: EvmAddress!
1806
+ """Total debt across all positions"""
1807
+ totalDebt(currency: Currency! = USD): FiatAmount!
2177
1808
 
2178
1809
  """
2179
- Who the withdrawal fees will go to - if not supplied, it goes to the owner
1810
+ Net APY = (\u03A3 (supplied_amount_i * supply_apy_i) - \u03A3 (borrowed_amount_j * borrow_apy_j)) / (\u03A3 supplied_amount_i)
2180
1811
  """
2181
- sendTo: EvmAddress
1812
+ netApy: PercentNumber!
2182
1813
 
2183
- """Human-formatted amount"""
2184
- amount: WithdrawAmount!
1814
+ """Interest earned (net fee earned)"""
1815
+ netFeeEarned: FiatAmount!
2185
1816
 
2186
- """The chain id"""
2187
- chainId: ChainId!
1817
+ """Lowest health factor across all positions"""
1818
+ lowestHealthFactor: BigDecimal
2188
1819
  }
2189
1820
 
2190
- input VaultWithdrawRequest {
2191
- """The vault address"""
2192
- vault: EvmAddress!
1821
+ input UserSummaryFilter @oneOf {
1822
+ spoke: SpokeInput
1823
+ spokeId: SpokeId
1824
+ chainIds: [ChainId!]
1825
+ userPositionId: UserPositionId
1826
+ }
2193
1827
 
2194
- """The details of the amounts to withdraw."""
2195
- amount: VaultWithdrawAmountInput!
1828
+ type UserSummaryHistoryItem {
1829
+ healthFactor: BigDecimal
1830
+ date: DateTime!
2196
1831
 
2197
- """
2198
- The address from which vault shares will be burned (normally your own wallet).
2199
- """
2200
- sharesOwner: EvmAddress!
1832
+ """The aggregated net balance for the time period"""
1833
+ netBalance(currency: Currency! = USD): FiatAmount!
2201
1834
 
2202
- """
2203
- If you are doing the withdrawal from a trusted wallet which can move funds on behalf of the shares owner (advanced usage)
2204
- """
2205
- authorizedUser: EvmAddress
1835
+ """The aggregated borrows for the time period"""
1836
+ borrows(currency: Currency! = USD): FiatAmount!
2206
1837
 
2207
- """
2208
- The address to which the underlying assets will be sent - defaults to sharesOwner.
2209
- """
2210
- recipient: EvmAddress
1838
+ """The aggregated supplies for the time period"""
1839
+ supplies(currency: Currency! = USD): FiatAmount!
1840
+ }
2211
1841
 
2212
- """The chain id"""
2213
- chainId: ChainId!
1842
+ input UserSummaryHistoryRequest {
1843
+ user: EvmAddress!
1844
+ filter: UserSummaryFilter
1845
+ window: TimeWindow! = LAST_DAY
2214
1846
  }
2215
1847
 
2216
- input VaultsRequest {
2217
- """Filter criteria for vaults"""
2218
- criteria: VaultsRequestFilterCriteria!
1848
+ input UserSummaryRequest {
1849
+ user: EvmAddress!
1850
+ filter: UserSummaryFilter
1851
+ }
2219
1852
 
2220
- """
2221
- The user viewing it (can be connected wallet) - this caters for stuff like userShares and other user features
2222
- """
2223
- user: EvmAddress
1853
+ input UserSuppliesQueryRequest @oneOf {
1854
+ userSpoke: UserSpokeInput
1855
+ userToken: UserToken
1856
+ userPositionId: UserPositionId
1857
+ userChains: UserChains
1858
+ }
2224
1859
 
2225
- """The page size"""
2226
- pageSize: PageSize! = FIFTY
1860
+ input UserSuppliesRequest {
1861
+ query: UserSuppliesQueryRequest!
1862
+ orderBy: UserSuppliesRequestOrderBy! = {amount: DESC}
2227
1863
 
2228
- """Pagination cursor"""
2229
- cursor: Cursor
1864
+ """If you wish to include zero balances in the results"""
1865
+ includeZeroBalances: Boolean! = false
2230
1866
  }
2231
1867
 
2232
- input VaultsRequestFilterCriteria @oneOf {
2233
- """Filter by specific vault addresses"""
2234
- vaults: [VaultInput!]
2235
-
2236
- """Filter by owner addresses"""
2237
- ownedBy: [EvmAddress!]
1868
+ input UserSuppliesRequestOrderBy @oneOf {
1869
+ assetName: OrderDirection
1870
+ created: OrderDirection
1871
+ amount: OrderDirection
1872
+ apy: OrderDirection
2238
1873
  }
2239
1874
 
2240
- input WithdrawAmount @oneOf {
2241
- """Exact amount to withdraw, remember interest is generated on each block"""
2242
- exact: BigDecimal
1875
+ type UserSupplyItem {
1876
+ """The user supply item id"""
1877
+ id: UserSupplyItemId!
2243
1878
 
2244
- """Withdraw all the position completely"""
2245
- max: AlwaysTrue
2246
- }
1879
+ """The reserve supplied to"""
1880
+ reserve: Reserve!
2247
1881
 
2248
- input WithdrawAmountInput @oneOf {
2249
- """The native amount"""
2250
- native: WithdrawNativeAmountInput
1882
+ """The amount supplied to this reserve"""
1883
+ principal: Erc20Amount!
2251
1884
 
2252
- """The erc20 amount input"""
2253
- erc20: WithdrawErc20AmountInput
2254
- }
1885
+ """The overall amount you can withdraw, including accrued interests"""
1886
+ withdrawable: Erc20Amount!
2255
1887
 
2256
- input WithdrawErc20AmountInput {
2257
- """The token address."""
2258
- currency: EvmAddress!
1888
+ """The interest amount earned on supplying"""
1889
+ interest: Erc20Amount!
1890
+
1891
+ """If this supply is used as collateral"""
1892
+ isCollateral: Boolean!
2259
1893
 
2260
1894
  """
2261
- Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction (e.g., wei).
1895
+ When the supply was created.
1896
+ This is null if they have no supply item, for
1897
+ example, when using include_zero_balances this comes
1898
+ back as principal and withdrawable as 0
2262
1899
  """
2263
- value: WithdrawAmount!
1900
+ createdAt: DateTime
2264
1901
  }
2265
1902
 
2266
- input WithdrawNativeAmountInput {
2267
- """The native value"""
2268
- value: WithdrawAmount!
1903
+ scalar UserSupplyItemId
2269
1904
 
2270
- """
2271
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
2272
- """
2273
- permitSig: ERC712Signature
1905
+ input UserSwapsRequest {
1906
+ chainId: ChainId!
1907
+ user: EvmAddress!
1908
+ filterBy: [SwapStatusFilter!]
1909
+ pageSize: PageSize! = FIFTY
1910
+ cursor: Cursor
1911
+ }
1912
+
1913
+ input UserToken {
1914
+ user: EvmAddress!
1915
+ token: Erc20Input!
1916
+ }
1917
+
1918
+ type UsingAsCollateralActivity {
1919
+ id: ID!
1920
+ user: EvmAddress!
1921
+ timestamp: DateTime!
1922
+ txHash: TxHash!
1923
+ spoke: Spoke!
1924
+ reserve: ReserveInfo!
1925
+ enabledAsCollateral: Boolean!
1926
+ chain: Chain!
1927
+ }
1928
+
1929
+ type WithdrawActivity {
1930
+ id: ID!
1931
+ user: EvmAddress!
1932
+ timestamp: DateTime!
1933
+ txHash: TxHash!
1934
+ spoke: Spoke!
1935
+ reserve: ReserveInfo!
1936
+ withdrawn: Erc20Amount!
1937
+ chain: Chain!
2274
1938
  }
2275
1939
 
2276
1940
  input WithdrawRequest {
2277
- """The market pool address"""
2278
- market: EvmAddress!
1941
+ """The reserve id"""
1942
+ reserve: ReserveId!
2279
1943
 
2280
- """The amount to withdraw"""
2281
- amount: WithdrawAmountInput!
1944
+ """The amount withdrawing"""
1945
+ amount: WithdrawReserveAmountInput!
2282
1946
 
2283
- """
2284
- The user sending the transaction (normally the user's wallet address) this should have the \`aToken\` that will be burned by the \`Pool\`
2285
- """
1947
+ """The user sending the transaction (normally the user's wallet address)"""
2286
1948
  sender: EvmAddress!
1949
+ }
2287
1950
 
2288
- """
2289
- If not supplied, this will use \`sender\`. The address that will receive the underlying asset. This will go to the supplier if the user wants to receive the tokens into
2290
- their own wallet or use a different address if the beneficiary is a different wallet
2291
- """
2292
- recipient: EvmAddress
1951
+ input WithdrawReserveAmountInput @oneOf {
1952
+ """The native amount"""
1953
+ native: AmountInput
2293
1954
 
2294
- """The chain id"""
2295
- chainId: ChainId!
1955
+ """The erc20 amount input"""
1956
+ erc20: AmountInput
2296
1957
  }`;var i=graphql.buildSchema(e);exports.schema=i;//# sourceMappingURL=test-utils.cjs.map
2297
1958
  //# sourceMappingURL=test-utils.cjs.map