@aave/graphql 0.7.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,336 +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!
532
+ input HubRequestQuery @oneOf {
533
+ hubInput: HubInput
534
+ hubId: HubId
535
+ }
568
536
 
537
+ type HubSummary {
569
538
  """
570
- 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
571
540
  """
572
- healthFactor: BigDecimal
541
+ totalBorrowed: FiatAmount!
573
542
 
574
- """Whether efficiency mode is enabled for the user"""
575
- 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!
576
547
 
577
548
  """
578
- 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
579
550
  """
580
- totalCollateralBase: BigDecimal!
551
+ totalSupplied: FiatAmount!
581
552
 
582
- """The total debt of the user in the base currency used by the price feed"""
583
- 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!
584
557
 
585
558
  """
586
- The borrowing power left of the user in the base currency used by the price feed
559
+ The utilization rate"
587
560
  """
588
- availableBorrowsBase: BigDecimal!
561
+ utilizationRate: BigDecimal!
562
+ }
589
563
 
590
- """The liquidation threshold of the user"""
591
- currentLiquidationThreshold: PercentValue!
564
+ input HubTokenInput {
565
+ chainId: ChainId!
566
+ hub: EvmAddress!
567
+ token: EvmAddress!
568
+ }
592
569
 
593
- """The loan to value of the user"""
594
- ltv: PercentValue!
570
+ input HubsRequest {
571
+ query: HubsRequestQuery!
572
+ orderBy: HubsRequestOrderBy! = {name: ASC}
573
+ }
595
574
 
596
- """One of the user collateral is in isolation mode"""
597
- isInIsolationMode: Boolean!
575
+ input HubsRequestOrderBy @oneOf {
576
+ name: OrderDirection
577
+ totalBorrowed: OrderDirection
578
+ totalSupplied: OrderDirection
598
579
  }
599
580
 
600
- input MarketsRequest {
601
- """The markets you want to see based on the chain ids"""
602
- chainIds: [ChainId!]!
581
+ input HubsRequestQuery @oneOf {
582
+ """Get back all the hubs which have one of the underlying tokens supplied"""
583
+ tokens: [Erc20Input!]
603
584
 
604
- """
605
- The user viewing it (can be connected wallet) - this caters for stuff like eMode and other
606
- user features
607
- """
608
- user: EvmAddress
585
+ """Get back all the hubs based on the chain ids passed in"""
586
+ chainIds: [ChainId!]
609
587
  }
610
588
 
611
- type MeritBorrowAndSupplyIncentiveCondition {
612
- """The APR incentive for meeting the conditions"""
613
- extraApr: PercentValue!
589
+ type InsufficientBalanceError {
590
+ """The amount required to do the original transaction"""
591
+ required: DecimalNumber!
592
+
593
+ """The amount available in the wallet"""
594
+ available: DecimalNumber!
595
+ }
614
596
 
615
- """The token that must be supplied as collateral"""
616
- supplyToken: Currency!
597
+ """A scalar that can represent any JSON value."""
598
+ scalar JSON
617
599
 
618
- """The token that must be borrowed"""
619
- borrowToken: Currency!
600
+ input LiquidatePositionDebtAmount @oneOf {
601
+ """Exact amount"""
602
+ exact: BigDecimal
620
603
 
621
- """Where you can go and claim the incentives"""
622
- claimLink: URL!
604
+ """The most you can liquidate"""
605
+ max: AlwaysTrue
623
606
  }
624
607
 
625
- type MeritBorrowIncentive {
626
- """Extra APR for borrowing this asset from AAVE Merit program"""
627
- borrowAprDiscount: PercentValue!
608
+ union LiquidatePositionExecutionPlan = TransactionRequest | Erc20ApprovalRequired | InsufficientBalanceError
628
609
 
629
- """Where you can go and claim the incentives"""
630
- claimLink: URL!
631
- }
610
+ input LiquidatePositionRequest {
611
+ """The collateral reserve id"""
612
+ collateral: ReserveId!
613
+
614
+ """The debt reserve id"""
615
+ debt: ReserveId!
632
616
 
633
- type MeritSupplyIncentive {
634
- """Extra APR for supplying this asset from AAVE Merit program"""
635
- extraSupplyApr: PercentValue!
617
+ """The amount to liquidate"""
618
+ amount: LiquidatePositionDebtAmount!
636
619
 
637
- """Where you can go and claim the incentives"""
638
- claimLink: URL!
620
+ """The person liquidating the position"""
621
+ liquidator: EvmAddress!
622
+
623
+ """The user to liquidate"""
624
+ user: EvmAddress!
625
+
626
+ """If you would like to receive shares over the asset"""
627
+ receiveShares: Boolean! = false
639
628
  }
640
629
 
641
- type MessageData {
642
- owner: EvmAddress!
643
- spender: EvmAddress!
644
- value: BigInt!
645
- nonce: BigInt!
646
- 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!
647
642
  }
648
643
 
649
- type NativeCurrency {
650
- """The token image"""
651
- imageUrl: String!
644
+ type Mutation {
645
+ """Top up a balance for a user or yourself on the fork"""
646
+ forkTopUp(request: ForkTopUpRequest!): ForkTopUpResponse!
647
+ }
652
648
 
653
- """The token name"""
654
- name: String!
649
+ type NativeAmount {
650
+ """The native token"""
651
+ token: NativeToken!
655
652
 
656
- """The token symbol"""
657
- symbol: String!
653
+ """The value"""
654
+ amount: DecimalNumber!
658
655
 
659
- """The token decimals"""
660
- decimals: Int!
656
+ """The fiat amount"""
657
+ fiatAmount(currency: Currency! = USD): FiatAmount!
661
658
 
662
- """The chain id"""
663
- chainId: ChainId!
659
+ """The fiat rate"""
660
+ fiatRate(currency: Currency! = USD): DecimalNumber!
661
+ }
664
662
 
665
- """The wrapped version of this token"""
666
- wrappedToken: EvmAddress!
663
+ type NativeToken {
664
+ info: TokenInfo!
665
+ chain: Chain!
667
666
  }
668
667
 
668
+ scalar OnChainHubAssetId
669
+
670
+ scalar OnChainReserveId
671
+
669
672
  enum OperationType {
670
- BORROW
671
- REPAY
672
- RESERVE_USED_AS_COLLATERAL_ENABLED
673
- RESERVE_USED_AS_COLLATERAL_DISABLED
674
- SUPPLY
675
- USER_EMODE_SET
676
- WITHDRAW
677
- VAULT_DEPLOYED
678
- VAULT_DEPOSIT
679
- VAULT_FEE_UPDATED
680
- VAULT_FEE_WITHDRAWN
681
- VAULT_WITHDRAW
682
- VAULT_TRANSFER
683
- REVENUE_SPLITTER_OWNER_DEPLOYED
684
- REVENUE_SPLITTER_OWNER_TRANSFER
685
- 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
686
681
  }
687
682
 
688
683
  enum OrderDirection {
@@ -695,6 +690,11 @@ enum PageSize {
695
690
  FIFTY
696
691
  }
697
692
 
693
+ type PaginatedActivitiesResult {
694
+ items: [ActivityItem!]!
695
+ pageInfo: PaginatedResultInfo!
696
+ }
697
+
698
698
  type PaginatedResultInfo {
699
699
  """The cursor to the previous page of results, if any."""
700
700
  prev: Cursor
@@ -703,234 +703,188 @@ type PaginatedResultInfo {
703
703
  next: Cursor
704
704
  }
705
705
 
706
- """Paginated result of user transaction history."""
707
- type PaginatedUserTransactionHistoryResult {
708
- """List of user transaction items."""
709
- items: [UserTransactionItem!]!
710
-
711
- """Pagination information."""
706
+ type PaginatedSpokePositionManagerResult {
707
+ items: [SpokePositionManger!]!
712
708
  pageInfo: PaginatedResultInfo!
713
709
  }
714
710
 
715
- type PaginatedVaultUserTransactionHistoryResult {
716
- items: [VaultUserTransactionItem!]!
711
+ type PaginatedSpokeUserPositionManagerResult {
712
+ items: [SpokeUserPositionManager!]!
717
713
  pageInfo: PaginatedResultInfo!
718
714
  }
719
715
 
720
- type PaginatedVaultsResult {
721
- items: [Vault!]!
716
+ type PaginatedUserSwapsResult {
717
+ items: [SwapStatus!]!
722
718
  pageInfo: PaginatedResultInfo!
723
719
  }
724
720
 
725
- type PercentValue {
726
- """The raw none normalized percentage (the value that lives onchain)"""
727
- raw: BigInt!
721
+ type PercentNumber {
722
+ """
723
+ The on-chain representation of the percentage, stored in basis points (bps).
724
+ """
725
+ onChainValue: BigInt!
728
726
 
729
- """The decimals representing the precision of the onchain raw value"""
727
+ """The number of decimals defining the precision of \`bps\`."""
730
728
  decimals: Int!
731
729
 
732
- """The normalized percentage (1.0 = 100%)"""
730
+ """The percentage value where 1.0 represents 100%."""
733
731
  value: BigDecimal!
734
732
 
735
- """
736
- The human-readable formatted value you can render on a UI straight away.
737
- For example, this will turn \`0.01232343\` to \`1.23\`, it will always round to \`2\` decimal points.
738
- """
739
- formatted: BigDecimal!
733
+ """The human-friendly percentage value formatted for display."""
734
+ normalized: BigDecimal!
740
735
  }
741
736
 
742
- input PermitRequest {
743
- """The spender (when doing this with aave this is the market address)"""
744
- spender: EvmAddress!
745
-
746
- """The token you want to do the permit with"""
747
- currency: EvmAddress!
748
-
749
- """
750
- The amount to permit - in human-readable form aka 0.001 eth is 0.001 eth here
751
- """
752
- amount: BigDecimal!
737
+ type PercentNumberVariation {
738
+ current: PercentNumber!
739
+ after: PercentNumber!
740
+ }
753
741
 
754
- """The chain id the pool is deployed on"""
755
- chainId: ChainId!
742
+ type PercentNumberWithChange {
743
+ current: PercentNumber!
744
+ change(window: TimeWindow! = LAST_DAY): PercentNumber!
745
+ }
756
746
 
757
- """The owner of the funds"""
747
+ type PermitMessageData {
758
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
759
758
  }
760
759
 
761
760
  type PermitTypedDataResponse {
762
761
  types: TypeDefinition!
763
762
  primaryType: String!
764
763
  domain: DomainData!
765
- message: MessageData!
764
+ message: PermitMessageData!
766
765
  }
767
766
 
768
- input PreviewAction @oneOf {
769
- supply: SupplyRequest
770
- borrow: BorrowRequest
771
- repay: RepayRequest
772
- withdraw: WithdrawRequest
773
- }
774
-
775
- type Query {
776
- """Get if the API is healthy"""
777
- health: Boolean!
778
-
779
- """Chains the protocol supports"""
780
- chains(filter: ChainsFilter! = ALL): [Chain!]!
781
-
782
- """
783
- Deposits assets (underlying tokens or its related aTokens) into the vault and mints a corresponding amount of vault shares to the receiver.
784
- """
785
- vaultDeposit(request: VaultDepositRequest!): ExecutionPlan!
786
-
787
- """
788
- Redeems shares (vault shares) for the underlying assets or a tokens, which are sent to the receiver. The shares are burned from the owner.
789
- """
790
- vaultRedeemShares(request: VaultRedeemSharesRequest!): TransactionRequest!
791
-
792
- """Get a vault"""
793
- vault(request: VaultRequest!): Vault
794
-
795
- """Get vaults"""
796
- vaults(request: VaultsRequest!): PaginatedVaultsResult!
797
-
798
- """User vaults they have shares in"""
799
- userVaults(request: UserVaultsRequest!): PaginatedVaultsResult!
800
-
801
- """Deploy a vault and earn fees from the yield"""
802
- vaultDeploy(request: VaultDeployRequest!): ExecutionPlan!
803
-
804
- """
805
- Update a vault's fee. You MUST be the owner of the vault to send this tx request.
806
- """
807
- vaultSetFee(request: VaultSetFeeRequest!): TransactionRequest!
808
-
809
- """
810
- Withdraws accumulated fees from the specified vault. You MUST be the owner of the vault to send this tx request.
811
- """
812
- vaultWithdrawFees(request: VaultWithdrawFeesRequest!): TransactionRequest!
813
-
814
- """User vault transaction history"""
815
- vaultUserTransactionHistory(request: VaultUserTransactionHistoryRequest!): PaginatedVaultUserTransactionHistoryResult!
816
-
817
- """
818
- Vault user activity for a given vault and user, within a specified time window.
819
- """
820
- vaultUserActivity(request: VaultUserActivityRequest!): VaultUserActivityResult!
821
-
822
- """
823
- 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.
824
- """
825
- vaultWithdraw(request: VaultWithdrawRequest!): TransactionRequest!
826
-
827
- """
828
- Mints an exact amount of shares (vault shares) to the receiver by depositing the calculated amount of underlying or aTokens assets.
829
- """
830
- vaultMintShares(request: VaultMintSharesRequest!): ExecutionPlan!
831
-
832
- """
833
- This will return you the amount of shares that would be minted to the receiver
834
- """
835
- vaultPreviewDeposit(request: VaultOperationPreviewRequest!): TokenAmount!
836
-
837
- """
838
- This will return you the amount of assets that would be deposited by the caller
839
- """
840
- vaultPreviewMint(request: VaultOperationPreviewRequest!): TokenAmount!
841
-
842
- """
843
- This will return you the number of shares burnt based on the amount of assets you want to withdraw
844
- """
845
- vaultPreviewWithdraw(request: VaultOperationPreviewRequest!): TokenAmount!
846
-
847
- """
848
- This will return you the amount of assets that would be withdrawn by the receiver.
849
- """
850
- vaultPreviewRedeem(request: VaultOperationPreviewRequest!): TokenAmount!
851
-
852
- """
853
- Update a vault owner. You MUST be the owner of the vault to send this tx request.
854
- """
855
- vaultTransferOwnership(request: VaultTransferOwnershipRequest!): TransactionRequest!
856
-
857
- """
858
- Deploy a new recipients configuration contract for fee distribution.
859
- You MUST be the owner of the vault to send this tx request.
860
- """
861
- vaultCreateRecipientsConfiguration(request: VaultCreateRecipientsConfigurationRequest!): TransactionRequest!
862
-
863
- """
864
- Set the recipients configuration for the vault. You MUST be the owner of the vault to send this tx request.
865
- """
866
- vaultSetRecipientsConfiguration(request: VaultSetRecipientsConfigurationRequest!): TransactionRequest!
867
-
868
- """Get a vault recipients configuration"""
869
- vaultRecipientConfiguration(request: VaultRecipientConfigurationRequest!): VaultFeesRecipientsConfiguration
870
-
871
- """Lists all the markets"""
872
- markets(request: MarketsRequest!): [Market!]!
873
-
874
- """Get a market"""
875
- market(request: MarketRequest!): Market
876
-
877
- """Create the transaction to borrow from a market"""
878
- borrow(request: BorrowRequest!): ExecutionPlan!
767
+ type PreContractActionRequired {
768
+ """The transaction requires a pre-contract action first"""
769
+ transaction: TransactionRequest!
879
770
 
880
- """Approve a credit borrow delegator to be able to borrow on your behalf"""
881
- approveBorrowCreditDelegation(request: ApproveBorrowCreditDelegatorRequest!): TransactionRequest!
771
+ """The reason for the pre-contract action"""
772
+ reason: String!
882
773
 
883
- """
884
- Gets the amount delegated to the credit delegatee that can borrow on your behalf
885
- """
886
- creditDelegateeAllowance(request: CreditDelegateeAmountRequest!): TokenAmount!
774
+ """The transaction to send after the approval is complete"""
775
+ originalTransaction: TransactionRequest!
776
+ }
887
777
 
888
- """Create the transaction to supply to a market"""
889
- supply(request: SupplyRequest!): ExecutionPlan!
778
+ input PrepareLimitOrderSwapInput {
779
+ quoteId: SwapQuoteId!
780
+ newSellAmount: BigDecimal
781
+ newBuyAmount: BigDecimal
890
782
 
891
- """Create the transaction to repay to a market"""
892
- repay(request: RepayRequest!): ExecutionPlan!
783
+ """Slippage in basis points"""
784
+ newSlippage: BigDecimal
785
+ newReceiver: EvmAddress
786
+ }
893
787
 
894
- """Create the transaction to withdraw from a market"""
895
- 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
+ }
896
797
 
897
- """Create the transaction to toggle eMode for a market"""
898
- userSetEmode(request: UserSetEmodeRequest!): TransactionRequest!
798
+ input PrepareSwapCancelRequest {
799
+ id: SwapId!
800
+ }
899
801
 
900
- """Enable/disable a specific supplied asset as collateral"""
901
- collateralToggle(request: CollateralToggleRequest!): TransactionRequest!
802
+ type PrepareSwapCancelResult {
803
+ data: CancelSwapTypedData!
804
+ }
902
805
 
903
- """
904
- liquidate a non-healthy position collateral-wise, with Health Factor below 1
905
- """
906
- liquidate(request: LiquidateRequest!): TransactionRequest!
806
+ input PrepareSwapRequest @oneOf {
807
+ market: PrepareMarketOrderSwapInput
808
+ limit: PrepareLimitOrderSwapInput
809
+ }
907
810
 
908
- """Returns the user account market data across all the reserves."""
909
- userMarketState(request: UserMarketStateRequest!): MarketUserState!
811
+ union PrepareSwapResult = SwapByIntent | SwapByIntentWithApprovalRequired | SwapByTransaction | InsufficientBalanceError
910
812
 
911
- """The usd exchange rates for different tokens on a given market"""
912
- usdExchangeRates(request: UsdExchangeRatesRequest!): [UsdExchangeRate!]!
813
+ input PreviewAction @oneOf {
814
+ supply: SupplyRequest
815
+ borrow: BorrowRequest
816
+ repay: RepayRequest
817
+ withdraw: WithdrawRequest
818
+ setUserSupplyAsCollateral: SetUserSupplyAsCollateralRequest
819
+ }
913
820
 
914
- """Get all the user borrows positions"""
915
- userBorrows(request: UserBorrowsRequest!): [MarketUserReserveBorrowPosition!]!
821
+ input PreviewRequest {
822
+ action: PreviewAction!
823
+ }
916
824
 
917
- """Get all the user supplies positions"""
918
- userSupplies(request: UserSuppliesRequest!): [MarketUserReserveSupplyPosition!]!
825
+ type PreviewUserPosition {
826
+ id: UserPositionId!
827
+ healthFactor: HealthFactorResult!
828
+ riskPremium: PercentNumberVariation!
919
829
 
920
- """Get the borrow APY history"""
921
- 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
+ }
922
835
 
923
- """Get the supply APY history"""
924
- supplyAPYHistory(request: SupplyAPYHistoryRequest!): [APYSample!]!
836
+ type Query {
837
+ health: Boolean!
838
+ chain(request: ChainRequest!): Chain
839
+ chains(filter: ChainsFilter!): [Chain!]!
925
840
 
926
841
  """Generate EIP-712 typed data for EIP-2612 permit signature"""
927
842
  permitTypedData(request: PermitRequest!): PermitTypedDataResponse!
928
843
 
929
- """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!]!
930
855
  reserve(request: ReserveRequest!): Reserve
931
-
932
- """The user's market transaction history"""
933
- 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!]!
934
888
 
935
889
  """
936
890
  This lets you know the API has processed the known transaction hash, as the API uses caching to make things as fast
@@ -940,1352 +894,1065 @@ type Query {
940
894
  cater for the race condition.
941
895
  """
942
896
  hasProcessedKnownTransaction(request: HasProcessedKnownTransactionRequest!): Boolean!
943
- healthFactorPreview(request: HealthFactorPreviewRequest!): HealthFactorPreviewResponse!
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
+ }
944
907
 
945
- """Top up a balance for a user or yourself on the fork"""
946
- forkTopUp(request: ForkTopUpRequest!): ForkTopUpResponse!
908
+ input RenounceSpokeUserPositionManagerRequest {
909
+ """The spoke id"""
910
+ spoke: SpokeId!
947
911
 
948
- """
949
- The user merits reward information and transaction if you wish to claim
950
- """
951
- userMeritRewards(request: UserMeritRewardsRequest!): UserMeritRewards
952
-
953
- """
954
- Users saving GHO balance - note rewards are not paid out live onchain they paid out with the merit schema,
955
- this can be claimed using \`userMeritRewards\`
956
- """
957
- savingsGhoBalance(request: SavingsGhoBalanceRequest!): TokenAmount!
912
+ """The address to remove as a position manager"""
913
+ manager: EvmAddress!
958
914
 
959
- """Deposit into savings GHO"""
960
- savingsGhoDeposit(request: SavingsGhoDepositRequest!): ExecutionPlan!
915
+ """The address to remove \`manager\` as position manager"""
916
+ managing: EvmAddress!
917
+ }
961
918
 
962
- """Withdraw sGHO (savings GHO) back to GHO"""
963
- 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!
964
928
  }
965
929
 
966
- input RepayAmountInput @oneOf {
930
+ input RepayAmountInputWithPermit @oneOf {
967
931
  """The native amount"""
968
- native: BigDecimal
932
+ native: AmountInput
969
933
 
970
934
  """The erc20 amount input"""
971
- erc20: RepayErc20AmountInput
935
+ erc20: RepayErc20AmountInputWithPermit
972
936
  }
973
937
 
974
- input RepayErc20Amount @oneOf {
938
+ input RepayErc20AmountInputWithPermit {
975
939
  """
976
- Exact amount to repay
977
- 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).
978
941
  """
979
- exact: BigDecimal
942
+ value: AmountInput!
980
943
 
981
- """Repay all the amount completely"""
982
- 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
983
948
  }
984
949
 
985
- input RepayErc20AmountInput {
986
- """The token address."""
987
- currency: EvmAddress!
950
+ input RepayPermitRequest {
951
+ """The reserve id"""
952
+ reserve: ReserveId!
988
953
 
989
- """The amount to repay"""
990
- value: RepayErc20Amount!
954
+ """The amount repaying"""
955
+ amount: AmountInput!
991
956
 
992
- """
993
- The signed ERC20 permit message to operate on the relevant token without the need for an ERC20 Approval transaction.
994
- """
995
- permitSig: ERC712Signature
957
+ """The user sending the transaction (normally the user's wallet address)"""
958
+ sender: EvmAddress!
996
959
  }
997
960
 
998
961
  input RepayRequest {
999
- """The market pool address"""
1000
- market: EvmAddress!
962
+ """The reserve id"""
963
+ reserve: ReserveId!
1001
964
 
1002
- """
1003
- 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
1004
- """
1005
- amount: RepayAmountInput!
965
+ """The amount repaying"""
966
+ amount: RepayAmountInputWithPermit!
1006
967
 
1007
968
  """The user sending the transaction (normally the user's wallet address)"""
1008
969
  sender: EvmAddress!
1009
-
1010
- """
1011
- 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
1012
- """
1013
- onBehalfOf: EvmAddress
1014
-
1015
- """The chain id"""
1016
- chainId: ChainId!
1017
970
  }
1018
971
 
1019
972
  type Reserve {
1020
- """The market information the reserve is under"""
1021
- market: MarketInfo!
1022
-
1023
- """The reserve underlying currency"""
1024
- underlyingToken: Currency!
1025
-
1026
- """The reserve a token"""
1027
- aToken: Currency!
1028
-
1029
- """The reserve v token"""
1030
- vToken: Currency!
1031
-
1032
- """
1033
- If the reserve accepts native currency, for example, if you're on a reserve with asset WETH, it can
1034
- also accept ETH
1035
- """
1036
- acceptsNative: NativeCurrency
1037
-
1038
- """The reserve size"""
1039
- size: TokenAmount!
1040
-
1041
- """The usd exchange rate for the underlying token"""
1042
- usdExchangeRate: BigDecimal!
1043
-
1044
- """The usd oracle address it is pulling that price from"""
1045
- usdOracleAddress: EvmAddress!
1046
-
1047
- """The supply info for the reserve"""
1048
- supplyInfo: ReserveSupplyInfo!
1049
-
1050
- """
1051
- The borrow info for the reserve - if its null the underlying token cannot be borrowed
1052
- """
1053
- borrowInfo: ReserveBorrowInfo
1054
-
1055
- """The reserve has been frozen all actions are stopped"""
1056
- isFrozen: Boolean!
1057
-
1058
- """The reserve is paused you can still withdraw and some other actions"""
1059
- isPaused: Boolean!
1060
-
1061
- """
1062
- If the reserve supports isolation mode this is defined and the configs are defined
1063
- """
1064
- isolationModeConfig: ReserveIsolationModeConfig
1065
-
1066
- """If the reserve can use flash loans on it"""
1067
- flashLoanEnabled: Boolean!
1068
-
1069
- """The interest rate strategy address"""
1070
- interestRateStrategyAddress: EvmAddress!
1071
-
1072
- """Does the underlying reserve support permit"""
1073
- permitSupported: Boolean!
1074
-
1075
- """
1076
- This exposes the extra incentives you can earn from third parties (Merit) or from
1077
- incentives set by governance through the RewardsController.
1078
- Note Aave Labs does not guarantee third party program and accepts no liability to those
1079
- """
1080
- incentives: [ReserveIncentive!]!
1081
-
1082
- """The emode information for the reserve"""
1083
- eModeInfo: [EmodeReserveInfo!]!
1084
-
1085
- """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!
1086
984
  userState: ReserveUserState
985
+ asset: HubAsset!
986
+ spoke: Spoke!
1087
987
  }
1088
988
 
1089
- type ReserveBorrowInfo {
1090
- """The annual percentage yield for borrowing this asset"""
1091
- apy: PercentValue!
1092
-
1093
- """The total amount borrowed from this reserve"""
1094
- total: TokenAmount!
1095
-
1096
- """The reserve factor percentage"""
1097
- reserveFactor: PercentValue!
989
+ input ReserveAmountInput @oneOf {
990
+ """The native amount"""
991
+ native: BigDecimal
1098
992
 
1099
- """The available liquidity"""
1100
- availableLiquidity: TokenAmount!
993
+ """The erc20 amount input"""
994
+ erc20: ReserveErc20AmountInput
995
+ }
1101
996
 
1102
- """The reserve utilization rate"""
1103
- utilizationRate: PercentValue!
997
+ input ReserveAmountInputWithPermit @oneOf {
998
+ """The native amount"""
999
+ native: BigDecimal
1104
1000
 
1105
- """
1106
- Variable rate slope 1 - the rate of interest increase when utilization rate is below optimal
1107
- This is the slope of the interest rate curve in the first segment (0% to optimal utilization)
1108
- """
1109
- variableRateSlope1: PercentValue!
1001
+ """The erc20 amount input"""
1002
+ erc20: ReserveErc20AmountInputWithPermit
1003
+ }
1110
1004
 
1005
+ input ReserveErc20AmountInput {
1111
1006
  """
1112
- Variable rate slope 2 - the rate of interest increase when utilization rate is above optimal
1113
- This is the slope of the interest rate curve in the second segment (optimal to 100% utilization)
1114
- 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).
1115
1008
  """
1116
- variableRateSlope2: PercentValue!
1009
+ value: BigDecimal!
1010
+ }
1117
1011
 
1012
+ input ReserveErc20AmountInputWithPermit {
1118
1013
  """
1119
- The optimal usage rate - the utilization rate at which the variable rate curve transitions
1120
- 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).
1121
1015
  """
1122
- optimalUsageRate: PercentValue!
1016
+ value: BigDecimal!
1123
1017
 
1124
1018
  """
1125
- 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.
1126
1020
  """
1127
- borrowingState: ReserveBorrowingState!
1128
-
1129
- """The borrow cap of the reserve"""
1130
- borrowCap: TokenAmount!
1131
-
1132
- """The borrow cap is now full"""
1133
- borrowCapReached: Boolean!
1134
- }
1135
-
1136
- enum ReserveBorrowingState {
1137
- """Borrowing is enabled"""
1138
- ENABLED
1139
-
1140
- """Borrowing is disabled"""
1141
- DISABLED
1142
-
1143
- """The user emode settings make this underlying not able to be borrowed"""
1144
- USER_EMODE_DISABLED_BORROW
1021
+ permitSig: ERC20PermitSignature
1145
1022
  }
1146
1023
 
1147
- union ReserveIncentive = MeritSupplyIncentive | MeritBorrowIncentive | MeritBorrowAndSupplyIncentiveCondition | AaveSupplyIncentive | AaveBorrowIncentive
1024
+ scalar ReserveId
1148
1025
 
1149
1026
  type ReserveInfo {
1150
- """The market information the reserve is under"""
1151
- market: MarketInfo!
1152
-
1153
- """The reserve underlying currency"""
1154
- underlyingToken: Currency!
1155
-
1156
- """The reserve a token"""
1157
- aToken: Currency!
1158
-
1159
- """The reserve v token"""
1160
- vToken: Currency!
1161
-
1162
- """The usd exchange rate for the underlying token"""
1163
- usdExchangeRate: BigDecimal!
1164
-
1165
- """Does the underlying reserve support permit"""
1166
- permitSupported: Boolean!
1167
-
1168
- """
1169
- This exposes the extra incentives you can earn from third parties (Merit) or from
1170
- incentives set by governance through the RewardsController.
1171
- Note Aave Labs does not guarantee third party program and accepts no liability to those
1172
- """
1173
- incentives: [ReserveIncentive!]!
1027
+ id: ReserveId!
1028
+ asset: HubAsset!
1174
1029
  }
1175
1030
 
1176
- type ReserveIsolationModeConfig {
1177
- """This means that it can be used to borrow"""
1178
- canBeCollateral: Boolean!
1179
- canBeBorrowed: Boolean!
1180
- debtCeiling: TokenAmount!
1181
-
1182
- """The decimals used for the debt ceiling"""
1183
- debtCeilingDecimals: Int!
1184
-
1185
- """Only the amount that is borrowed by the users in isolation"""
1186
- totalBorrows: TokenAmount!
1031
+ input ReserveInput {
1032
+ chainId: ChainId!
1033
+ spoke: EvmAddress!
1034
+ onChainId: OnChainReserveId!
1187
1035
  }
1188
1036
 
1189
1037
  input ReserveRequest {
1190
- """The pool address for the market"""
1191
- market: EvmAddress!
1192
-
1193
- """The underlying token for the reserve"""
1194
- underlyingToken: EvmAddress!
1195
-
1196
- """The chain id the pool is deployed on"""
1197
- chainId: ChainId!
1038
+ query: ReserveRequestQuery!
1198
1039
 
1199
1040
  """
1200
- The user viewing it (can be connected wallet) - this caters for stuff like eMode and other
1201
- user features
1041
+ The user who is doing the query (this injects user state into some of the return objects)
1202
1042
  """
1203
1043
  user: EvmAddress
1204
1044
  }
1205
1045
 
1206
- type ReserveSupplyInfo {
1207
- """The annual percentage yield for supplying this asset"""
1208
- apy: PercentValue!
1209
-
1210
- """The maximum loan-to-value ratio when used as collateral"""
1211
- maxLTV: PercentValue!
1212
-
1213
- """The liquidation threshold for this asset"""
1214
- liquidationThreshold: PercentValue!
1215
-
1216
- """The liquidation bonus applied when liquidated"""
1217
- liquidationBonus: PercentValue!
1218
-
1219
- """If the asset can be used for collateral"""
1220
- canBeCollateral: Boolean!
1221
-
1222
- """The supply cap"""
1223
- supplyCap: TokenAmount!
1224
-
1225
- """The supply cap is now full"""
1226
- supplyCapReached: Boolean!
1227
-
1228
- """The total amount supplied to this reserve"""
1229
- total: DecimalValue!
1046
+ input ReserveRequestQuery @oneOf {
1047
+ reserveId: ReserveId
1048
+ reserveInput: ReserveInput
1230
1049
  }
1231
1050
 
1232
- type ReserveUserState {
1233
- """The user's balance of this asset"""
1234
- balance: TokenAmount!
1235
-
1236
- """The amount the user can supply to this reserve"""
1237
- suppliable: TokenAmount!
1238
-
1239
- """The amount the user can borrow from this reserve"""
1240
- borrowable: TokenAmount!
1241
-
1242
- """The user emode info if enabled"""
1243
- emode: EmodeReserveInfo
1244
-
1245
- """
1246
- If the user is in a state to be able to supply taking into consideration their emode
1247
- """
1248
- canBeCollateral: Boolean!
1249
-
1250
- """If the user is in a state to be able to borrow from the reserve"""
1251
- canBeBorrowed: Boolean!
1252
-
1253
- """Is the user in isolation mode"""
1254
- isInIsolationMode: Boolean!
1051
+ type ReserveSettings {
1052
+ collateralFactor: PercentNumber!
1053
+ maxLiquidationBonus: PercentNumber!
1054
+ collateralRisk: PercentNumber!
1055
+ borrowable: Boolean!
1056
+ collateral: Boolean!
1057
+ suppliable: Boolean!
1255
1058
  }
1256
1059
 
1257
- input SavingsGhoBalanceRequest {
1258
- """The user to query the savings GHO balance"""
1259
- user: EvmAddress!
1260
-
1261
- """The chain id - savings GHO for now only works on Ethereum"""
1262
- chainId: ChainId
1060
+ type ReserveStatus {
1061
+ frozen: Boolean!
1062
+ paused: Boolean!
1063
+ active: Boolean!
1263
1064
  }
1264
1065
 
1265
- input SavingsGhoDepositRequest {
1266
- """The details of the amounts to deposit."""
1267
- amount: SayingsGhoDepositAmountInput!
1268
-
1269
- """The user who is depositing"""
1270
- depositor: EvmAddress!
1271
-
1272
- """
1273
- The address to which saving GHO shares will be minted to - defaults to \`depositor\`.
1274
- """
1275
- recipient: EvmAddress
1276
-
1277
- """The chain id - savings GHO for now only works on Ethereum"""
1278
- chainId: ChainId
1066
+ type ReserveSummary {
1067
+ supplied: Erc20Amount!
1068
+ borrowed: Erc20Amount!
1069
+ supplyApy: PercentNumber!
1070
+ borrowApy: PercentNumber!
1279
1071
  }
1280
1072
 
1281
- input SavingsGhoWithdrawAmount @oneOf {
1282
- """Exact amount to withdraw"""
1283
- exact: BigDecimal
1284
-
1285
- """Withdraw all"""
1286
- max: AlwaysTrue
1073
+ type ReserveUserState {
1074
+ balance: Erc20Amount!
1075
+ suppliable: Erc20Amount!
1076
+ borrowable: Erc20Amount!
1077
+ borrowApy: PercentNumber!
1287
1078
  }
1288
1079
 
1289
- input SavingsGhoWithdrawRequest {
1290
- """The amount of GHO to withdraw."""
1291
- amount: SavingsGhoWithdrawAmount!
1080
+ input ReservesRequest {
1081
+ """The reserve's request query"""
1082
+ query: ReservesRequestQuery!
1292
1083
 
1293
1084
  """
1294
- 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)
1295
1086
  """
1296
- sharesOwner: EvmAddress!
1087
+ user: EvmAddress
1297
1088
 
1298
- """The address to which GHO will be minted to - defaults to \`depositor\`."""
1299
- recipient: EvmAddress
1089
+ """The reserve's filter"""
1090
+ filter: ReservesRequestFilter! = ALL
1300
1091
 
1301
- """The chain id - savings GHO for now only works on Ethereum"""
1302
- chainId: ChainId
1092
+ """The reserve's order by"""
1093
+ orderBy: ReservesRequestOrderBy! = {assetName: ASC}
1303
1094
  }
1304
1095
 
1305
- input SayingsGhoDepositAmountInput {
1306
- """The amount of GHO to deposit"""
1307
- value: BigDecimal!
1308
-
1309
- """
1310
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
1311
- """
1312
- permitSig: ERC712Signature
1096
+ enum ReservesRequestFilter {
1097
+ SUPPLY
1098
+ BORROW
1099
+ ALL
1313
1100
  }
1314
1101
 
1315
- scalar Signature
1316
-
1317
- input SupplyAPYHistoryRequest {
1318
- """The market pool address"""
1319
- market: EvmAddress!
1320
-
1321
- """The underlying token for the reserve"""
1322
- underlyingToken: EvmAddress!
1323
-
1324
- """The time windows for the history"""
1325
- window: TimeWindow!
1326
-
1327
- """The chain id"""
1328
- 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
1329
1110
  }
1330
1111
 
1331
- input SupplyRequest {
1332
- """The market pool address"""
1333
- market: EvmAddress!
1112
+ input ReservesRequestQuery @oneOf {
1113
+ """Get all the reserves for a spoke"""
1114
+ spoke: SpokeInput
1334
1115
 
1335
- """The amount supplying"""
1336
- amount: AmountInput!
1116
+ """Get all the reserves for a spoke"""
1117
+ spokeId: SpokeId
1337
1118
 
1338
- """The user sending the transaction (normally the users wallet address)"""
1339
- sender: EvmAddress!
1119
+ """Get all the reserves with underlying tokens"""
1120
+ tokens: [Erc20Input!]
1340
1121
 
1341
- """
1342
- 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.
1343
- 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
1344
- of aTokens is a different wallet
1345
- """
1346
- onBehalfOf: EvmAddress
1122
+ """Get all the reserves on a hub for an underlying"""
1123
+ hubToken: HubTokenInput
1347
1124
 
1348
- """The chain id"""
1349
- chainId: ChainId!
1350
- }
1125
+ """Get all the reserves on a list of chains"""
1126
+ chainIds: [ChainId!]
1351
1127
 
1352
- enum TimeWindow {
1353
- LAST_DAY
1354
- LAST_WEEK
1355
- LAST_MONTH
1356
- LAST_SIX_MONTHS
1357
- LAST_YEAR
1358
- }
1359
-
1360
- type TokenAmount {
1361
- usdPerToken: BigDecimal!
1128
+ """Get all the reserves for a spoke for an underlying"""
1129
+ spokeToken: SpokeTokenInput
1362
1130
 
1363
- """The amount"""
1364
- amount: DecimalValue!
1131
+ """Get all tokens on a hub"""
1132
+ hub: HubInput
1365
1133
 
1366
- """The usd full amount"""
1367
- usd: BigDecimal!
1134
+ """Get all the reserves on based on user position id"""
1135
+ userPositionId: UserPositionId
1368
1136
  }
1369
1137
 
1370
- """
1371
- Represents a transaction that must be executed, such as a direct supply, borrow, etc.
1372
- """
1373
- type TransactionRequest {
1374
- """Who the transaction is going to (normally a contract)"""
1375
- to: EvmAddress!
1138
+ input SetSpokeUserPositionManagerRequest {
1139
+ """The spoke id"""
1140
+ spoke: SpokeId!
1376
1141
 
1377
- """Who is sending the transaction"""
1378
- from: EvmAddress!
1142
+ """The address to become the position manager"""
1143
+ manager: EvmAddress!
1379
1144
 
1380
- """The blockchain transaction encoded data"""
1381
- data: BlockchainData!
1145
+ """Approve or remove the manager"""
1146
+ approve: Boolean!
1382
1147
 
1383
- """The native token value"""
1384
- value: BigInt!
1385
-
1386
- """The chain id"""
1387
- chainId: ChainId!
1148
+ """The user to set the position \`manager\` for"""
1149
+ user: EvmAddress!
1388
1150
 
1389
- """
1390
- The primary well-known operation the transaction is - you use this to track hasProcessedKnownTransaction
1391
- If null the API does not track/require the outcome - once receipt is done, everything is ready to go
1392
- """
1393
- operation: OperationType
1151
+ """The signature"""
1152
+ signature: ERC20PermitSignature
1394
1153
  }
1395
1154
 
1396
- scalar TxHash
1155
+ input SetUserSupplyAsCollateralRequest {
1156
+ """The reserve id"""
1157
+ reserve: ReserveId!
1397
1158
 
1398
- type TypeDefinition {
1399
- EIP712Domain: [TypeField!]!
1400
- Permit: [TypeField!]!
1401
- }
1159
+ """The user sending the transaction (normally the user's wallet address)"""
1160
+ sender: EvmAddress!
1402
1161
 
1403
- type TypeField {
1404
- name: String!
1405
- type: String!
1162
+ """If you want to enable the collateral or disable"""
1163
+ enableCollateral: Boolean!
1406
1164
  }
1407
1165
 
1408
- scalar URL
1166
+ scalar Signature
1409
1167
 
1410
- type UsdExchangeRate {
1411
- currency: Currency!
1412
- rate: BigDecimal!
1413
- }
1168
+ type Spoke {
1169
+ """The id for the spoke"""
1170
+ id: SpokeId!
1414
1171
 
1415
- input UsdExchangeRatesRequest {
1416
- """The pool address for the market"""
1417
- market: EvmAddress!
1172
+ """The spoke name (offchain)"""
1173
+ name: String!
1418
1174
 
1419
- """The underlying tokens for the reserve"""
1420
- underlyingTokens: [EvmAddress!]!
1175
+ """The spoke address"""
1176
+ address: EvmAddress!
1421
1177
 
1422
- """The chain id"""
1423
- chainId: ChainId!
1178
+ """The spoke chain"""
1179
+ chain: Chain!
1424
1180
  }
1425
1181
 
1426
- """A transaction where the user borrowed assets from a reserve."""
1427
- type UserBorrowTransaction {
1428
- """Amount borrowed."""
1429
- amount: TokenAmount!
1430
-
1431
- """Reserve from which assets were borrowed."""
1432
- reserve: ReserveInfo!
1433
-
1434
- """URL to view the transaction on a block explorer."""
1435
- blockExplorerUrl: String!
1182
+ scalar SpokeId
1436
1183
 
1437
- """Transaction hash."""
1438
- txHash: TxHash!
1184
+ input SpokeInput {
1185
+ """The address of the spoke"""
1186
+ address: EvmAddress!
1439
1187
 
1440
- """Timestamp of the transaction."""
1441
- timestamp: DateTime!
1188
+ """The chain id the spoke is deployed to"""
1189
+ chainId: ChainId!
1442
1190
  }
1443
1191
 
1444
- input UserBorrowsRequest {
1445
- """The market addresses and chains ids to query"""
1446
- markets: [MarketInput!]!
1447
-
1448
- """The user address to get borrow positions for"""
1449
- user: EvmAddress!
1450
-
1451
- """How to order the results"""
1452
- orderBy: UserBorrowsRequestOrderBy! = {name: ASC}
1192
+ input SpokePositionManagersRequest {
1193
+ spoke: SpokeId!
1194
+ includeInactive: Boolean
1195
+ pageSize: PageSize!
1196
+ cursor: Cursor
1453
1197
  }
1454
1198
 
1455
- input UserBorrowsRequestOrderBy @oneOf {
1456
- """Order by the user's debt amount"""
1457
- debt: OrderDirection
1458
-
1459
- """Order by the asset name"""
1460
- name: OrderDirection
1461
-
1462
- """Order by the annual percentage yield"""
1463
- apy: OrderDirection
1199
+ type SpokePositionManger {
1200
+ name: String!
1201
+ address: EvmAddress!
1202
+ active: Boolean!
1464
1203
  }
1465
1204
 
1466
- """A transaction where the user was involved in a liquidation call."""
1467
- type UserLiquidationCallTransaction {
1468
- """Collateral liquidated."""
1469
- collateral: LiquidationCollateral!
1470
-
1471
- """Debt repaid."""
1472
- debtRepaid: LiquidationRepaidDebt!
1473
-
1474
- """URL to view the transaction on a block explorer."""
1475
- blockExplorerUrl: String!
1476
-
1477
- """Transaction hash."""
1478
- txHash: TxHash!
1479
-
1480
- """Timestamp of the transaction."""
1481
- timestamp: DateTime!
1205
+ input SpokeRequest {
1206
+ """The spoke request query"""
1207
+ query: SpokeRequestQuery!
1482
1208
  }
1483
1209
 
1484
- input UserMarketStateRequest {
1485
- """The pool address for the market"""
1486
- market: EvmAddress!
1487
-
1488
- """The user to toggle emode on"""
1489
- user: EvmAddress!
1490
-
1491
- """The chain id"""
1492
- chainId: ChainId!
1210
+ input SpokeRequestQuery @oneOf {
1211
+ spoke: SpokeInput
1212
+ spokeId: SpokeId
1493
1213
  }
1494
1214
 
1495
- type UserMeritRewards {
1496
- """The chain the transaction is on"""
1497
- chain: ChainId!
1498
-
1499
- """
1500
- The reward tokens being claimed in the transaction - this is aggregated
1501
- """
1502
- claimable: [ClaimableMeritReward!]!
1215
+ input SpokeTokenInput {
1216
+ """The spoke id"""
1217
+ spoke: SpokeId!
1503
1218
 
1504
- """The transaction to execute to claim the rewards"""
1505
- transaction: TransactionRequest!
1219
+ """The token"""
1220
+ token: EvmAddress!
1506
1221
  }
1507
1222
 
1508
- input UserMeritRewardsFilter {
1509
- """If you only care about certain tokens to claim and see details of"""
1510
- tokens: [EvmAddress!]
1223
+ type SpokeUserPositionManager {
1224
+ name: String!
1225
+ address: EvmAddress!
1226
+ approvedOn: DateTime!
1227
+ active: Boolean!
1511
1228
  }
1512
1229
 
1513
- input UserMeritRewardsRequest {
1514
- """The user to claim with"""
1230
+ input SpokeUserPositionManagersRequest {
1231
+ spoke: SpokeId!
1515
1232
  user: EvmAddress!
1516
-
1517
- """The chain id to claim on"""
1518
- chainId: ChainId!
1519
- filter: UserMeritRewardsFilter
1233
+ pageSize: PageSize!
1234
+ cursor: Cursor
1520
1235
  }
1521
1236
 
1522
- """A transaction where the user repaid borrowed assets."""
1523
- type UserRepayTransaction {
1524
- """Amount repaid."""
1525
- amount: TokenAmount!
1526
-
1527
- """Reserve to which assets were repaid."""
1528
- reserve: ReserveInfo!
1529
-
1530
- """URL to view the transaction on a block explorer."""
1531
- blockExplorerUrl: String!
1532
-
1533
- """Transaction hash."""
1534
- txHash: TxHash!
1535
-
1536
- """Timestamp of the transaction."""
1537
- timestamp: DateTime!
1237
+ input SpokesRequest {
1238
+ query: SpokesRequestQuery!
1538
1239
  }
1539
1240
 
1540
- input UserSetEmodeRequest {
1541
- """The pool address for the market"""
1542
- market: EvmAddress!
1543
-
1544
- """The user to toggle emode on"""
1545
- user: EvmAddress!
1546
-
1241
+ input SpokesRequestQuery @oneOf {
1547
1242
  """
1548
- 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
1549
1245
  """
1550
- categoryId: Int
1246
+ hubId: HubId
1551
1247
 
1552
- """The chain id"""
1553
- chainId: ChainId!
1554
- }
1555
-
1556
- input UserSuppliesRequest {
1557
- """The market addresses and chains ids to query"""
1558
- markets: [MarketInput!]!
1559
-
1560
- """The user address to get supply positions for"""
1561
- user: EvmAddress!
1562
-
1563
- """Only get back the supplies which can be used as collateral"""
1564
- collateralsOnly: Boolean! = false
1565
-
1566
- """How to order the results"""
1567
- orderBy: UserSuppliesRequestOrderBy! = {name: ASC}
1568
- }
1569
-
1570
- input UserSuppliesRequestOrderBy @oneOf {
1571
- """Order by the user's supply balance"""
1572
- balance: OrderDirection
1573
-
1574
- """Order by the asset name"""
1575
- name: OrderDirection
1576
-
1577
- """Order by the annual percentage yield"""
1578
- 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
1579
1253
 
1580
- """Order by whether the position is used as collateral"""
1581
- isCollateralized: OrderDirection
1254
+ """
1255
+ The chain ids
1256
+ Get all the spokes which are on the list of chain ids
1257
+ """
1258
+ chainIds: [ChainId!]
1582
1259
  }
1583
1260
 
1584
- """A transaction where the user supplied assets to a reserve."""
1585
- type UserSupplyTransaction {
1586
- """Amount supplied."""
1587
- amount: TokenAmount!
1588
-
1589
- """Reserve to which assets were supplied."""
1590
- reserve: ReserveInfo!
1591
-
1592
- """URL to view the transaction on a block explorer."""
1593
- blockExplorerUrl: String!
1594
-
1595
- """Transaction hash."""
1596
- txHash: TxHash!
1597
-
1598
- """Timestamp of the transaction."""
1599
- timestamp: DateTime!
1261
+ input SupplyAPYHistoryRequest {
1262
+ reserve: ReserveId!
1263
+ window: TimeWindow! = LAST_DAY
1600
1264
  }
1601
1265
 
1602
- input UserTransactionHistoryRequest {
1603
- """The market address"""
1604
- market: EvmAddress!
1605
-
1606
- """The filter to optionally filter the transactions by type"""
1607
- filter: [UserTransactionType!]! = [SUPPLY, WITHDRAW, BORROW, REPAY, USAGE_AS_COLLATERAL, LIQUIDATION_CALL]
1608
-
1609
- """The order by object to sort the transactions by"""
1610
- orderBy: UserTransactionHistoryRequestOrderBy! = {date: ASC}
1611
-
1612
- """The user that sent the transactions"""
1266
+ type SupplyActivity {
1267
+ id: ID!
1613
1268
  user: EvmAddress!
1614
-
1615
- """The chain id where the transactions were sent"""
1616
- chainId: ChainId!
1617
-
1618
- """The page size"""
1619
- pageSize: PageSize! = FIFTY
1620
-
1621
- """Pagination cursor"""
1622
- cursor: Cursor
1623
- }
1624
-
1625
- input UserTransactionHistoryRequestOrderBy {
1626
- """Order by the date of the transaction"""
1627
- date: OrderDirection
1269
+ timestamp: DateTime!
1270
+ txHash: TxHash!
1271
+ spoke: Spoke!
1272
+ reserve: ReserveInfo!
1273
+ supplied: Erc20Amount!
1274
+ chain: Chain!
1628
1275
  }
1629
1276
 
1630
- union UserTransactionItem = UserSupplyTransaction | UserWithdrawTransaction | UserBorrowTransaction | UserRepayTransaction | UserUsageAsCollateralTransaction | UserLiquidationCallTransaction
1277
+ input SupplyPermitRequest {
1278
+ """The reserve id"""
1279
+ reserve: ReserveId!
1631
1280
 
1632
- """The type of user transaction in the protocol."""
1633
- enum UserTransactionType {
1634
- """User supplied assets to the protocol."""
1635
- SUPPLY
1636
-
1637
- """User borrowed assets from the protocol."""
1638
- BORROW
1639
-
1640
- """User enabled or disabled usage of an asset as collateral."""
1641
- USAGE_AS_COLLATERAL
1642
-
1643
- """User was involved in a liquidation call."""
1644
- LIQUIDATION_CALL
1281
+ """The amount supplying"""
1282
+ amount: ReserveErc20AmountInput!
1645
1283
 
1646
- """User repaid a borrowed amount."""
1647
- REPAY
1284
+ """If you wish to enable collateral with it meaning you can borrow"""
1285
+ enableCollateral: Boolean! = true
1648
1286
 
1649
- """User withdrew supplied assets."""
1650
- WITHDRAW
1287
+ """The user sending the transaction (normally the user's wallet address)"""
1288
+ sender: EvmAddress!
1651
1289
  }
1652
1290
 
1653
- """
1654
- A transaction where the user enabled or disabled usage of an asset as collateral.
1655
- """
1656
- type UserUsageAsCollateralTransaction {
1657
- """Whether collateral usage was enabled."""
1658
- enabled: Boolean!
1659
-
1660
- """Reserve for which collateral usage was changed."""
1661
- reserve: ReserveInfo!
1662
-
1663
- """URL to view the transaction on a block explorer."""
1664
- blockExplorerUrl: String!
1665
-
1666
- """Transaction hash."""
1667
- txHash: TxHash!
1291
+ input SupplyRequest {
1292
+ """The reserve id"""
1293
+ reserve: ReserveId!
1668
1294
 
1669
- """Timestamp of the transaction."""
1670
- timestamp: DateTime!
1671
- }
1295
+ """The amount supplying"""
1296
+ amount: ReserveAmountInputWithPermit!
1672
1297
 
1673
- type UserVaultShares {
1674
- """The user's shares on the vault"""
1675
- shares: TokenAmount!
1298
+ """If you wish to enable collateral with it meaning you can borrow"""
1299
+ enableCollateral: Boolean! = true
1676
1300
 
1677
- """The balance you can withdraw"""
1678
- balance: TokenAmount!
1301
+ """The user sending the transaction (normally the user's wallet address)"""
1302
+ sender: EvmAddress!
1679
1303
  }
1680
1304
 
1681
- input UserVaultsFilter {
1682
- """Filter by markets"""
1683
- vaults: [VaultInput!]
1684
-
1685
- """Filter by underlying token addresses"""
1686
- underlyingTokens: [EvmAddress!]
1305
+ type SwapApprovalRequired {
1306
+ approval: TransactionRequest!
1307
+ originalTransaction: SwapTransactionRequest!
1687
1308
  }
1688
1309
 
1689
- input UserVaultsOrderBy @oneOf {
1690
- """Order by shares"""
1691
- shares: OrderDirection
1310
+ type SwapByIntent {
1311
+ quote: SwapQuote!
1312
+ data: SwapByIntentTypedData!
1313
+ }
1692
1314
 
1693
- """Order by fee"""
1694
- fee: OrderDirection
1315
+ input SwapByIntentInput {
1316
+ quoteId: SwapQuoteId!
1317
+ signature: Signature!
1695
1318
  }
1696
1319
 
1697
- input UserVaultsRequest {
1698
- """The user address"""
1699
- user: EvmAddress!
1320
+ type SwapByIntentTypeDefinition {
1321
+ EIP712Domain: [TypeField!]!
1322
+ Order: [TypeField!]!
1323
+ }
1700
1324
 
1701
- """Filter criteria"""
1702
- filters: UserVaultsFilter
1325
+ type SwapByIntentTypedData {
1326
+ types: SwapByIntentTypeDefinition!
1327
+ primaryType: String!
1328
+ domain: DomainData!
1329
+ message: JSON!
1330
+ }
1703
1331
 
1704
- """Ordering criteria"""
1705
- orderBy: UserVaultsOrderBy! = {shares: ASC}
1332
+ type SwapByIntentWithApprovalRequired {
1333
+ quote: SwapQuote!
1334
+ approval: TransactionRequest!
1335
+ data: SwapByIntentTypedData!
1336
+ }
1706
1337
 
1707
- """The page size"""
1708
- pageSize: PageSize! = FIFTY
1338
+ type SwapByTransaction {
1339
+ quote: SwapQuote!
1340
+ }
1709
1341
 
1710
- """Pagination cursor"""
1711
- cursor: Cursor
1342
+ type SwapCancelled {
1343
+ createdAt: DateTime!
1344
+ cancelledAt: DateTime
1345
+ explorerLink: String!
1712
1346
  }
1713
1347
 
1714
- """A transaction where the user withdrew assets from a reserve."""
1715
- type UserWithdrawTransaction {
1716
- """Amount withdrawn."""
1717
- amount: TokenAmount!
1348
+ union SwapExecutionPlan = SwapTransactionRequest | SwapApprovalRequired | InsufficientBalanceError | SwapReceipt
1718
1349
 
1719
- """Reserve from which assets were withdrawn."""
1720
- reserve: ReserveInfo!
1350
+ type SwapExpired {
1351
+ createdAt: DateTime!
1352
+ expiredAt: DateTime!
1353
+ explorerLink: String!
1354
+ }
1721
1355
 
1722
- """URL to view the transaction on a block explorer."""
1723
- 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
+ }
1724
1367
 
1725
- """Transaction hash."""
1726
- txHash: TxHash!
1368
+ scalar SwapId
1727
1369
 
1728
- """Timestamp of the transaction."""
1729
- timestamp: DateTime!
1370
+ enum SwapKind {
1371
+ BUY
1372
+ SELL
1730
1373
  }
1731
1374
 
1732
- type Vault {
1733
- """The vault address"""
1734
- address: EvmAddress!
1375
+ type SwapOpen {
1376
+ swapId: SwapId!
1377
+ createdAt: DateTime!
1378
+ deadline: DateTime!
1379
+ explorerLink: String!
1380
+ desiredSell: TokenAmount!
1381
+ desiredBuy: TokenAmount!
1382
+ }
1735
1383
 
1736
- """The name of the share"""
1737
- shareName: String!
1384
+ type SwapPendingSignature {
1385
+ createdAt: DateTime!
1386
+ deadline: DateTime!
1387
+ explorerLink: String!
1388
+ }
1738
1389
 
1739
- """The symbol of the share"""
1740
- shareSymbol: String!
1390
+ type SwapQuote {
1391
+ quoteId: SwapQuoteId!
1392
+ suggestedSlippage: PercentNumber!
1393
+ desiredSell: TokenAmount!
1394
+ desiredBuy: TokenAmount!
1395
+ costs: SwapQuoteCosts!
1741
1396
 
1742
- """The reserve the vault is using"""
1743
- usedReserve: Reserve!
1397
+ """Minimum received amount after all costs and slippage"""
1398
+ minimumReceived: TokenAmount!
1399
+ }
1744
1400
 
1745
- """The current fee percentage set for the vault."""
1746
- fee: PercentValue!
1401
+ type SwapQuoteCosts {
1402
+ """Network and provider costs"""
1403
+ networkCosts: TokenAmount!
1747
1404
 
1748
- """How much this vault has made in revenue"""
1749
- totalFeeRevenue: TokenAmount!
1405
+ """Aave partner fee amount"""
1406
+ partnerFee: TokenAmount!
1407
+ }
1750
1408
 
1751
- """
1752
- The last recorded balance of the vault's AToken. This value is updated when yield is accrued.
1753
- """
1754
- balance: TokenAmount!
1409
+ scalar SwapQuoteId
1755
1410
 
1756
- """The chain id the vault lives on"""
1411
+ input SwapQuoteRequest {
1757
1412
  chainId: ChainId!
1413
+ buy: TokenInput!
1414
+ sell: TokenInput!
1415
+ amount: BigDecimal!
1416
+ kind: SwapKind
1417
+ from: EvmAddress!
1418
+ receiver: EvmAddress
1419
+ }
1758
1420
 
1759
- """The user's shares info on the vault"""
1760
- userShares: UserVaultShares
1421
+ type SwapReceipt {
1422
+ id: SwapId!
1423
+ createdAt: DateTime!
1424
+ explorerLink: String!
1425
+ }
1761
1426
 
1762
- """The owner of the vault"""
1763
- owner: EvmAddress!
1427
+ input SwapRequest @oneOf {
1428
+ intent: SwapByIntentInput
1429
+ transaction: SwapWithTransactionInput
1430
+ }
1764
1431
 
1765
- """The total fees the owner can claim currently for the vault"""
1766
- feesBalance: TokenAmount!
1432
+ union SwapStatus = SwapOpen | SwapPendingSignature | SwapCancelled | SwapExpired | SwapFulfilled
1767
1433
 
1768
- """The total vault APR after their fee is taken off"""
1769
- vaultApr: PercentValue!
1434
+ enum SwapStatusFilter {
1435
+ CANCELLED
1436
+ EXPIRED
1437
+ FULFILLED
1438
+ OPEN
1439
+ PENDING_SIGNATURE
1440
+ }
1770
1441
 
1771
- """
1772
- The recipient configuration for distributing the vault fees.
1773
- Returns None if the vault doesn't have any recipients configured (in which case the owner is the sole fee recipient)
1774
- """
1775
- recipients: VaultFeesRecipientsConfiguration
1442
+ input SwapStatusRequest {
1443
+ id: SwapId!
1776
1444
  }
1777
1445
 
1778
- input VaultCreateRecipientsConfigurationRequest {
1779
- """The vault deployed address"""
1780
- vault: EvmAddress!
1446
+ type SwapTransactionRequest {
1447
+ transaction: TransactionRequest!
1448
+ orderReceipt: SwapReceipt!
1449
+ }
1781
1450
 
1782
- """The chain id"""
1783
- chainId: ChainId!
1451
+ input SwapWithTransactionInput {
1452
+ quoteId: SwapQuoteId!
1453
+ permitSig: Signature
1784
1454
 
1785
1455
  """
1786
- The recipients of the fee revenue, expressed as a percentage of the total fee revenue.
1787
- 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.
1788
1457
  """
1789
- recipients: [VaultFeesRecipientSplitInput!]!
1458
+ isSenderSmartContractWallet: Boolean
1790
1459
  }
1791
1460
 
1792
- input VaultDeployRequest {
1793
- """Underlying token address."""
1794
- underlyingToken: EvmAddress!
1461
+ input SwappableTokenInput @oneOf {
1462
+ native: ChainId
1463
+ erc20: Erc20Input
1464
+ }
1795
1465
 
1796
- """The market address."""
1797
- market: EvmAddress!
1466
+ input SwappableTokensRequest {
1467
+ query: SwappableTokensRequestQuery
1468
+ }
1798
1469
 
1799
- """The chain id"""
1800
- chainId: ChainId!
1470
+ input SwappableTokensRequestQuery @oneOf {
1471
+ chainIds: [ChainId!]
1472
+ from: SwappableTokenInput
1473
+ to: SwappableTokenInput
1474
+ }
1801
1475
 
1802
- """
1803
- The address to set as which deploys the vault and will become an owner of the vault.
1804
- """
1805
- deployer: EvmAddress!
1476
+ enum TimeWindow {
1477
+ LAST_DAY
1478
+ LAST_WEEK
1479
+ LAST_MONTH
1480
+ LAST_SIX_MONTHS
1481
+ LAST_YEAR
1482
+ ALL
1483
+ }
1806
1484
 
1807
- """The owner of the vault - if not defined, it will be the deployer"""
1808
- owner: EvmAddress
1485
+ union Token = NativeToken | Erc20Token
1809
1486
 
1810
- """The initial fee to set, expressed in %."""
1811
- initialFee: BigDecimal!
1487
+ union TokenAmount = NativeAmount | Erc20Amount
1812
1488
 
1813
- """The name to set for the vault's shares."""
1814
- shareName: String!
1489
+ type TokenInfo {
1490
+ """The token name"""
1491
+ name: String!
1815
1492
 
1816
- """The symbol to set for the vault's shares."""
1817
- shareSymbol: String!
1493
+ """The token symbol"""
1494
+ symbol: String!
1818
1495
 
1819
- """
1820
- The initial amount of underlying assets to deposit. This must be a non-zero, non-trivial amount, depending on the underlying asset's decimals.
1821
- """
1822
- initialLockDeposit: BigDecimal!
1496
+ """The token icon"""
1497
+ icon: String!
1823
1498
 
1824
- """
1825
- The recipients of the fee revenue, expressed as a percentage of the total fee revenue.
1826
- If not provided, the fee revenue will be sent to the owner of the vault.
1827
- Vault revenue is split between the recipients and the Aave fee recipient (50/50 split).
1828
- """
1829
- recipients: [VaultFeesRecipientSplitInput!]
1499
+ """The token decimals"""
1500
+ decimals: Int!
1830
1501
  }
1831
1502
 
1832
- input VaultDepositAmountInput {
1833
- """The amount of assets to deposit."""
1834
- value: BigDecimal!
1835
-
1836
- """Whether you are depositing in as a token or normal underlying"""
1837
- asAToken: Boolean! = false
1503
+ input TokenInput @oneOf {
1504
+ """Native token"""
1505
+ native: AlwaysTrue
1838
1506
 
1839
- """
1840
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
1841
- """
1842
- permitSig: ERC712Signature
1507
+ """The erc20 address"""
1508
+ erc20: EvmAddress
1843
1509
  }
1844
1510
 
1845
- input VaultDepositRequest {
1846
- """The vault address"""
1847
- vault: EvmAddress!
1511
+ type TransactionRequest {
1512
+ to: EvmAddress!
1513
+ from: EvmAddress!
1514
+ data: BlockchainData!
1515
+ value: BigInt!
1516
+ chainId: ChainId!
1517
+ operations: [OperationType!]
1518
+ }
1848
1519
 
1849
- """The details of the amounts to deposit."""
1850
- amount: VaultDepositAmountInput!
1520
+ scalar TxHash
1851
1521
 
1852
- """The user who is depositing"""
1853
- depositor: EvmAddress!
1522
+ input TxHashInput {
1523
+ txHash: TxHash!
1524
+ chainId: ChainId!
1525
+ }
1854
1526
 
1855
- """
1856
- The address to which vault shares will be minted to - defaults to depositor.
1857
- """
1858
- sharesRecipient: EvmAddress
1527
+ type TypeDefinition {
1528
+ EIP712Domain: [TypeField!]!
1529
+ Permit: [TypeField!]!
1530
+ }
1859
1531
 
1860
- """The chain id"""
1861
- chainId: ChainId!
1532
+ type TypeField {
1533
+ name: String!
1534
+ type: String!
1862
1535
  }
1863
1536
 
1864
- type VaultFeesRecipientSplit {
1865
- """Address receiving the fee share"""
1866
- address: EvmAddress!
1537
+ input UpdateUserDynamicConfigRequest {
1538
+ """The spoke id"""
1539
+ spoke: SpokeId!
1867
1540
 
1868
- """Portion of the owner share allocated to this recipient"""
1869
- split: PercentValue!
1541
+ """The user sending the transaction (normally the user's wallet address)"""
1542
+ sender: EvmAddress!
1870
1543
 
1871
- """True, if it's an Aave Labs recipient address"""
1872
- isAaveLabs: Boolean!
1544
+ """If not supplied, this will use \`sender\` which is the normal route"""
1545
+ onBehalfOf: EvmAddress
1873
1546
  }
1874
1547
 
1875
- input VaultFeesRecipientSplitInput {
1876
- """Address of the recipient."""
1877
- address: EvmAddress!
1548
+ input UpdateUserRiskPremiumRequest {
1549
+ """The spoke id"""
1550
+ spoke: SpokeId!
1878
1551
 
1879
- """Percentage of the fee that will be sent to the recipient."""
1880
- 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
1881
1557
  }
1882
1558
 
1883
- type VaultFeesRecipientsConfiguration {
1884
- """Revenue splitter contract address responsible for distributing fees"""
1885
- address: EvmAddress!
1559
+ type UserBalance {
1560
+ """The user balance id"""
1561
+ id: UserBalanceId!
1886
1562
 
1887
- """Recipients receiving the vault owner's share"""
1888
- entries: [VaultFeesRecipientSplit!]!
1889
- }
1563
+ """The token info"""
1564
+ info: TokenInfo!
1890
1565
 
1891
- input VaultInput {
1892
- """The address of the fault"""
1893
- address: EvmAddress!
1566
+ """The balances across chains it will be 1 item per chain"""
1567
+ balances: [TokenAmount!]!
1894
1568
 
1895
- """The chain id the vault is on"""
1896
- chainId: ChainId!
1897
- }
1569
+ """The total amount summed across all balances"""
1570
+ totalAmount: DecimalNumber!
1898
1571
 
1899
- input VaultMintShareInput {
1900
- """The amount of vault shares"""
1901
- amount: BigDecimal!
1572
+ """The total fiat amount summed across all balances"""
1573
+ fiatAmount(currency: Currency! = USD): FiatAmount!
1902
1574
 
1903
- """Whether the amount should be received as aToken."""
1904
- asAToken: Boolean! = false
1575
+ """The supply APY dependent on what you pass in for the \`metric\`"""
1576
+ supplyApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1905
1577
 
1906
- """
1907
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
1908
- """
1909
- permitSig: ERC712Signature
1578
+ """The borrow APY dependent on what you pass in for the \`metric\`"""
1579
+ borrowApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1910
1580
  }
1911
1581
 
1912
- input VaultMintSharesRequest {
1913
- """The vault address"""
1914
- vault: EvmAddress!
1582
+ scalar UserBalanceId
1915
1583
 
1916
- """The amount of shares to mint"""
1917
- shares: VaultMintShareInput!
1918
-
1919
- """The user who is wanting to mint the shares"""
1920
- minter: EvmAddress!
1584
+ input UserBalancesByChains {
1585
+ """List of chains"""
1586
+ chainIds: [ChainId!]!
1921
1587
 
1922
1588
  """
1923
- 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
1924
1590
  """
1925
- sharesRecipient: EvmAddress
1926
-
1927
- """The chain id"""
1928
- chainId: ChainId!
1591
+ byReservesType: ReservesRequestFilter! = ALL
1929
1592
  }
1930
1593
 
1931
- input VaultOperationPreviewRequest {
1932
- """The vault"""
1933
- vault: EvmAddress!
1594
+ input UserBalancesByHub {
1595
+ """The hub address"""
1596
+ address: EvmAddress!
1934
1597
 
1935
- """The chain id the vault is deployed on"""
1598
+ """The hub chain id"""
1936
1599
  chainId: ChainId!
1937
1600
 
1938
1601
  """
1939
- The amount in human-readable form
1940
- preview deposit = underlying
1941
- preview mint = shares
1942
- preview withdraw = underlying
1943
- preview redeem = shares
1602
+ The type of reserve to use when determine the tokens to retrieve balances for
1944
1603
  """
1945
- amount: BigDecimal!
1604
+ byReservesType: ReservesRequestFilter! = ALL
1946
1605
  }
1947
1606
 
1948
- input VaultRecipientConfigurationRequest {
1949
- """The retrieve criteria"""
1950
- by: VaultRecipientConfigurationRequestBy!
1607
+ input UserBalancesBySpoke {
1608
+ """The spoke address"""
1609
+ address: EvmAddress!
1951
1610
 
1952
- """The chain id the recipient configuration is deployed on"""
1611
+ """The chain id the spoke is deployed to"""
1953
1612
  chainId: ChainId!
1954
- }
1955
-
1956
- input VaultRecipientConfigurationRequestBy @oneOf {
1957
- """The vault recipient configuration address"""
1958
- address: EvmAddress
1959
1613
 
1960
1614
  """
1961
- 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
1962
1616
  """
1963
- txHash: TxHash
1617
+ byReservesType: ReservesRequestFilter! = ALL
1964
1618
  }
1965
1619
 
1966
- input VaultRedeemShareInput {
1967
- """The amount of vault shares"""
1968
- amount: BigDecimal!
1969
-
1970
- """Whether the amount should be sent as aToken."""
1971
- asAToken: Boolean! = false
1620
+ input UserBalancesByUserPosition {
1621
+ """The user position id"""
1622
+ userPositionId: UserPositionId!
1972
1623
 
1973
1624
  """
1974
- 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
1975
1626
  """
1976
- permitSig: ERC712Signature
1627
+ byReservesType: ReservesRequestFilter! = ALL
1977
1628
  }
1978
1629
 
1979
- input VaultRedeemSharesRequest {
1980
- """The vault address"""
1981
- vault: EvmAddress!
1630
+ input UserBalancesRequest {
1631
+ """The user to get the balance for"""
1632
+ user: EvmAddress!
1982
1633
 
1983
- """The shares to redeem."""
1984
- shares: VaultRedeemShareInput!
1634
+ """The order by clause - defaults to the highest USD value"""
1635
+ orderBy: UserBalancesRequestOrderBy! = {balance: DESC}
1985
1636
 
1986
- """
1987
- The address from which vault shares will be burned (normally your own wallet).
1988
- """
1989
- sharesOwner: EvmAddress!
1637
+ """The user balance filter"""
1638
+ filter: UserBalancesRequestFilter!
1990
1639
 
1991
- """
1992
- If you are doing the redeem from a trusted wallet which can move funds on behalf of the shares owner (advanced usage)
1993
- """
1994
- authorizedUser: EvmAddress
1640
+ """If you want to include 0 balances in the return list"""
1641
+ includeZeroBalances: Boolean! = false
1642
+ }
1995
1643
 
1996
- """
1997
- The address to which the underlying assets will be sent; if not set it will go to the sharesOwner
1998
- """
1999
- recipient: EvmAddress
1644
+ input UserBalancesRequestFilter @oneOf {
1645
+ """The balances for the tokens on the specified chains"""
1646
+ chains: UserBalancesByChains
2000
1647
 
2001
- """The chain id"""
2002
- chainId: ChainId!
2003
- }
1648
+ """The balances for the tokens of hub assets on a given hub"""
1649
+ hub: UserBalancesByHub
2004
1650
 
2005
- input VaultRequest {
2006
- """The retrieve criteria"""
2007
- by: VaultRequestBy!
1651
+ """The balances for the tokens of reserves attached to a spoke"""
1652
+ spoke: UserBalancesBySpoke
2008
1653
 
2009
- """The chain id the vault is deployed on"""
2010
- chainId: ChainId!
1654
+ """The balances for the swappable tokens"""
1655
+ swappable: SwappableTokensRequestQuery
2011
1656
 
2012
1657
  """
2013
- 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
2014
1659
  """
2015
- user: EvmAddress
1660
+ userPosition: UserBalancesByUserPosition
2016
1661
  }
2017
1662
 
2018
- input VaultRequestBy @oneOf {
2019
- """The vault address"""
2020
- address: EvmAddress
1663
+ input UserBalancesRequestOrderBy @oneOf {
1664
+ """The name of the token"""
1665
+ name: OrderDirection
2021
1666
 
2022
- """
2023
- 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
2024
- """
2025
- txHash: TxHash
1667
+ """The balance of the token"""
1668
+ balance: OrderDirection
2026
1669
  }
2027
1670
 
2028
- input VaultSetFeeRequest {
2029
- """The vault deployed address"""
2030
- vault: EvmAddress!
1671
+ type UserBorrowItem {
1672
+ """The user borrow item id"""
1673
+ id: UserBorrowItemId!
2031
1674
 
2032
- """The new fee to set, expressed in %."""
2033
- newFee: BigDecimal!
1675
+ """The reserve borrowed from"""
1676
+ reserve: Reserve!
2034
1677
 
2035
- """The chain id"""
2036
- chainId: ChainId!
2037
- }
1678
+ """The amount borrowed on this reserve"""
1679
+ principal: Erc20Amount!
2038
1680
 
2039
- input VaultSetRecipientsConfigurationRequest {
2040
- """The vault deployed address"""
2041
- vault: EvmAddress!
1681
+ """The overall debt including accrued interests"""
1682
+ debt: Erc20Amount!
2042
1683
 
2043
- """The chain id"""
2044
- chainId: ChainId!
1684
+ """The interest incurred on the loan"""
1685
+ interest: Erc20Amount!
2045
1686
 
2046
- """The recipients configuration contract address to set for the vault."""
2047
- 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
2048
1694
  }
2049
1695
 
2050
- input VaultTransferOwnershipRequest {
2051
- """The vault deployed address"""
2052
- vault: EvmAddress!
1696
+ scalar UserBorrowItemId
2053
1697
 
2054
- """The chain id"""
2055
- chainId: ChainId!
2056
-
2057
- """The new vault owner address"""
2058
- newOwner: EvmAddress!
1698
+ input UserBorrowsQueryRequest @oneOf {
1699
+ userSpoke: UserSpokeInput
1700
+ userToken: UserToken
1701
+ userPositionId: UserPositionId
1702
+ userChains: UserChains
2059
1703
  }
2060
1704
 
2061
- type VaultUserActivityItem {
2062
- balance: TokenAmount!
2063
- earned: TokenAmount!
2064
- withdrew: TokenAmount
2065
- deposited: TokenAmount
2066
- date: DateTime!
2067
- }
1705
+ input UserBorrowsRequest {
1706
+ query: UserBorrowsQueryRequest!
1707
+ orderBy: UserBorrowsRequestOrderBy! = {amount: DESC}
2068
1708
 
2069
- input VaultUserActivityRequest {
2070
- """The vault"""
2071
- vault: EvmAddress!
1709
+ """If you wish to include zero balances in the results"""
1710
+ includeZeroBalances: Boolean! = false
1711
+ }
2072
1712
 
2073
- """The chain id the vault is deployed on"""
2074
- chainId: ChainId!
1713
+ input UserBorrowsRequestOrderBy @oneOf {
1714
+ assetName: OrderDirection
1715
+ created: OrderDirection
1716
+ amount: OrderDirection
1717
+ apy: OrderDirection
1718
+ }
2075
1719
 
2076
- """The user address"""
1720
+ input UserChains {
2077
1721
  user: EvmAddress!
2078
-
2079
- """The timing window for which to calculate user activity"""
2080
- window: VaultUserActivityTimeWindow!
1722
+ chainIds: [ChainId!]!
2081
1723
  }
2082
1724
 
2083
- type VaultUserActivityResult {
2084
- earned: TokenAmount!
2085
- breakdown: [VaultUserActivityItem!]!
2086
- }
1725
+ type UserPosition {
1726
+ """The user position ID"""
1727
+ id: UserPositionId!
2087
1728
 
2088
- enum VaultUserActivityTimeWindow {
2089
- """Samples data in days over the last week"""
2090
- LAST_WEEK
1729
+ """The user holding this position"""
1730
+ user: EvmAddress!
1731
+ createdAt: DateTime!
1732
+ totalSupplied(currency: Currency! = USD): FiatAmountWithChange!
2091
1733
 
2092
- """Samples data in days over the last month"""
2093
- 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!
2094
1738
 
2095
- """Samples data in months over the last year"""
2096
- LAST_YEAR
1739
+ """Total debt which is the total amount borrowed plus the accrued premium"""
1740
+ totalDebt(currency: Currency! = USD): FiatAmountWithChange!
2097
1741
 
2098
- """Samples data in years for the maximum available period"""
2099
- MAX
2100
- }
1742
+ """The net balance which is \`total_supplied\` - \`borrows\`"""
1743
+ netBalance(currency: Currency! = USD): FiatAmountWithChange!
2101
1744
 
2102
- """A transaction where the user supplied assets to a reserve."""
2103
- type VaultUserDepositItem {
2104
- asset: TokenAmount!
2105
- shares: TokenAmount!
2106
- blockExplorerUrl: String!
2107
- txHash: TxHash!
2108
- 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!
2109
1756
  }
2110
1757
 
2111
- enum VaultUserHistoryAction {
2112
- DEPOSIT
2113
- WITHDRAW
2114
- }
1758
+ scalar UserPositionId
2115
1759
 
2116
- input VaultUserTransactionHistoryOrderBy @oneOf {
2117
- """Order by shares"""
2118
- date: OrderDirection
1760
+ input UserPositionRequest @oneOf {
1761
+ userSpoke: UserSpokeInput
1762
+ id: UserPositionId
2119
1763
  }
2120
1764
 
2121
- input VaultUserTransactionHistoryRequest {
2122
- """The vault address"""
2123
- vault: EvmAddress!
2124
-
2125
- """The chain id where the transactions were sent"""
2126
- chainId: ChainId!
2127
-
2128
- """The user that sent the transactions"""
1765
+ input UserPositionsRequest {
1766
+ """The user to get the positions for"""
2129
1767
  user: EvmAddress!
2130
1768
 
2131
- """The filter to optionally filter the transactions by action type"""
2132
- filter: [VaultUserHistoryAction!]! = [DEPOSIT, WITHDRAW]
1769
+ """The filter for the user position"""
1770
+ filter: UserPositionsRequestFilter!
2133
1771
 
2134
- """Ordering criteria"""
2135
- orderBy: VaultUserTransactionHistoryOrderBy! = {date: ASC}
2136
-
2137
- """The page size"""
2138
- pageSize: PageSize! = FIFTY
1772
+ """The ordering for the positions"""
1773
+ orderBy: UserPositionsRequestOrderBy! = {created: ASC}
1774
+ }
2139
1775
 
2140
- """Pagination cursor"""
2141
- cursor: Cursor
1776
+ input UserPositionsRequestFilter @oneOf {
1777
+ tokens: [Erc20Input!]
1778
+ chainIds: [ChainId!]
2142
1779
  }
2143
1780
 
2144
- union VaultUserTransactionItem = VaultUserDepositItem | VaultUserWithdrawItem
1781
+ input UserPositionsRequestOrderBy @oneOf {
1782
+ created: OrderDirection
1783
+ balance: OrderDirection
1784
+ netApy: OrderDirection
1785
+ healthFactor: OrderDirection
1786
+ netCollateral: OrderDirection
1787
+ }
2145
1788
 
2146
- """A transaction where the user withdrew assets from a reserve."""
2147
- type VaultUserWithdrawItem {
2148
- asset: TokenAmount!
2149
- shares: TokenAmount!
2150
- blockExplorerUrl: String!
2151
- txHash: TxHash!
2152
- timestamp: DateTime!
1789
+ input UserSpokeInput {
1790
+ spoke: SpokeId!
1791
+ user: EvmAddress!
2153
1792
  }
2154
1793
 
2155
- input VaultWithdrawAmountInput {
2156
- """The amount of assets to withdraw."""
2157
- value: BigDecimal!
1794
+ type UserSummary {
1795
+ totalPositions: Int!
2158
1796
 
2159
- """Whether the amount should be sent/received as aToken."""
2160
- asAToken: Boolean! = false
1797
+ """Net balance = supply - debt"""
1798
+ netBalance(currency: Currency! = USD): FiatAmountWithChange!
2161
1799
 
2162
- """
2163
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
2164
- """
2165
- permitSig: ERC712Signature
2166
- }
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!
2167
1805
 
2168
- input VaultWithdrawFeesRequest {
2169
- """The vault deployed address"""
2170
- vault: EvmAddress!
1806
+ """Total debt across all positions"""
1807
+ totalDebt(currency: Currency! = USD): FiatAmount!
2171
1808
 
2172
1809
  """
2173
- 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)
2174
1811
  """
2175
- sendTo: EvmAddress
1812
+ netApy: PercentNumber!
2176
1813
 
2177
- """Human-formatted amount"""
2178
- amount: WithdrawAmount!
1814
+ """Interest earned (net fee earned)"""
1815
+ netFeeEarned: FiatAmount!
2179
1816
 
2180
- """The chain id"""
2181
- chainId: ChainId!
1817
+ """Lowest health factor across all positions"""
1818
+ lowestHealthFactor: BigDecimal
2182
1819
  }
2183
1820
 
2184
- input VaultWithdrawRequest {
2185
- """The vault address"""
2186
- vault: EvmAddress!
1821
+ input UserSummaryFilter @oneOf {
1822
+ spoke: SpokeInput
1823
+ spokeId: SpokeId
1824
+ chainIds: [ChainId!]
1825
+ userPositionId: UserPositionId
1826
+ }
2187
1827
 
2188
- """The details of the amounts to withdraw."""
2189
- amount: VaultWithdrawAmountInput!
1828
+ type UserSummaryHistoryItem {
1829
+ healthFactor: BigDecimal
1830
+ date: DateTime!
2190
1831
 
2191
- """
2192
- The address from which vault shares will be burned (normally your own wallet).
2193
- """
2194
- sharesOwner: EvmAddress!
1832
+ """The aggregated net balance for the time period"""
1833
+ netBalance(currency: Currency! = USD): FiatAmount!
2195
1834
 
2196
- """
2197
- If you are doing the withdrawal from a trusted wallet which can move funds on behalf of the shares owner (advanced usage)
2198
- """
2199
- authorizedUser: EvmAddress
1835
+ """The aggregated borrows for the time period"""
1836
+ borrows(currency: Currency! = USD): FiatAmount!
2200
1837
 
2201
- """
2202
- The address to which the underlying assets will be sent - defaults to sharesOwner.
2203
- """
2204
- recipient: EvmAddress
1838
+ """The aggregated supplies for the time period"""
1839
+ supplies(currency: Currency! = USD): FiatAmount!
1840
+ }
2205
1841
 
2206
- """The chain id"""
2207
- chainId: ChainId!
1842
+ input UserSummaryHistoryRequest {
1843
+ user: EvmAddress!
1844
+ filter: UserSummaryFilter
1845
+ window: TimeWindow! = LAST_DAY
2208
1846
  }
2209
1847
 
2210
- input VaultsRequest {
2211
- """Filter criteria for vaults"""
2212
- criteria: VaultsRequestFilterCriteria!
1848
+ input UserSummaryRequest {
1849
+ user: EvmAddress!
1850
+ filter: UserSummaryFilter
1851
+ }
2213
1852
 
2214
- """
2215
- The user viewing it (can be connected wallet) - this caters for stuff like userShares and other user features
2216
- """
2217
- user: EvmAddress
1853
+ input UserSuppliesQueryRequest @oneOf {
1854
+ userSpoke: UserSpokeInput
1855
+ userToken: UserToken
1856
+ userPositionId: UserPositionId
1857
+ userChains: UserChains
1858
+ }
2218
1859
 
2219
- """The page size"""
2220
- pageSize: PageSize! = FIFTY
1860
+ input UserSuppliesRequest {
1861
+ query: UserSuppliesQueryRequest!
1862
+ orderBy: UserSuppliesRequestOrderBy! = {amount: DESC}
2221
1863
 
2222
- """Pagination cursor"""
2223
- cursor: Cursor
1864
+ """If you wish to include zero balances in the results"""
1865
+ includeZeroBalances: Boolean! = false
2224
1866
  }
2225
1867
 
2226
- input VaultsRequestFilterCriteria @oneOf {
2227
- """Filter by specific vault addresses"""
2228
- vaults: [VaultInput!]
2229
-
2230
- """Filter by owner addresses"""
2231
- ownedBy: [EvmAddress!]
1868
+ input UserSuppliesRequestOrderBy @oneOf {
1869
+ assetName: OrderDirection
1870
+ created: OrderDirection
1871
+ amount: OrderDirection
1872
+ apy: OrderDirection
2232
1873
  }
2233
1874
 
2234
- input WithdrawAmount @oneOf {
2235
- """Exact amount to withdraw, remember interest is generated on each block"""
2236
- exact: BigDecimal
1875
+ type UserSupplyItem {
1876
+ """The user supply item id"""
1877
+ id: UserSupplyItemId!
2237
1878
 
2238
- """Withdraw all the position completely"""
2239
- max: AlwaysTrue
2240
- }
1879
+ """The reserve supplied to"""
1880
+ reserve: Reserve!
2241
1881
 
2242
- input WithdrawAmountInput @oneOf {
2243
- """The native amount"""
2244
- native: WithdrawNativeAmountInput
1882
+ """The amount supplied to this reserve"""
1883
+ principal: Erc20Amount!
2245
1884
 
2246
- """The erc20 amount input"""
2247
- erc20: WithdrawErc20AmountInput
2248
- }
1885
+ """The overall amount you can withdraw, including accrued interests"""
1886
+ withdrawable: Erc20Amount!
2249
1887
 
2250
- input WithdrawErc20AmountInput {
2251
- """The token address."""
2252
- currency: EvmAddress!
1888
+ """The interest amount earned on supplying"""
1889
+ interest: Erc20Amount!
1890
+
1891
+ """If this supply is used as collateral"""
1892
+ isCollateral: Boolean!
2253
1893
 
2254
1894
  """
2255
- 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
2256
1899
  """
2257
- value: WithdrawAmount!
1900
+ createdAt: DateTime
2258
1901
  }
2259
1902
 
2260
- input WithdrawNativeAmountInput {
2261
- """The native value"""
2262
- value: WithdrawAmount!
1903
+ scalar UserSupplyItemId
2263
1904
 
2264
- """
2265
- The signed ERC20 permit message to operate on the relevant token without need for an ERC20 Approval transaction.
2266
- """
2267
- 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!
2268
1938
  }
2269
1939
 
2270
1940
  input WithdrawRequest {
2271
- """The market pool address"""
2272
- market: EvmAddress!
1941
+ """The reserve id"""
1942
+ reserve: ReserveId!
2273
1943
 
2274
- """The amount to withdraw"""
2275
- amount: WithdrawAmountInput!
1944
+ """The amount withdrawing"""
1945
+ amount: WithdrawReserveAmountInput!
2276
1946
 
2277
- """
2278
- The user sending the transaction (normally the user's wallet address) this should have the \`aToken\` that will be burned by the \`Pool\`
2279
- """
1947
+ """The user sending the transaction (normally the user's wallet address)"""
2280
1948
  sender: EvmAddress!
1949
+ }
2281
1950
 
2282
- """
2283
- 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
2284
- their own wallet or use a different address if the beneficiary is a different wallet
2285
- """
2286
- recipient: EvmAddress
1951
+ input WithdrawReserveAmountInput @oneOf {
1952
+ """The native amount"""
1953
+ native: AmountInput
2287
1954
 
2288
- """The chain id"""
2289
- chainId: ChainId!
1955
+ """The erc20 amount input"""
1956
+ erc20: AmountInput
2290
1957
  }`;var i=graphql.buildSchema(e);exports.schema=i;//# sourceMappingURL=test-utils.cjs.map
2291
1958
  //# sourceMappingURL=test-utils.cjs.map