@aave/graphql 1.0.0-next.8 → 1.0.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,2211 +0,0 @@
1
- 'use strict';var graphql=require('graphql');var e=`input ActivitiesRequest {
2
- query: ActivitiesRequestQuery!
3
- user: EvmAddress
4
- types: [ActivityType!]! = [BORROW, SUPPLY, WITHDRAW, REPAY, LIQUIDATED, SET_AS_COLLATERAL, UPDATED_DYNAMIC_CONFIG, UPDATED_RISK_PREMIUM]
5
- pageSize: PageSize! = FIFTY
6
- cursor: Cursor
7
- }
8
-
9
- input ActivitiesRequestQuery @oneOf {
10
- hub: HubInput
11
- hubId: HubId
12
- spoke: SpokeInput
13
- spokeId: SpokeId
14
- chainIds: [ChainId!]
15
- txHash: TxHashInput
16
- userPositionId: UserPositionId
17
- }
18
-
19
- union ActivityItem = BorrowActivity | SupplyActivity | WithdrawActivity | RepayActivity | LiquidatedActivity | UsingAsCollateralActivity | UpdatedDynamicConfigActivity | UpdatedRiskPremiumActivity
20
-
21
- enum ActivityType {
22
- SUPPLY
23
- BORROW
24
- REPAY
25
- WITHDRAW
26
- LIQUIDATED
27
- SET_AS_COLLATERAL
28
- UPDATED_DYNAMIC_CONFIG
29
- UPDATED_RISK_PREMIUM
30
- }
31
-
32
- scalar AlwaysTrue
33
-
34
- input AmountInput @oneOf {
35
- """Exact amount"""
36
- exact: BigDecimal
37
-
38
- """Max amount"""
39
- max: AlwaysTrue
40
- }
41
-
42
- enum ApyMetric {
43
- HIGHEST
44
- LOWEST
45
- AVERAGE
46
- }
47
-
48
- type ApySample {
49
- date: DateTime!
50
- avgRate: PercentNumber!
51
- }
52
-
53
- type Asset {
54
- id: AssetId!
55
- token: Erc20Token!
56
- summary: AssetSummary!
57
- price(currency: Currency! = USD): ExchangeAmountWithChange!
58
- }
59
-
60
- type AssetAmountWithChange {
61
- amount: DecimalNumberWithChange!
62
- exchange(currency: Currency! = USD): ExchangeAmountWithChange!
63
- }
64
-
65
- input AssetBorrowHistoryRequest {
66
- query: AssetBorrowHistoryRequestQuery!
67
- window: TimeWindow! = LAST_DAY
68
- }
69
-
70
- input AssetBorrowHistoryRequestQuery @oneOf {
71
- token: Erc20Input
72
- assetId: AssetId
73
- }
74
-
75
- type AssetBorrowSample {
76
- date: DateTime!
77
- amount: DecimalNumber!
78
- highestApy: PercentNumber!
79
- lowestApy: PercentNumber!
80
- }
81
-
82
- input AssetCategoryBorrowHistoryRequest {
83
- category: TokenCategory!
84
- window: TimeWindow! = LAST_DAY
85
- }
86
-
87
- type AssetCategoryBorrowSample {
88
- date: DateTime!
89
- highestApy: PercentNumber!
90
- lowestApy: PercentNumber!
91
- borrows(currency: Currency! = USD): ExchangeAmount!
92
- }
93
-
94
- input AssetCategorySupplyHistoryRequest {
95
- category: TokenCategory!
96
- window: TimeWindow! = LAST_DAY
97
- }
98
-
99
- type AssetCategorySupplySample {
100
- date: DateTime!
101
- highestApy: PercentNumber!
102
- lowestApy: PercentNumber!
103
- deposits(currency: Currency! = USD): ExchangeAmount!
104
- }
105
-
106
- scalar AssetId
107
-
108
- input AssetPriceHistoryRequest {
109
- query: AssetPriceHistoryRequestQuery!
110
- currency: Currency! = USD
111
- window: TimeWindow! = LAST_DAY
112
- }
113
-
114
- input AssetPriceHistoryRequestQuery @oneOf {
115
- token: Erc20Input
116
- assetId: AssetId
117
- }
118
-
119
- type AssetPriceSample {
120
- date: DateTime!
121
- price: BigDecimal!
122
- }
123
-
124
- input AssetRequest {
125
- query: AssetRequestQuery!
126
- }
127
-
128
- input AssetRequestQuery @oneOf {
129
- token: Erc20Input
130
- assetId: AssetId
131
- }
132
-
133
- type AssetSummary {
134
- totalSupplyCap: DecimalNumberWithChange!
135
- totalSupplied: AssetAmountWithChange!
136
- totalSuppliable: AssetAmountWithChange!
137
- totalBorrowCap: DecimalNumberWithChange!
138
- totalBorrowed: AssetAmountWithChange!
139
- totalBorrowable: AssetAmountWithChange!
140
-
141
- """The supply apy dependent on what you pass in for the \`metric\`"""
142
- supplyApy(metric: ApyMetric! = AVERAGE): PercentNumber!
143
-
144
- """The borrow APY dependent on what you pass in for the \`metric\`"""
145
- borrowApy(metric: ApyMetric! = AVERAGE): PercentNumber!
146
- }
147
-
148
- input AssetSupplyHistoryRequest {
149
- query: AssetSupplyHistoryRequestQuery!
150
- window: TimeWindow! = LAST_DAY
151
- }
152
-
153
- input AssetSupplyHistoryRequestQuery @oneOf {
154
- token: Erc20Input
155
- assetId: AssetId
156
- }
157
-
158
- type AssetSupplySample {
159
- date: DateTime!
160
- amount: DecimalNumber!
161
- highestApy: PercentNumber!
162
- lowestApy: PercentNumber!
163
- }
164
-
165
- scalar BigDecimal
166
-
167
- scalar BigInt
168
-
169
- scalar BlockchainData
170
-
171
- type BorrowActivity {
172
- id: ID!
173
- user: EvmAddress!
174
- timestamp: DateTime!
175
- txHash: TxHash!
176
- spoke: Spoke!
177
- reserve: ReserveInfo!
178
- borrowed: Erc20Amount!
179
- chain: Chain!
180
- }
181
-
182
- input BorrowApyHistoryRequest {
183
- reserve: ReserveId!
184
- window: TimeWindow! = LAST_DAY
185
- }
186
-
187
- input BorrowRequest {
188
- """The reserve id"""
189
- reserve: ReserveId!
190
-
191
- """The amount supplying"""
192
- amount: ReserveAmountInput!
193
-
194
- """The user sending the transaction (normally the user's wallet address)"""
195
- sender: EvmAddress!
196
- }
197
-
198
- input CancelIntentSwapInput {
199
- id: SwapId!
200
- signature: Signature!
201
- }
202
-
203
- union CancelSwapExecutionPlan = TransactionRequest | SwapCancelled
204
-
205
- input CancelSwapRequest @oneOf {
206
- intent: CancelIntentSwapInput
207
- transaction: SwapId
208
- }
209
-
210
- type CancelSwapTypeDefinition {
211
- EIP712Domain: [TypeField!]!
212
- OrderCancellations: [TypeField!]!
213
- }
214
-
215
- type CancelSwapTypedData {
216
- types: CancelSwapTypeDefinition!
217
- primaryType: String!
218
- domain: DomainData!
219
- message: JSON!
220
- }
221
-
222
- type Chain {
223
- name: String!
224
- icon: String!
225
- chainId: ChainId!
226
- explorerUrl: String!
227
- isTestnet: Boolean!
228
- nativeWrappedToken: EvmAddress!
229
- nativeInfo: TokenInfo!
230
- nativeGateway: EvmAddress!
231
- signatureGateway: EvmAddress!
232
- rpcUrl: String!
233
- isFork: Boolean!
234
- }
235
-
236
- """A supported blockchain chain ID"""
237
- scalar ChainId
238
-
239
- input ChainRequest {
240
- """The chain id"""
241
- chainId: ChainId!
242
- }
243
-
244
- input ChainTokenCategories {
245
- chainId: ChainId!
246
- categories: [TokenCategory!]!
247
- }
248
-
249
- input ChainTokenInput {
250
- """The chain id"""
251
- chainId: ChainId!
252
-
253
- """The token input"""
254
- token: TokenInput!
255
- }
256
-
257
- enum ChainsFilter {
258
- TESTNET_ONLY
259
- MAINNET_ONLY
260
- ALL
261
- }
262
-
263
- input ChainsRequest {
264
- query: ChainsRequestQuery!
265
- }
266
-
267
- input ChainsRequestQuery @oneOf {
268
- chainIds: [ChainId!]
269
- filter: ChainsFilter
270
- }
271
-
272
- type CollateralFactorVariation {
273
- reserveId: ReserveId!
274
- token: Erc20Token!
275
- current: PercentNumber!
276
- after: PercentNumber!
277
- }
278
-
279
- enum CollateralMetric {
280
- HIGHEST
281
- LOWEST
282
- }
283
-
284
- enum Currency {
285
- USD
286
- GBP
287
- EUR
288
- }
289
-
290
- scalar Cursor
291
-
292
- scalar DateTime
293
-
294
- type DecimalNumber {
295
- """The on-chain representation of \`value\`, stored as an integer."""
296
- onChainValue: BigInt!
297
-
298
- """
299
- The number of decimals defining how many fractional digits the number supports.
300
- """
301
- decimals: Int!
302
-
303
- """The normalized value computed as \`onChainValue / 10^decimals\`."""
304
- value: BigDecimal!
305
- }
306
-
307
- type DecimalNumberWithChange {
308
- current: DecimalNumber!
309
- change(window: TimeWindow! = LAST_DAY): PercentNumber!
310
- }
311
-
312
- type DomainData {
313
- name: String!
314
- version: String!
315
- chainId: ChainId!
316
- verifyingContract: EvmAddress!
317
- }
318
-
319
- scalar DynamicConfigKey
320
-
321
- input ERC20PermitSignature {
322
- """The signature for the erc721"""
323
- value: Signature!
324
-
325
- """The deadline for the erc721"""
326
- deadline: Int!
327
- }
328
-
329
- enum EarningPeriod {
330
- ANNUAL
331
- }
332
-
333
- type Erc20Amount {
334
- """The value"""
335
- amount: DecimalNumber!
336
-
337
- """The exchange amount"""
338
- exchange(currency: Currency! = USD): ExchangeAmount!
339
-
340
- """The exchange rate"""
341
- exchangeRate(currency: Currency! = USD): DecimalNumber!
342
- isWrappedNative: Boolean!
343
- token: Erc20Token!
344
- }
345
-
346
- type Erc20ApprovalRequired {
347
- """The transaction requires an approval first"""
348
- transaction: TransactionRequest!
349
-
350
- """The reason for the approval"""
351
- reason: String!
352
-
353
- """The required amount missing to be able to do the original transaction"""
354
- requiredAmount: DecimalNumber!
355
-
356
- """The current allowance approved"""
357
- currentAllowance: DecimalNumber!
358
-
359
- """The transaction to send after the approval is complete"""
360
- originalTransaction: TransactionRequest!
361
- }
362
-
363
- input Erc20Input {
364
- """The token address"""
365
- address: EvmAddress!
366
-
367
- """The token chain id"""
368
- chainId: ChainId!
369
- }
370
-
371
- type Erc20Token {
372
- """The token address"""
373
- address: EvmAddress!
374
-
375
- """The chain its deployed to"""
376
- chain: Chain!
377
-
378
- """The ERC20 token info"""
379
- info: TokenInfo!
380
-
381
- """
382
- The protocol only deals with ERC20 this allows you to understand if
383
- the token is a wrapped native token to allow you to maybe change \`WETH\` > \`ETH\`
384
- on the display screen, or whatever you decide makes sense
385
- """
386
- isWrappedNativeToken: Boolean!
387
-
388
- """If permit is supported for the ERC20 token"""
389
- permitSupported: Boolean!
390
- }
391
-
392
- scalar EvmAddress
393
-
394
- type ExchangeAmount {
395
- value: BigDecimal!
396
- name: String!
397
- symbol: String!
398
- icon: String!
399
- decimals: Int!
400
- }
401
-
402
- type ExchangeAmountVariation {
403
- current: ExchangeAmount!
404
- after: ExchangeAmount!
405
- }
406
-
407
- type ExchangeAmountWithChange {
408
- current: ExchangeAmount!
409
- change(window: TimeWindow! = LAST_DAY): PercentNumber!
410
- }
411
-
412
- input ExchangeRateRequest {
413
- """The from criteria"""
414
- from: ExchangeRateRequestFrom!
415
-
416
- """The currency to get the result in"""
417
- to: Currency!
418
-
419
- """
420
- The date time to get the exchange rate at, if not provided the latest rate is returned
421
- """
422
- at: DateTime
423
- }
424
-
425
- input ExchangeRateRequestFrom @oneOf {
426
- """The currency"""
427
- fiat: Currency
428
-
429
- """The erc20 token"""
430
- erc20: Erc20Input
431
-
432
- """The native token"""
433
- native: ChainId
434
- }
435
-
436
- union ExecutionPlan = TransactionRequest | Erc20ApprovalRequired | PreContractActionRequired | InsufficientBalanceError
437
-
438
- input ForkTopUpErc20 {
439
- """The token address"""
440
- currency: EvmAddress!
441
-
442
- """
443
- Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction
444
- """
445
- value: BigDecimal!
446
- }
447
-
448
- input ForkTopUpRequest {
449
- """The address you want the funds to be topped up against"""
450
- user: EvmAddress!
451
-
452
- """The erc20 information"""
453
- erc20: ForkTopUpErc20
454
-
455
- """
456
- Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction
457
- """
458
- native: BigDecimal
459
- }
460
-
461
- type ForkTopUpResponse {
462
- message: String!
463
-
464
- """The tx hash of the newly created transaction"""
465
- txHash: String
466
- }
467
-
468
- input HasProcessedKnownTransactionRequest {
469
- """
470
- The operation types this is given to you on the TransactionRequest::operations
471
- """
472
- operations: [OperationType!]!
473
-
474
- """The tx hash"""
475
- txHash: TxHash!
476
- }
477
-
478
- type HealthFactorError {
479
- reason: String!
480
- current: BigDecimal
481
- after: BigDecimal
482
- }
483
-
484
- union HealthFactorResult = HealthFactorVariation | HealthFactorError
485
-
486
- type HealthFactorVariation {
487
- current: BigDecimal
488
- after: BigDecimal
489
- }
490
-
491
- type HealthFactorWithChange {
492
- current: BigDecimal
493
- change(window: TimeWindow! = LAST_DAY): PercentNumber!
494
- }
495
-
496
- type Hub {
497
- """The id for the hub"""
498
- id: HubId!
499
-
500
- """The hub name"""
501
- name: String!
502
-
503
- """The hub address"""
504
- address: EvmAddress!
505
-
506
- """The chain the hub is deployed on"""
507
- chain: Chain!
508
-
509
- """The hub summary"""
510
- summary(currency: Currency! = USD): HubSummary!
511
- }
512
-
513
- type HubAsset {
514
- """The id for the hub asset"""
515
- id: HubAssetId!
516
-
517
- """The onchain asset id"""
518
- onchainAssetId: OnChainHubAssetId!
519
-
520
- """The hub"""
521
- hub: Hub!
522
-
523
- """The underlying token"""
524
- underlying: Erc20Token!
525
-
526
- """The hub asset summary"""
527
- summary: HubAssetSummary!
528
-
529
- """The hub asset settings"""
530
- settings: HubAssetSettings!
531
- userState: HubAssetUserState
532
- }
533
-
534
- scalar HubAssetId
535
-
536
- type HubAssetSettings {
537
- """The fee receiver"""
538
- feeReceiver: EvmAddress!
539
-
540
- """The liquidity fee"""
541
- liquidityFee: PercentNumber!
542
-
543
- """The ir strategy"""
544
- irStrategy: EvmAddress!
545
-
546
- """The reinvestment strategy"""
547
- reinvestmentController: EvmAddress
548
- }
549
-
550
- type HubAssetSummary {
551
- """The supplied amount"""
552
- supplied: Erc20Amount!
553
-
554
- """The borrowed amount"""
555
- borrowed: Erc20Amount!
556
-
557
- """The available liquidity"""
558
- availableLiquidity: Erc20Amount!
559
-
560
- """The supply apy"""
561
- supplyApy: PercentNumber!
562
-
563
- """The borrow apy"""
564
- borrowApy: PercentNumber!
565
-
566
- """The net apy"""
567
- netApy: PercentNumber!
568
-
569
- """The utilization rate"""
570
- utilizationRate: PercentNumber!
571
- }
572
-
573
- type HubAssetUserState {
574
- """The hub asset balance"""
575
- balance: Erc20Amount!
576
- }
577
-
578
- input HubAssetsRequest {
579
- query: HubAssetsRequestQuery!
580
- user: EvmAddress
581
- orderBy: HubAssetsRequestOrderBy! = {assetName: ASC}
582
- }
583
-
584
- input HubAssetsRequestOrderBy @oneOf {
585
- assetName: OrderDirection
586
- availableLiquidity: OrderDirection
587
- supplyApy: OrderDirection
588
- borrowApy: OrderDirection
589
- }
590
-
591
- input HubAssetsRequestQuery @oneOf {
592
- hubInput: HubInput
593
- hubId: HubId
594
- }
595
-
596
- scalar HubId
597
-
598
- input HubIdTokenInput {
599
- hubId: HubId!
600
- token: EvmAddress!
601
- }
602
-
603
- input HubInput {
604
- """The hub address"""
605
- address: EvmAddress!
606
-
607
- """The hub chain id"""
608
- chainId: ChainId!
609
- }
610
-
611
- input HubRequest {
612
- query: HubRequestQuery!
613
- }
614
-
615
- input HubRequestQuery @oneOf {
616
- hubInput: HubInput
617
- hubId: HubId
618
- }
619
-
620
- type HubSummary {
621
- """
622
- The total spoke reserves aggregated borrowed using this hub, showed in exchange amount as each asset has a different value
623
- """
624
- totalBorrowed: ExchangeAmountWithChange!
625
-
626
- """
627
- The total spoke reserves aggregated borrow caps using this hub, showed in exchange amount as each asset has a different value
628
- """
629
- totalBorrowCap: ExchangeAmount!
630
-
631
- """
632
- The total spoke reserves aggregated supplied using this hub, showed in exchange amount as each asset has a different value
633
- """
634
- totalSupplied: ExchangeAmountWithChange!
635
-
636
- """
637
- The total spoke reserves aggregated supply caps using this hub, showed in exchange amount as each asset has a different value
638
- """
639
- totalSupplyCap: ExchangeAmount!
640
-
641
- """The utilization rate"""
642
- utilizationRate: PercentNumber!
643
- }
644
-
645
- input HubSummaryHistoryRequest {
646
- query: HubSummaryHistoryRequestQuery!
647
- currency: Currency! = USD
648
- window: TimeWindow! = LAST_DAY
649
- }
650
-
651
- input HubSummaryHistoryRequestQuery @oneOf {
652
- hubInput: HubInput
653
- hubId: HubId
654
- }
655
-
656
- type HubSummarySample {
657
- date: DateTime!
658
- deposits: ExchangeAmount!
659
- borrows: ExchangeAmount!
660
- availableLiquidity: ExchangeAmount!
661
- utilizationRate: PercentNumber!
662
- }
663
-
664
- input HubTokenInput {
665
- chainId: ChainId!
666
- hub: EvmAddress!
667
- token: EvmAddress!
668
- }
669
-
670
- input HubsRequest {
671
- query: HubsRequestQuery!
672
- orderBy: HubsRequestOrderBy! = {name: ASC}
673
- }
674
-
675
- input HubsRequestOrderBy @oneOf {
676
- name: OrderDirection
677
- totalBorrowed: OrderDirection
678
- totalSupplied: OrderDirection
679
- }
680
-
681
- input HubsRequestQuery @oneOf {
682
- """Get back all the hubs which have one of the underlying tokens supplied"""
683
- tokens: [Erc20Input!]
684
-
685
- """Get back all the hubs based on the chain ids passed in"""
686
- chainIds: [ChainId!]
687
- }
688
-
689
- type InsufficientBalanceError {
690
- """The amount required to do the original transaction"""
691
- required: DecimalNumber!
692
-
693
- """The amount available in the wallet"""
694
- available: DecimalNumber!
695
- }
696
-
697
- """A scalar that can represent any JSON value."""
698
- scalar JSON
699
-
700
- input LiquidatePositionDebtAmount @oneOf {
701
- """Exact amount"""
702
- exact: BigDecimal
703
-
704
- """The most you can liquidate"""
705
- max: AlwaysTrue
706
- }
707
-
708
- union LiquidatePositionExecutionPlan = TransactionRequest | Erc20ApprovalRequired | InsufficientBalanceError
709
-
710
- input LiquidatePositionRequest {
711
- """The collateral reserve id"""
712
- collateral: ReserveId!
713
-
714
- """The debt reserve id"""
715
- debt: ReserveId!
716
-
717
- """The amount to liquidate"""
718
- amount: LiquidatePositionDebtAmount!
719
-
720
- """The person liquidating the position"""
721
- liquidator: EvmAddress!
722
-
723
- """The user to liquidate"""
724
- user: EvmAddress!
725
-
726
- """If you would like to receive shares over the asset"""
727
- receiveShares: Boolean! = false
728
- }
729
-
730
- type LiquidatedActivity {
731
- id: ID!
732
- user: EvmAddress!
733
- timestamp: DateTime!
734
- txHash: TxHash!
735
- spoke: Spoke!
736
- collateralReserve: ReserveInfo!
737
- debtReserve: ReserveInfo!
738
- collateral: Erc20Amount!
739
- debt: Erc20Amount!
740
- liquidator: EvmAddress!
741
- chain: Chain!
742
- }
743
-
744
- type LiquidationFeeVariation {
745
- reserveId: ReserveId!
746
- token: Erc20Token!
747
- current: PercentNumber!
748
- after: PercentNumber!
749
- }
750
-
751
- type MaxLiquidationBonusVariation {
752
- reserveId: ReserveId!
753
- token: Erc20Token!
754
- current: PercentNumber!
755
- after: PercentNumber!
756
- }
757
-
758
- type Mutation {
759
- """Top up a balance for a user or yourself on the fork"""
760
- forkTopUp(request: ForkTopUpRequest!): ForkTopUpResponse!
761
- }
762
-
763
- type NativeAmount {
764
- """The native token"""
765
- token: NativeToken!
766
-
767
- """The value"""
768
- amount: DecimalNumber!
769
-
770
- """The exchange amount"""
771
- exchange(currency: Currency! = USD): ExchangeAmount!
772
-
773
- """The exchange rate"""
774
- exchangeRate(currency: Currency! = USD): DecimalNumber!
775
- }
776
-
777
- type NativeToken {
778
- info: TokenInfo!
779
- chain: Chain!
780
- }
781
-
782
- scalar OnChainHubAssetId
783
-
784
- scalar OnChainReserveId
785
-
786
- enum OperationType {
787
- SPOKE_BORROW
788
- SPOKE_REPAY
789
- SPOKE_SUPPLY
790
- SPOKE_WITHDRAW
791
- SPOKE_UPDATE_USER_RISK_PREMIUM
792
- SPOKE_SET_USER_USING_AS_COLLATERAL
793
- SPOKE_SET_USER_POSITION_MANAGER
794
- RENOUNCE_SPOKE_USER_POSITION_MANAGER
795
- LIQUIDATION
796
- }
797
-
798
- enum OrderDirection {
799
- ASC
800
- DESC
801
- }
802
-
803
- enum PageSize {
804
- TEN
805
- FIFTY
806
- }
807
-
808
- type PaginatedActivitiesResult {
809
- items: [ActivityItem!]!
810
- pageInfo: PaginatedResultInfo!
811
- }
812
-
813
- type PaginatedResultInfo {
814
- """The cursor to the previous page of results, if any."""
815
- prev: Cursor
816
-
817
- """The cursor to the next page of results, if any."""
818
- next: Cursor
819
- }
820
-
821
- type PaginatedSpokePositionManagerResult {
822
- items: [SpokePositionManger!]!
823
- pageInfo: PaginatedResultInfo!
824
- }
825
-
826
- type PaginatedSpokeUserPositionManagerResult {
827
- items: [SpokeUserPositionManager!]!
828
- pageInfo: PaginatedResultInfo!
829
- }
830
-
831
- type PaginatedUserSwapsResult {
832
- items: [SwapStatus!]!
833
- pageInfo: PaginatedResultInfo!
834
- }
835
-
836
- type PercentNumber {
837
- """
838
- The on-chain representation of the percentage, stored in basis points (bps).
839
- """
840
- onChainValue: BigInt!
841
-
842
- """The number of decimals defining the precision of \`bps\`."""
843
- decimals: Int!
844
-
845
- """The percentage value where 1.0 represents 100%."""
846
- value: BigDecimal!
847
-
848
- """The human-friendly percentage value formatted for display."""
849
- normalized: BigDecimal!
850
- }
851
-
852
- type PercentNumberChangeSnapshot {
853
- before: PercentNumber!
854
- after: PercentNumber!
855
- }
856
-
857
- type PercentNumberVariation {
858
- current: PercentNumber!
859
- after: PercentNumber!
860
- }
861
-
862
- type PercentNumberWithChange {
863
- current: PercentNumber!
864
- change(window: TimeWindow! = LAST_DAY): PercentNumber!
865
- }
866
-
867
- type PermitMessageData {
868
- owner: EvmAddress!
869
- spender: EvmAddress!
870
- value: BigInt!
871
- nonce: BigInt!
872
- deadline: Int!
873
- }
874
-
875
- input PermitRequest @oneOf {
876
- supply: SupplyPermitRequest
877
- repay: RepayPermitRequest
878
- }
879
-
880
- type PermitTypedDataResponse {
881
- types: TypeDefinition!
882
- primaryType: String!
883
- domain: DomainData!
884
- message: PermitMessageData!
885
- }
886
-
887
- type PreContractActionRequired {
888
- """The transaction requires a pre-contract action first"""
889
- transaction: TransactionRequest!
890
-
891
- """The reason for the pre-contract action"""
892
- reason: String!
893
-
894
- """The transaction to send after the approval is complete"""
895
- originalTransaction: TransactionRequest!
896
- }
897
-
898
- input PrepareLimitOrderSwapInput {
899
- quoteId: SwapQuoteId!
900
- newSellAmount: BigDecimal
901
- newBuyAmount: BigDecimal
902
-
903
- """Slippage in basis points"""
904
- newSlippage: BigDecimal
905
- newReceiver: EvmAddress
906
- }
907
-
908
- input PrepareMarketOrderSwapInput {
909
- chainId: ChainId!
910
- buy: TokenInput!
911
- sell: TokenInput!
912
- amount: BigDecimal!
913
- kind: SwapKind!
914
- user: EvmAddress!
915
- receiver: EvmAddress
916
- }
917
-
918
- input PrepareSwapCancelRequest {
919
- id: SwapId!
920
- }
921
-
922
- type PrepareSwapCancelResult {
923
- data: CancelSwapTypedData!
924
- }
925
-
926
- input PrepareSwapRequest @oneOf {
927
- market: PrepareMarketOrderSwapInput
928
- limit: PrepareLimitOrderSwapInput
929
- }
930
-
931
- union PrepareSwapResult = SwapByIntent | SwapByIntentWithApprovalRequired | SwapByTransaction | InsufficientBalanceError
932
-
933
- input PreviewAction @oneOf {
934
- supply: SupplyRequest
935
- borrow: BorrowRequest
936
- repay: RepayRequest
937
- withdraw: WithdrawRequest
938
- setUserSuppliesAsCollateral: SetUserSuppliesAsCollateralRequest
939
- updateUserPositionConditions: UpdateUserPositionConditionsRequest
940
- }
941
-
942
- input PreviewRequest {
943
- action: PreviewAction!
944
- }
945
-
946
- type PreviewUserPosition {
947
- id: UserPositionId!
948
- healthFactor: HealthFactorResult!
949
- riskPremium: PercentNumberVariation!
950
-
951
- """The net apy for one user position on a current spoke"""
952
- netApy: PercentNumberVariation!
953
- netCollateral(currency: Currency! = USD): ExchangeAmountVariation!
954
- netBalance(currency: Currency! = USD): ExchangeAmountVariation!
955
- projectedEarnings(period: EarningPeriod! = ANNUAL): ExchangeAmountVariation!
956
- borrowingPower: ExchangeAmountVariation!
957
- otherConditions: [UserPositionConditionVariation!]!
958
- }
959
-
960
- input ProtocolHistoryRequest {
961
- currency: Currency! = USD
962
- window: TimeWindow! = LAST_DAY
963
- }
964
-
965
- type ProtocolHistorySample {
966
- date: DateTime!
967
- deposits: ExchangeAmount!
968
- borrows: ExchangeAmount!
969
- earnings: ExchangeAmount!
970
- }
971
-
972
- type Query {
973
- health: Boolean!
974
- chain(request: ChainRequest!): Chain
975
- chains(request: ChainsRequest!): [Chain!]!
976
-
977
- """Generate EIP-712 typed data for EIP-2612 permit signature"""
978
- permitTypedData(request: PermitRequest!): PermitTypedDataResponse!
979
-
980
- """Get the exchange rate of tokens > currency or currency > currency"""
981
- exchangeRate(request: ExchangeRateRequest!): ExchangeAmount!
982
- protocolHistory(request: ProtocolHistoryRequest!): [ProtocolHistorySample!]!
983
- asset(request: AssetRequest!): Asset
984
- assetSupplyHistory(request: AssetSupplyHistoryRequest!): [AssetSupplySample!]!
985
- assetCategoryBorrowHistory(request: AssetCategoryBorrowHistoryRequest!): [AssetCategoryBorrowSample!]!
986
- assetCategorySupplyHistory(request: AssetCategorySupplyHistoryRequest!): [AssetCategorySupplySample!]!
987
- assetBorrowHistory(request: AssetBorrowHistoryRequest!): [AssetBorrowSample!]!
988
- assetPriceHistory(request: AssetPriceHistoryRequest!): [AssetPriceSample!]!
989
-
990
- """Fetch a list of hubs depending on your search criteria"""
991
- hubs(request: HubsRequest!): [Hub!]!
992
- hub(request: HubRequest!): Hub
993
- hubAssets(request: HubAssetsRequest!): [HubAsset!]!
994
- hubSummaryHistory(request: HubSummaryHistoryRequest!): [HubSummarySample!]!
995
- reserve(request: ReserveRequest!): Reserve
996
- reserves(request: ReservesRequest!): [Reserve!]!
997
- supply(request: SupplyRequest!): ExecutionPlan!
998
- borrow(request: BorrowRequest!): ExecutionPlan!
999
- withdraw(request: WithdrawRequest!): ExecutionPlan!
1000
- repay(request: RepayRequest!): ExecutionPlan!
1001
- spokePositionManagers(request: SpokePositionManagersRequest!): PaginatedSpokePositionManagerResult!
1002
- spokeUserPositionManagers(request: SpokeUserPositionManagersRequest!): PaginatedSpokeUserPositionManagerResult!
1003
- setSpokeUserPositionManager(request: SetSpokeUserPositionManagerRequest!): TransactionRequest!
1004
- renounceSpokeUserPositionManager(request: RenounceSpokeUserPositionManagerRequest!): TransactionRequest!
1005
- setUserSuppliesAsCollateral(request: SetUserSuppliesAsCollateralRequest!): TransactionRequest!
1006
- liquidatePosition(request: LiquidatePositionRequest!): LiquidatePositionExecutionPlan!
1007
- updateUserPositionConditions(request: UpdateUserPositionConditionsRequest!): TransactionRequest!
1008
- preview(request: PreviewRequest!): PreviewUserPosition!
1009
- borrowApyHistory(request: BorrowApyHistoryRequest!): [ApySample!]!
1010
- supplyApyHistory(request: SupplyApyHistoryRequest!): [ApySample!]!
1011
- spoke(request: SpokeRequest!): Spoke
1012
-
1013
- """Lists all spokes"""
1014
- spokes(request: SpokesRequest!): [Spoke!]!
1015
-
1016
- """
1017
- Get the user balances for the protocol
1018
- This will only return assets that can be used on the protocol
1019
- """
1020
- userBalances(request: UserBalancesRequest!): [UserBalance!]!
1021
- userBorrows(request: UserBorrowsRequest!): [UserBorrowItem!]!
1022
- userSummary(request: UserSummaryRequest!): UserSummary!
1023
- userSummaryHistory(request: UserSummaryHistoryRequest!): [UserSummaryHistoryItem!]!
1024
- userPositions(request: UserPositionsRequest!): [UserPosition!]!
1025
- userPosition(request: UserPositionRequest!): UserPosition
1026
- userSupplies(request: UserSuppliesRequest!): [UserSupplyItem!]!
1027
- userRiskPremiumBreakdown(request: UserRiskPremiumBreakdownRequest!): [UserRiskPremiumBreakdownItem!]!
1028
-
1029
- """
1030
- This lets you know the API has processed the known transaction hash, as the API uses caching to make things as fast
1031
- as possible, it has an invalidation task, so sometimes if the receipt is complete, we may still (rarely) serve
1032
- old data for 100-200ms longer, it's best to query after you got the receipt to be told that it is ready to go.
1033
- Note the invalidation is very quick, and most of the time it's present even before your receipt is returned this is to
1034
- cater for the race condition.
1035
- """
1036
- hasProcessedKnownTransaction(request: HasProcessedKnownTransactionRequest!): Boolean!
1037
- activities(request: ActivitiesRequest!): PaginatedActivitiesResult!
1038
- swapQuote(request: SwapQuoteRequest!): SwapQuote!
1039
- prepareSwap(request: PrepareSwapRequest!): PrepareSwapResult!
1040
- swap(request: SwapRequest!): SwapExecutionPlan!
1041
- swapStatus(request: SwapStatusRequest!): SwapStatus!
1042
- userSwaps(request: UserSwapsRequest!): PaginatedUserSwapsResult!
1043
- prepareSwapCancel(request: PrepareSwapCancelRequest!): PrepareSwapCancelResult!
1044
- cancelSwap(request: CancelSwapRequest!): CancelSwapExecutionPlan!
1045
- swappableTokens(request: SwappableTokensRequest!): [Token!]!
1046
- }
1047
-
1048
- input RenounceSpokeUserPositionManagerRequest {
1049
- """The spoke id"""
1050
- spoke: SpokeId!
1051
-
1052
- """The address to remove as a position manager"""
1053
- manager: EvmAddress!
1054
-
1055
- """The address to remove \`manager\` as position manager"""
1056
- managing: EvmAddress!
1057
- }
1058
-
1059
- type RepayActivity {
1060
- id: ID!
1061
- user: EvmAddress!
1062
- timestamp: DateTime!
1063
- txHash: TxHash!
1064
- spoke: Spoke!
1065
- reserve: ReserveInfo!
1066
- repaid: Erc20Amount!
1067
- chain: Chain!
1068
- }
1069
-
1070
- input RepayAmountInputWithPermit @oneOf {
1071
- """The native amount"""
1072
- native: AmountInput
1073
-
1074
- """The erc20 amount input"""
1075
- erc20: RepayErc20AmountInputWithPermit
1076
- }
1077
-
1078
- input RepayErc20AmountInputWithPermit {
1079
- """
1080
- Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction (e.g., wei).
1081
- """
1082
- value: AmountInput!
1083
-
1084
- """
1085
- The signed ERC20 permit message to operate on the relevant token without a need for an ERC20 Approval transaction.
1086
- """
1087
- permitSig: ERC20PermitSignature
1088
- }
1089
-
1090
- input RepayPermitRequest {
1091
- """The reserve id"""
1092
- reserve: ReserveId!
1093
-
1094
- """The amount repaying"""
1095
- amount: AmountInput!
1096
-
1097
- """The user sending the transaction (normally the user's wallet address)"""
1098
- sender: EvmAddress!
1099
- }
1100
-
1101
- input RepayRequest {
1102
- """The reserve id"""
1103
- reserve: ReserveId!
1104
-
1105
- """The amount repaying"""
1106
- amount: RepayAmountInputWithPermit!
1107
-
1108
- """The user sending the transaction (normally the user's wallet address)"""
1109
- sender: EvmAddress!
1110
- }
1111
-
1112
- type Reserve {
1113
- id: ReserveId!
1114
- onChainId: OnChainReserveId!
1115
- borrowCap: BigDecimal!
1116
- supplyCap: BigDecimal!
1117
- chain: Chain!
1118
- summary: ReserveSummary!
1119
- settings: ReserveSettings!
1120
- status: ReserveStatus!
1121
- canBorrow: Boolean!
1122
- canSupply: Boolean!
1123
- canUseAsCollateral: Boolean!
1124
- userState: ReserveUserState
1125
- asset: HubAsset!
1126
- spoke: Spoke!
1127
- }
1128
-
1129
- input ReserveAmountInput @oneOf {
1130
- """The native amount"""
1131
- native: BigDecimal
1132
-
1133
- """The erc20 amount input"""
1134
- erc20: ReserveErc20AmountInput
1135
- }
1136
-
1137
- input ReserveAmountInputWithPermit @oneOf {
1138
- """The native amount"""
1139
- native: BigDecimal
1140
-
1141
- """The erc20 amount input"""
1142
- erc20: ReserveErc20AmountInputWithPermit
1143
- }
1144
-
1145
- input ReserveErc20AmountInput {
1146
- """
1147
- Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction (e.g., wei).
1148
- """
1149
- value: BigDecimal!
1150
- }
1151
-
1152
- input ReserveErc20AmountInputWithPermit {
1153
- """
1154
- Token value in its main unit (e.g., 1.5 DAI), not in the smallest fraction (e.g., wei).
1155
- """
1156
- value: BigDecimal!
1157
-
1158
- """
1159
- The signed ERC20 permit message to operate on the relevant token without a need for an ERC20 Approval transaction.
1160
- """
1161
- permitSig: ERC20PermitSignature
1162
- }
1163
-
1164
- scalar ReserveId
1165
-
1166
- type ReserveInfo {
1167
- id: ReserveId!
1168
- asset: HubAsset!
1169
- }
1170
-
1171
- input ReserveInput {
1172
- chainId: ChainId!
1173
- spoke: EvmAddress!
1174
- onChainId: OnChainReserveId!
1175
- }
1176
-
1177
- input ReserveRequest {
1178
- query: ReserveRequestQuery!
1179
-
1180
- """
1181
- The user who is doing the query (this injects user state into some of the return objects)
1182
- """
1183
- user: EvmAddress
1184
- }
1185
-
1186
- input ReserveRequestQuery @oneOf {
1187
- reserveId: ReserveId
1188
- reserveInput: ReserveInput
1189
- }
1190
-
1191
- type ReserveSettings {
1192
- collateralFactor: PercentNumber!
1193
- maxLiquidationBonus: PercentNumber!
1194
- liquidationFee: PercentNumber!
1195
- collateralRisk: PercentNumber!
1196
- borrowable: Boolean!
1197
- collateral: Boolean!
1198
- suppliable: Boolean!
1199
- latestDynamicConfigKey: DynamicConfigKey!
1200
- }
1201
-
1202
- type ReserveStatus {
1203
- frozen: Boolean!
1204
- paused: Boolean!
1205
- active: Boolean!
1206
- }
1207
-
1208
- type ReserveSummary {
1209
- supplied: Erc20Amount!
1210
- borrowed: Erc20Amount!
1211
- supplyApy: PercentNumber!
1212
- borrowApy: PercentNumber!
1213
- }
1214
-
1215
- type ReserveUserState {
1216
- balance: Erc20Amount!
1217
- suppliable: Erc20Amount!
1218
- borrowable: Erc20Amount!
1219
- borrowingPower: Erc20Amount!
1220
- borrowApy: PercentNumber!
1221
- collateralFactor: PercentNumber!
1222
- maxLiquidationBonus: PercentNumber!
1223
- liquidationFee: PercentNumber!
1224
- dynamicConfigKey: DynamicConfigKey!
1225
- isUsingLatestDynamicConfigKey: Boolean!
1226
- }
1227
-
1228
- input ReservesRequest {
1229
- """The reserve's request query"""
1230
- query: ReservesRequestQuery!
1231
-
1232
- """
1233
- The user who is doing the query (this injects user state into some of the return objects)
1234
- """
1235
- user: EvmAddress
1236
-
1237
- """The reserve's filter"""
1238
- filter: ReservesRequestFilter! = ALL
1239
-
1240
- """The reserve's order by"""
1241
- orderBy: ReservesRequestOrderBy! = {assetName: ASC}
1242
- }
1243
-
1244
- enum ReservesRequestFilter {
1245
- SUPPLY
1246
- BORROW
1247
- COLLATERAL
1248
- ALL
1249
- }
1250
-
1251
- input ReservesRequestOrderBy @oneOf {
1252
- assetName: OrderDirection
1253
- userBalance: OrderDirection
1254
- supplyApy: OrderDirection
1255
- supplyAvailable: OrderDirection
1256
- borrowApy: OrderDirection
1257
- borrowAvailable: OrderDirection
1258
- collateralFactor: OrderDirection
1259
- }
1260
-
1261
- input ReservesRequestQuery @oneOf {
1262
- """Get all the reserves for a spoke"""
1263
- spoke: SpokeInput
1264
-
1265
- """Get all the reserves for a spoke"""
1266
- spokeId: SpokeId
1267
-
1268
- """Get all the reserves with underlying tokens"""
1269
- tokens: [Erc20Input!]
1270
-
1271
- """Get all the reserves on a hub for an underlying"""
1272
- hubToken: HubTokenInput
1273
-
1274
- """Get all the reserves on a hub for an underlying by a hub id"""
1275
- hubIdToken: HubIdTokenInput
1276
-
1277
- """Get all the reserves on a list of chains"""
1278
- chainIds: [ChainId!]
1279
-
1280
- """Get all the reserves for a spoke for an underlying"""
1281
- spokeToken: SpokeTokenInput
1282
-
1283
- """Get all reserves on a hub"""
1284
- hub: HubInput
1285
-
1286
- """Get all reserves with a hub id"""
1287
- hubId: HubId
1288
-
1289
- """Get all the reserves on based on user position id"""
1290
- userPositionId: UserPositionId
1291
-
1292
- """Get all the reserves based on the token categories"""
1293
- chainTokenCategories: [ChainTokenCategories!]
1294
- }
1295
-
1296
- input SetSpokeUserPositionManagerRequest {
1297
- """The spoke id"""
1298
- spoke: SpokeId!
1299
-
1300
- """The address to become the position manager"""
1301
- manager: EvmAddress!
1302
-
1303
- """Approve or remove the manager"""
1304
- approve: Boolean!
1305
-
1306
- """The user to set the position \`manager\` for"""
1307
- user: EvmAddress!
1308
-
1309
- """The signature"""
1310
- signature: ERC20PermitSignature
1311
- }
1312
-
1313
- input SetUserSuppliesAsCollateralRequest {
1314
- """The collateral to make changes to"""
1315
- changes: [UserSupplyAsCollateral!]!
1316
-
1317
- """The user sending the transaction (normally the user's wallet address)"""
1318
- sender: EvmAddress!
1319
- }
1320
-
1321
- scalar Signature
1322
-
1323
- type Spoke {
1324
- """The id for the spoke"""
1325
- id: SpokeId!
1326
-
1327
- """The spoke name (offchain)"""
1328
- name: String!
1329
-
1330
- """The spoke address"""
1331
- address: EvmAddress!
1332
-
1333
- """The spoke chain"""
1334
- chain: Chain!
1335
- }
1336
-
1337
- scalar SpokeId
1338
-
1339
- input SpokeInput {
1340
- """The address of the spoke"""
1341
- address: EvmAddress!
1342
-
1343
- """The chain id the spoke is deployed to"""
1344
- chainId: ChainId!
1345
- }
1346
-
1347
- input SpokePositionManagersRequest {
1348
- spoke: SpokeId!
1349
- includeInactive: Boolean
1350
- pageSize: PageSize!
1351
- cursor: Cursor
1352
- }
1353
-
1354
- type SpokePositionManger {
1355
- name: String!
1356
- address: EvmAddress!
1357
- active: Boolean!
1358
- }
1359
-
1360
- input SpokeRequest {
1361
- """The spoke request query"""
1362
- query: SpokeRequestQuery!
1363
- }
1364
-
1365
- input SpokeRequestQuery @oneOf {
1366
- spoke: SpokeInput
1367
- spokeId: SpokeId
1368
- }
1369
-
1370
- input SpokeTokenInput {
1371
- """The spoke id"""
1372
- spoke: SpokeId!
1373
-
1374
- """The token"""
1375
- token: EvmAddress!
1376
- }
1377
-
1378
- type SpokeUserPositionManager {
1379
- name: String!
1380
- address: EvmAddress!
1381
- approvedOn: DateTime!
1382
- active: Boolean!
1383
- }
1384
-
1385
- input SpokeUserPositionManagersRequest {
1386
- spoke: SpokeId!
1387
- user: EvmAddress!
1388
- pageSize: PageSize!
1389
- cursor: Cursor
1390
- }
1391
-
1392
- input SpokesRequest {
1393
- query: SpokesRequestQuery!
1394
- }
1395
-
1396
- input SpokesRequestQuery @oneOf {
1397
- """
1398
- The hub id
1399
- Get all the spokes which hubs are linked to a spoke reserve
1400
- """
1401
- hubId: HubId
1402
-
1403
- """
1404
- The hub address and chain id
1405
- Get all the spokes which hubs are linked to a spoke reserve
1406
- """
1407
- hub: HubInput
1408
-
1409
- """
1410
- The chain ids
1411
- Get all the spokes which are on the list of chain ids
1412
- """
1413
- chainIds: [ChainId!]
1414
- }
1415
-
1416
- type SupplyActivity {
1417
- id: ID!
1418
- user: EvmAddress!
1419
- timestamp: DateTime!
1420
- txHash: TxHash!
1421
- spoke: Spoke!
1422
- reserve: ReserveInfo!
1423
- supplied: Erc20Amount!
1424
- chain: Chain!
1425
- }
1426
-
1427
- input SupplyApyHistoryRequest {
1428
- reserve: ReserveId!
1429
- window: TimeWindow! = LAST_DAY
1430
- }
1431
-
1432
- input SupplyPermitRequest {
1433
- """The reserve id"""
1434
- reserve: ReserveId!
1435
-
1436
- """The amount supplying"""
1437
- amount: ReserveErc20AmountInput!
1438
-
1439
- """If you wish to enable collateral with it meaning you can borrow"""
1440
- enableCollateral: Boolean! = true
1441
-
1442
- """The user sending the transaction (normally the user's wallet address)"""
1443
- sender: EvmAddress!
1444
- }
1445
-
1446
- input SupplyRequest {
1447
- """The reserve id"""
1448
- reserve: ReserveId!
1449
-
1450
- """The amount supplying"""
1451
- amount: ReserveAmountInputWithPermit!
1452
-
1453
- """If you wish to enable collateral with it meaning you can borrow"""
1454
- enableCollateral: Boolean! = true
1455
-
1456
- """The user sending the transaction (normally the user's wallet address)"""
1457
- sender: EvmAddress!
1458
- }
1459
-
1460
- type SwapApprovalRequired {
1461
- approval: TransactionRequest!
1462
- originalTransaction: SwapTransactionRequest!
1463
- }
1464
-
1465
- type SwapByIntent {
1466
- quote: SwapQuote!
1467
- data: SwapByIntentTypedData!
1468
- }
1469
-
1470
- input SwapByIntentInput {
1471
- quoteId: SwapQuoteId!
1472
- signature: Signature!
1473
- }
1474
-
1475
- type SwapByIntentTypeDefinition {
1476
- EIP712Domain: [TypeField!]!
1477
- Order: [TypeField!]!
1478
- }
1479
-
1480
- type SwapByIntentTypedData {
1481
- types: SwapByIntentTypeDefinition!
1482
- primaryType: String!
1483
- domain: DomainData!
1484
- message: JSON!
1485
- }
1486
-
1487
- type SwapByIntentWithApprovalRequired {
1488
- quote: SwapQuote!
1489
- approval: TransactionRequest!
1490
- data: SwapByIntentTypedData!
1491
- }
1492
-
1493
- type SwapByTransaction {
1494
- quote: SwapQuote!
1495
- }
1496
-
1497
- type SwapCancelled {
1498
- createdAt: DateTime!
1499
- cancelledAt: DateTime
1500
- explorerLink: String!
1501
- }
1502
-
1503
- union SwapExecutionPlan = SwapTransactionRequest | SwapApprovalRequired | InsufficientBalanceError | SwapReceipt
1504
-
1505
- type SwapExpired {
1506
- createdAt: DateTime!
1507
- expiredAt: DateTime!
1508
- explorerLink: String!
1509
- }
1510
-
1511
- type SwapFulfilled {
1512
- txHash: String!
1513
- desiredSell: TokenAmount!
1514
- desiredBuy: TokenAmount!
1515
- sold: TokenAmount!
1516
- bought: TokenAmount!
1517
- createdAt: DateTime!
1518
- fulfilledAt: DateTime!
1519
- explorerLink: String!
1520
- refundTxHash: TxHash
1521
- }
1522
-
1523
- scalar SwapId
1524
-
1525
- enum SwapKind {
1526
- BUY
1527
- SELL
1528
- }
1529
-
1530
- type SwapOpen {
1531
- swapId: SwapId!
1532
- createdAt: DateTime!
1533
- deadline: DateTime!
1534
- explorerLink: String!
1535
- desiredSell: TokenAmount!
1536
- desiredBuy: TokenAmount!
1537
- }
1538
-
1539
- type SwapPendingSignature {
1540
- createdAt: DateTime!
1541
- deadline: DateTime!
1542
- explorerLink: String!
1543
- }
1544
-
1545
- type SwapQuote {
1546
- quoteId: SwapQuoteId!
1547
- suggestedSlippage: PercentNumber!
1548
- desiredSell: TokenAmount!
1549
- desiredBuy: TokenAmount!
1550
- costs: SwapQuoteCosts!
1551
-
1552
- """Minimum received amount after all costs and slippage"""
1553
- minimumReceived: TokenAmount!
1554
- }
1555
-
1556
- type SwapQuoteCosts {
1557
- """Network and provider costs"""
1558
- networkCosts: TokenAmount!
1559
-
1560
- """Aave partner fee amount"""
1561
- partnerFee: TokenAmount!
1562
- }
1563
-
1564
- scalar SwapQuoteId
1565
-
1566
- input SwapQuoteRequest {
1567
- chainId: ChainId!
1568
- buy: TokenInput!
1569
- sell: TokenInput!
1570
- amount: BigDecimal!
1571
- kind: SwapKind
1572
- from: EvmAddress!
1573
- receiver: EvmAddress
1574
- }
1575
-
1576
- type SwapReceipt {
1577
- id: SwapId!
1578
- createdAt: DateTime!
1579
- explorerLink: String!
1580
- }
1581
-
1582
- input SwapRequest @oneOf {
1583
- intent: SwapByIntentInput
1584
- transaction: SwapWithTransactionInput
1585
- }
1586
-
1587
- union SwapStatus = SwapOpen | SwapPendingSignature | SwapCancelled | SwapExpired | SwapFulfilled
1588
-
1589
- enum SwapStatusFilter {
1590
- CANCELLED
1591
- EXPIRED
1592
- FULFILLED
1593
- OPEN
1594
- PENDING_SIGNATURE
1595
- }
1596
-
1597
- input SwapStatusRequest {
1598
- id: SwapId!
1599
- }
1600
-
1601
- type SwapTransactionRequest {
1602
- transaction: TransactionRequest!
1603
- orderReceipt: SwapReceipt!
1604
- }
1605
-
1606
- input SwapWithTransactionInput {
1607
- quoteId: SwapQuoteId!
1608
- permitSig: Signature
1609
-
1610
- """
1611
- Whether the swap order creator is a smart contract wallet. If not provided, it will be inferred following the ERC-1271 standard.
1612
- """
1613
- isSenderSmartContractWallet: Boolean
1614
- }
1615
-
1616
- input SwappableTokenInput @oneOf {
1617
- native: ChainId
1618
- erc20: Erc20Input
1619
- }
1620
-
1621
- input SwappableTokensRequest {
1622
- query: SwappableTokensRequestQuery
1623
- }
1624
-
1625
- input SwappableTokensRequestQuery @oneOf {
1626
- chainIds: [ChainId!]
1627
- from: SwappableTokenInput
1628
- to: SwappableTokenInput
1629
- }
1630
-
1631
- enum TimeWindow {
1632
- LAST_DAY
1633
- LAST_WEEK
1634
- LAST_MONTH
1635
- LAST_SIX_MONTHS
1636
- LAST_YEAR
1637
- ALL
1638
- }
1639
-
1640
- union Token = NativeToken | Erc20Token
1641
-
1642
- union TokenAmount = NativeAmount | Erc20Amount
1643
-
1644
- enum TokenCategory {
1645
- STABLECOIN
1646
- ETH_CORRELATED
1647
- }
1648
-
1649
- type TokenInfo {
1650
- """The token info id"""
1651
- id: TokenInfoId!
1652
-
1653
- """The token name"""
1654
- name: String!
1655
-
1656
- """The token symbol"""
1657
- symbol: String!
1658
-
1659
- """The token icon"""
1660
- icon: String!
1661
-
1662
- """The token decimals"""
1663
- decimals: Int!
1664
-
1665
- """The token category,"""
1666
- categories: [TokenCategory!]!
1667
- }
1668
-
1669
- scalar TokenInfoId
1670
-
1671
- input TokenInput @oneOf {
1672
- """Native token"""
1673
- native: AlwaysTrue
1674
-
1675
- """The erc20 address"""
1676
- erc20: EvmAddress
1677
- }
1678
-
1679
- type TransactionRequest {
1680
- to: EvmAddress!
1681
- from: EvmAddress!
1682
- data: BlockchainData!
1683
- value: BigInt!
1684
- chainId: ChainId!
1685
- operations: [OperationType!]
1686
- }
1687
-
1688
- scalar TxHash
1689
-
1690
- input TxHashInput {
1691
- txHash: TxHash!
1692
- chainId: ChainId!
1693
- }
1694
-
1695
- type TypeDefinition {
1696
- EIP712Domain: [TypeField!]!
1697
- Permit: [TypeField!]!
1698
- }
1699
-
1700
- type TypeField {
1701
- name: String!
1702
- type: String!
1703
- }
1704
-
1705
- input UpdateUserPositionConditionsRequest {
1706
- userPositionId: UserPositionId!
1707
- dynamicConfig: Boolean!
1708
- riskPremium: Boolean!
1709
- }
1710
-
1711
- type UpdatedDynamicConfigActivity {
1712
- id: ID!
1713
- user: EvmAddress!
1714
- timestamp: DateTime!
1715
- txHash: TxHash!
1716
- spoke: Spoke!
1717
- reserve: ReserveInfo!
1718
- collateralFactor: PercentNumberChangeSnapshot!
1719
- maxLiquidationBonus: PercentNumberChangeSnapshot!
1720
- liquidationFee: PercentNumberChangeSnapshot!
1721
- chain: Chain!
1722
- }
1723
-
1724
- type UpdatedRiskPremiumActivity {
1725
- id: ID!
1726
- user: EvmAddress!
1727
- timestamp: DateTime!
1728
- txHash: TxHash!
1729
- spoke: Spoke!
1730
- premium: PercentNumberChangeSnapshot!
1731
- chain: Chain!
1732
- }
1733
-
1734
- type UserBalance {
1735
- """The user balance id"""
1736
- id: UserBalanceId!
1737
-
1738
- """The token info"""
1739
- info: TokenInfo!
1740
-
1741
- """The balances across chains it will be 1 item per chain"""
1742
- balances: [TokenAmount!]!
1743
-
1744
- """The total amount summed across all balances"""
1745
- totalAmount: DecimalNumber!
1746
-
1747
- """The total exchange amount summed across all balances"""
1748
- exchange(currency: Currency! = USD): ExchangeAmount!
1749
-
1750
- """The supply apy dependent on what you pass in for the \`metric\`"""
1751
- supplyApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1752
-
1753
- """The borrow APY dependent on what you pass in for the \`metric\`"""
1754
- borrowApy(metric: ApyMetric! = HIGHEST): PercentNumber!
1755
-
1756
- """The collateral factor dependent on what you pass in for the \`metric\`"""
1757
- collateralFactor(metric: CollateralMetric! = HIGHEST): PercentNumber
1758
- }
1759
-
1760
- scalar UserBalanceId
1761
-
1762
- input UserBalancesByChains {
1763
- """List of chains"""
1764
- chainIds: [ChainId!]!
1765
-
1766
- """
1767
- The type of reserve to use when determine the tokens to retrieve balances for
1768
- """
1769
- byReservesType: ReservesRequestFilter! = ALL
1770
- }
1771
-
1772
- input UserBalancesByHub {
1773
- """The hub address"""
1774
- address: EvmAddress!
1775
-
1776
- """The hub chain id"""
1777
- chainId: ChainId!
1778
-
1779
- """
1780
- The type of reserve to use when determine the tokens to retrieve balances for
1781
- """
1782
- byReservesType: ReservesRequestFilter! = ALL
1783
- }
1784
-
1785
- input UserBalancesByHubId {
1786
- """The hub id"""
1787
- hubId: HubId!
1788
-
1789
- """
1790
- The type of reserve to use when determine the tokens to retrieve balances for
1791
- """
1792
- byReservesType: ReservesRequestFilter! = ALL
1793
- }
1794
-
1795
- input UserBalancesBySpoke {
1796
- """The spoke address"""
1797
- address: EvmAddress!
1798
-
1799
- """The chain id the spoke is deployed to"""
1800
- chainId: ChainId!
1801
-
1802
- """
1803
- The type of reserve to use when determine the tokens to retrieve balances for
1804
- """
1805
- byReservesType: ReservesRequestFilter! = ALL
1806
- }
1807
-
1808
- input UserBalancesByTokens {
1809
- """The chain token input"""
1810
- chainTokens: [ChainTokenInput!]!
1811
-
1812
- """
1813
- The type of reserve to use when determine the tokens to retrieve balances for
1814
- """
1815
- byReservesType: ReservesRequestFilter! = ALL
1816
- }
1817
-
1818
- input UserBalancesByUserPosition {
1819
- """The user position id"""
1820
- userPositionId: UserPositionId!
1821
-
1822
- """
1823
- The type of reserve to use when determine the tokens to retrieve balances for
1824
- """
1825
- byReservesType: ReservesRequestFilter! = ALL
1826
- }
1827
-
1828
- input UserBalancesRequest {
1829
- """The user to get the balance for"""
1830
- user: EvmAddress!
1831
-
1832
- """The order by clause - defaults to the highest USD value"""
1833
- orderBy: UserBalancesRequestOrderBy! = {balance: DESC}
1834
-
1835
- """The user balance filter"""
1836
- filter: UserBalancesRequestFilter!
1837
-
1838
- """If you want to include 0 balances in the return list"""
1839
- includeZeroBalances: Boolean! = false
1840
- }
1841
-
1842
- input UserBalancesRequestFilter @oneOf {
1843
- """The balances for the tokens on the specified chains"""
1844
- chains: UserBalancesByChains
1845
-
1846
- """The balances for the tokens of hub assets on a given hub"""
1847
- hub: UserBalancesByHub
1848
-
1849
- """The balances for the tokens of the hub assets on a given hub id"""
1850
- hubId: UserBalancesByHubId
1851
-
1852
- """The balances for the tokens of reserves attached to a spoke"""
1853
- spoke: UserBalancesBySpoke
1854
-
1855
- """The balances for the swappable tokens"""
1856
- swappable: SwappableTokensRequestQuery
1857
-
1858
- """
1859
- The balances for the tokens of the spoke associated with the given user position
1860
- """
1861
- userPosition: UserBalancesByUserPosition
1862
-
1863
- """The balances for the chains tokens"""
1864
- tokens: UserBalancesByTokens
1865
- }
1866
-
1867
- input UserBalancesRequestOrderBy @oneOf {
1868
- """The name of the token"""
1869
- name: OrderDirection
1870
-
1871
- """The balance of the token"""
1872
- balance: OrderDirection
1873
- }
1874
-
1875
- type UserBorrowItem {
1876
- """The user borrow item id"""
1877
- id: UserBorrowItemId!
1878
-
1879
- """The reserve borrowed from"""
1880
- reserve: Reserve!
1881
-
1882
- """The amount borrowed on this reserve"""
1883
- principal: Erc20Amount!
1884
-
1885
- """The overall debt including accrued interests"""
1886
- debt: Erc20Amount!
1887
-
1888
- """The interest incurred on the loan"""
1889
- interest: Erc20Amount!
1890
-
1891
- """
1892
- When the borrow was created.
1893
- This is null if they have no supply item, for
1894
- example, when using include_zero_balances this comes
1895
- back as principal and debt as 0
1896
- """
1897
- createdAt: DateTime
1898
- }
1899
-
1900
- scalar UserBorrowItemId
1901
-
1902
- input UserBorrowsRequest {
1903
- query: UserBorrowsRequestQuery!
1904
- orderBy: UserBorrowsRequestOrderBy! = {amount: DESC}
1905
-
1906
- """If you wish to include zero balances in the results"""
1907
- includeZeroBalances: Boolean! = false
1908
- }
1909
-
1910
- input UserBorrowsRequestOrderBy @oneOf {
1911
- assetName: OrderDirection
1912
- created: OrderDirection
1913
- amount: OrderDirection
1914
- apy: OrderDirection
1915
- }
1916
-
1917
- input UserBorrowsRequestQuery @oneOf {
1918
- userSpoke: UserSpokeInput
1919
- userToken: UserToken
1920
- userPositionId: UserPositionId
1921
- userChains: UserChains
1922
- userHub: UserHub
1923
- }
1924
-
1925
- input UserChains {
1926
- user: EvmAddress!
1927
- chainIds: [ChainId!]!
1928
- }
1929
-
1930
- input UserHub {
1931
- """The user address"""
1932
- user: EvmAddress!
1933
-
1934
- """The user hub input"""
1935
- hub: UserHubInput!
1936
- }
1937
-
1938
- input UserHubInput @oneOf {
1939
- input: HubInput
1940
- id: HubId
1941
- }
1942
-
1943
- type UserPosition {
1944
- """The user position ID"""
1945
- id: UserPositionId!
1946
-
1947
- """The user holding this position"""
1948
- user: EvmAddress!
1949
- createdAt: DateTime!
1950
- totalSupplied(currency: Currency! = USD): ExchangeAmountWithChange!
1951
-
1952
- """
1953
- Total collateral which is the full some of the assets supplied which are enabled as collateral
1954
- """
1955
- totalCollateral(currency: Currency! = USD): ExchangeAmountWithChange!
1956
-
1957
- """Total debt which is the total amount borrowed plus the accrued premium"""
1958
- totalDebt(currency: Currency! = USD): ExchangeAmountWithChange!
1959
-
1960
- """The net balance which is \`total_supplied\` - \`borrows\`"""
1961
- netBalance(currency: Currency! = USD): ExchangeAmountWithChange!
1962
-
1963
- """The net collateral which is \`totalCollateral\` - \`totalDebt\`"""
1964
- netCollateral(currency: Currency! = USD): ExchangeAmountWithChange!
1965
- netApy: PercentNumber!
1966
- netSupplyApy: PercentNumberWithChange!
1967
- netBorrowApy: PercentNumberWithChange!
1968
- healthFactor: HealthFactorWithChange!
1969
- riskPremium: UserPositionRiskPremium
1970
- liquidationPrice(currency: Currency! = USD): ExchangeAmount
1971
- borrowingPower(currency: Currency! = USD): ExchangeAmount!
1972
- isUsingLatestDynamicConfigKey: Boolean!
1973
- netBalancePercentChange(window: TimeWindow! = LAST_DAY): PercentNumber!
1974
- spoke: Spoke!
1975
- averageCollateralFactor: PercentNumber!
1976
- }
1977
-
1978
- union UserPositionConditionVariation = CollateralFactorVariation | LiquidationFeeVariation | MaxLiquidationBonusVariation
1979
-
1980
- scalar UserPositionId
1981
-
1982
- input UserPositionRequest @oneOf {
1983
- userSpoke: UserSpokeInput
1984
- id: UserPositionId
1985
- }
1986
-
1987
- type UserPositionRiskPremium {
1988
- current: PercentNumber!
1989
- better: PercentNumber
1990
- breakdown: [UserRiskPremiumBreakdownItem!]!
1991
- }
1992
-
1993
- input UserPositionsRequest {
1994
- """The user to get the positions for"""
1995
- user: EvmAddress!
1996
-
1997
- """The filter for the user position"""
1998
- filter: UserPositionsRequestFilter!
1999
-
2000
- """The ordering for the positions"""
2001
- orderBy: UserPositionsRequestOrderBy! = {created: ASC}
2002
- }
2003
-
2004
- input UserPositionsRequestFilter @oneOf {
2005
- tokens: [Erc20Input!]
2006
- chainIds: [ChainId!]
2007
- }
2008
-
2009
- input UserPositionsRequestOrderBy @oneOf {
2010
- created: OrderDirection
2011
- balance: OrderDirection
2012
- netApy: OrderDirection
2013
- healthFactor: OrderDirection
2014
- netCollateral: OrderDirection
2015
- }
2016
-
2017
- type UserRiskPremiumBreakdownItem {
2018
- token: Erc20Token!
2019
- riskPremiumWeight: PercentNumber!
2020
- collateral: PercentNumber!
2021
- }
2022
-
2023
- input UserRiskPremiumBreakdownRequest {
2024
- query: UserRiskPremiumBreakdownRequestQuery!
2025
- user: EvmAddress!
2026
- }
2027
-
2028
- input UserRiskPremiumBreakdownRequestQuery @oneOf {
2029
- userSpoke: UserSpokeInput
2030
- userPositionId: UserPositionId
2031
- }
2032
-
2033
- input UserSpokeInput {
2034
- spoke: SpokeId!
2035
- user: EvmAddress!
2036
- }
2037
-
2038
- type UserSummary {
2039
- totalPositions: Int!
2040
-
2041
- """Net balance = supply - debt"""
2042
- netBalance(currency: Currency! = USD): ExchangeAmountWithChange!
2043
-
2044
- """Total supply where is_collateral is true"""
2045
- totalCollateral(currency: Currency! = USD): ExchangeAmount!
2046
-
2047
- """Total supplied across all positions"""
2048
- totalSupplied(currency: Currency! = USD): ExchangeAmount!
2049
-
2050
- """Total debt across all positions"""
2051
- totalDebt(currency: Currency! = USD): ExchangeAmount!
2052
-
2053
- """
2054
- Net APY = (\u03A3 (supplied_amount_i * supply_apy_i) - \u03A3 (borrowed_amount_j * borrow_apy_j)) / (\u03A3 supplied_amount_i)
2055
- """
2056
- netApy: PercentNumber!
2057
-
2058
- """Interest earned (net fee earned)"""
2059
- netFeeEarned: ExchangeAmount!
2060
-
2061
- """Lowest health factor across all positions"""
2062
- lowestHealthFactor: BigDecimal
2063
- }
2064
-
2065
- input UserSummaryFilter @oneOf {
2066
- spoke: SpokeInput
2067
- spokeId: SpokeId
2068
- chainIds: [ChainId!]
2069
- userPositionId: UserPositionId
2070
- }
2071
-
2072
- type UserSummaryHistoryItem {
2073
- healthFactor: BigDecimal
2074
- date: DateTime!
2075
-
2076
- """The aggregated net balance for the time period"""
2077
- netBalance(currency: Currency! = USD): ExchangeAmount!
2078
-
2079
- """The aggregated borrows for the time period"""
2080
- borrows(currency: Currency! = USD): ExchangeAmount!
2081
-
2082
- """The aggregated supplies for the time period"""
2083
- supplies(currency: Currency! = USD): ExchangeAmount!
2084
- }
2085
-
2086
- input UserSummaryHistoryRequest {
2087
- user: EvmAddress!
2088
- filter: UserSummaryFilter
2089
- window: TimeWindow! = LAST_DAY
2090
- }
2091
-
2092
- input UserSummaryRequest {
2093
- user: EvmAddress!
2094
- filter: UserSummaryFilter
2095
- }
2096
-
2097
- input UserSuppliesRequest {
2098
- query: UserSuppliesRequestQuery!
2099
- orderBy: UserSuppliesRequestOrderBy! = {amount: DESC}
2100
-
2101
- """If you wish to include zero balances in the results"""
2102
- includeZeroBalances: Boolean! = false
2103
- }
2104
-
2105
- input UserSuppliesRequestOrderBy @oneOf {
2106
- assetName: OrderDirection
2107
- created: OrderDirection
2108
- amount: OrderDirection
2109
- apy: OrderDirection
2110
- }
2111
-
2112
- input UserSuppliesRequestQuery @oneOf {
2113
- userSpoke: UserSpokeInput
2114
- userToken: UserToken
2115
- userPositionId: UserPositionId
2116
- userChains: UserChains
2117
- userHub: UserHub
2118
- }
2119
-
2120
- input UserSupplyAsCollateral {
2121
- """The reserve id"""
2122
- reserve: ReserveId!
2123
-
2124
- """If you want to enable the collateral or disable"""
2125
- enableCollateral: Boolean!
2126
- }
2127
-
2128
- type UserSupplyItem {
2129
- """The user supply item id"""
2130
- id: UserSupplyItemId!
2131
-
2132
- """The reserve supplied to"""
2133
- reserve: Reserve!
2134
-
2135
- """The amount supplied to this reserve"""
2136
- principal: Erc20Amount!
2137
-
2138
- """The overall amount you can withdraw, including accrued interests"""
2139
- withdrawable: Erc20Amount!
2140
-
2141
- """The interest amount earned on supplying"""
2142
- interest: Erc20Amount!
2143
-
2144
- """If this supply is used as collateral"""
2145
- isCollateral: Boolean!
2146
-
2147
- """
2148
- When the supply was created.
2149
- This is null if they have no supply item, for
2150
- example, when using include_zero_balances this comes
2151
- back as principal and withdrawable as 0
2152
- """
2153
- createdAt: DateTime
2154
- }
2155
-
2156
- scalar UserSupplyItemId
2157
-
2158
- input UserSwapsRequest {
2159
- chainId: ChainId!
2160
- user: EvmAddress!
2161
- filterBy: [SwapStatusFilter!]
2162
- pageSize: PageSize! = FIFTY
2163
- cursor: Cursor
2164
- }
2165
-
2166
- input UserToken {
2167
- user: EvmAddress!
2168
- token: Erc20Input!
2169
- }
2170
-
2171
- type UsingAsCollateralActivity {
2172
- id: ID!
2173
- user: EvmAddress!
2174
- timestamp: DateTime!
2175
- txHash: TxHash!
2176
- spoke: Spoke!
2177
- reserve: ReserveInfo!
2178
- enabledAsCollateral: Boolean!
2179
- chain: Chain!
2180
- }
2181
-
2182
- type WithdrawActivity {
2183
- id: ID!
2184
- user: EvmAddress!
2185
- timestamp: DateTime!
2186
- txHash: TxHash!
2187
- spoke: Spoke!
2188
- reserve: ReserveInfo!
2189
- withdrawn: Erc20Amount!
2190
- chain: Chain!
2191
- }
2192
-
2193
- input WithdrawRequest {
2194
- """The reserve id"""
2195
- reserve: ReserveId!
2196
-
2197
- """The amount withdrawing"""
2198
- amount: WithdrawReserveAmountInput!
2199
-
2200
- """The user sending the transaction (normally the user's wallet address)"""
2201
- sender: EvmAddress!
2202
- }
2203
-
2204
- input WithdrawReserveAmountInput @oneOf {
2205
- """The native amount"""
2206
- native: AmountInput
2207
-
2208
- """The erc20 amount input"""
2209
- erc20: AmountInput
2210
- }`;var i=graphql.buildSchema(e);exports.schema=i;//# sourceMappingURL=test-utils.cjs.map
2211
- //# sourceMappingURL=test-utils.cjs.map