-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
1104 lines (829 loc) · 23.1 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
enum LtvStatus {
Healthy
Moderate
Risky
Unhealthy
}
"""
Vault allocator
"""
type Allocator @entity {
"<Vault ID>-<Allocator address>"
id: ID!
"The allocator's address"
address: Bytes!
"The allocator's shares amount"
shares: BigInt!
"The allocator's assets amount"
assets: BigInt!
"The allocator's minted OsToken shares amount"
mintedOsTokenShares: BigInt!
"The allocator's LTV percent. Will be null if there are no OsTokens minted"
ltv: BigDecimal!
"The allocator's LTV descriptive status"
ltvStatus: LtvStatus!
"The allocator's average weekly APY"
apy: BigDecimal!
"The vault of the allocator"
vault: Vault!
"The exit requests of the allocator"
exitRequests: [ExitRequest!]! @derivedFrom(field: "allocator")
"The period earned assets"
_periodEarnedAssets: BigInt!
}
"""
Token transfer
"""
type TokenTransfer @entity(immutable: true) {
"The transfer hash"
id: ID!
"The transfer amount"
amount: BigInt!
"The transfer token symbol"
tokenSymbol: String!
"The transfer sender"
from: Bytes!
"The transfer receiver"
to: Bytes!
"The transfer timestamp"
timestamp: BigInt!
}
"""
OsToken holder
"""
type OsTokenHolder @entity {
"<OsToken holder address>"
id: ID!
"The OsToken holder balance (shares)"
balance: BigInt!
"The OsToken holder assets"
assets: BigInt!
"The OsToken instance"
osToken: OsToken!
"The osToken holder's average weekly APY"
apy: BigDecimal!
"The total number of OsToken transfers"
transfersCount: BigInt!
"The period earned assets"
_periodEarnedAssets: BigInt!
}
"""
SwiseToken holder
"""
type SwiseTokenHolder @entity {
"<SwiseToken holder address>"
id: ID!
"The SwiseToken holder balance"
balance: BigInt!
"The total number of SwiseToken transfers"
transfersCount: BigInt!
}
"""
Vault exit request
"""
type ExitRequest @entity {
"<Vault ID>-<Exit queue id>"
id: ID!
"The exit queue position ticket"
positionTicket: BigInt!
"Defines whether the exit request is V2"
isV2Position: Boolean!
"The address that has created exit position"
owner: Bytes!
"The address that will receive exited assets"
receiver: Bytes!
"The allocator of the vault that created the exit request"
allocator: Allocator!
"The total number of tickets in the exit queue"
totalTickets: BigInt!
"The total number of assets queued for exit"
totalAssets: BigInt!
"The total number of assets that has exited"
exitedAssets: BigInt!
"The exit queue index that must be used to claim the exit. Will be null if the exit is not claimable"
exitQueueIndex: BigInt
"The timestamp when the exit request was created"
timestamp: BigInt!
"The exit request vault"
vault: Vault!
"The estimated withdrawal timestamp. Updated by the backend service."
withdrawalTimestamp: BigInt
"Defines whether the exit request is claimable"
isClaimable: Boolean!
"Defines whether the exit request is claimed"
isClaimed: Boolean!
}
"""
Vault
"""
type Vault @entity {
"Vault address"
id: ID!
"The vault token name. Can be null if vault does not have a token."
tokenName: String
"The vault token symbol Can be null if vault does not have a token."
tokenSymbol: String
"The optional vault name extracted from metadata IPFS file"
displayName: String
"The optional description extracted from metadata IPFS file"
description: String
"The optional image URL extracted from metadata IPFS file"
imageUrl: String
"The address of the factory used to create vault"
factory: Bytes!
"The address of the vault admin"
admin: Bytes!
"The max total assets that can be allocated into the vault"
capacity: BigInt!
"The staking fee percent charged by the vault"
feePercent: Int!
"The address of the vault's fee recipient"
feeRecipient: Bytes!
"The address of the vault's validators manager"
validatorsManager: Bytes
"The address of the vault's deposit data manager. If it's null, then the vault uses own validators manager."
depositDataManager: Bytes!
"The MEV and priority fees escrow address. If it's null, then the vault uses shared MEV escrow."
mevEscrow: Bytes
"The vault deposit data merkle tree root"
depositDataRoot: Bytes
"The vault metadata IPFS hash"
metadataIpfsHash: String
"The vault rewards root"
rewardsRoot: Bytes
"The last vault rewards update timestamp"
rewardsTimestamp: BigInt
"The vault rewards IPFS hash"
rewardsIpfsHash: String
"The vault reward used to submit state update proof"
proofReward: BigInt
"The vault unlocked MEV reward used to submit state update proof"
proofUnlockedMevReward: BigInt
"The vault rewards root proof used to submit state update proof"
proof: [String!]
"The vault allocators"
allocators: [Allocator!]! @derivedFrom(field: "vault")
"The vault consensus reward"
consensusReward: BigInt!
"The vault execution reward that is locked in the smoothing pool"
lockedExecutionReward: BigInt!
"The vault execution reward"
unlockedExecutionReward: BigInt!
"The vault slashed MEV reward in the smoothing pool"
slashedMevReward: BigInt!
"Defines whether the vault can harvest new rewards"
canHarvest: Boolean!
"The vault allocators' actions"
allocatorActions: [AllocatorAction!]! @derivedFrom(field: "vault")
"The vault exit requests"
exitRequests: [ExitRequest!]! @derivedFrom(field: "vault")
"The vault reward splitters"
rewardSplitters: [RewardSplitter!]! @derivedFrom(field: "vault")
"The vault leverage strategy positions"
leveragePositions: [LeverageStrategyPosition!]! @derivedFrom(field: "vault")
"The vault OsToken exit request positions"
osTokenExitRequests: [OsTokenExitRequest!]! @derivedFrom(field: "vault")
"The total number of shares"
totalShares: BigInt!
"The total number of queued shares"
queuedShares: BigInt!
"The vault score. Managed by the backend service."
score: BigDecimal!
"The total number of assets"
totalAssets: BigInt!
"The current exchange rate for 10^18 amount"
rate: BigInt!
"The total number of assets that are exiting (in V2 vaults)"
exitingAssets: BigInt!
"The total number of tickets that are exiting (in V2 vaults)"
exitingTickets: BigInt!
"Indicates whether the Vault is private"
isPrivate: Boolean!
"Indicates whether the Vault is with blocklist"
isBlocklist: Boolean!
"Indicates whether the Vault has ERC-20 token"
isErc20: Boolean!
"Indicates whether the Vault supports minting OsToken"
isOsTokenEnabled: Boolean!
"Indicates whether the Vault has registered validators"
isCollateralized: Boolean!
"If the Vault is private, whitelister can add/remove allocators"
whitelister: Bytes
"If the Vault is with blocklist, blocklist manager can block allocators from depositing"
blocklistManager: Bytes
"Vault address string for search"
addressString: String!
"The timestamp the metadata was updated at"
metadataUpdatedAt: BigInt
"The timestamp the vault was created at"
createdAt: BigInt!
"The timestamp the vault last time swapped xDAI to GNO on gnosis"
lastXdaiSwappedTimestamp: BigInt!
"The vault version"
version: BigInt!
"The vault osTokenConfig"
osTokenConfig: OsTokenConfig!
"Whether the vault is a genesis vault (v2 pool migration)"
isGenesis: Boolean!
"The vault average weekly total APY"
apy: BigDecimal!
"The list of vault APY snapshot"
apys: [BigDecimal!]!
"The average weekly max boost APY earned in this vault by the allocator"
allocatorMaxBoostApy: BigDecimal!
"The average weekly max boost APY earned in this vault by the osToken holder"
osTokenHolderMaxBoostApy: BigDecimal!
"The total number of vault blocklisted accounts"
blocklistCount: BigInt!
"The total number of vault whitelisted accounts"
whitelistCount: BigInt!
"The total amount of the accumulated unclaimed fee recipient shares"
_unclaimedFeeRecipientShares: BigInt!
}
"""
Own MEV escrow
"""
type OwnMevEscrow @entity {
"The address of the Own MEV escrow"
id: ID!
"The total amount of harvested assets"
totalHarvestedAssets: BigInt!
"The last checkpointed assets for period rewards calculation"
lastCheckpointAssets: BigInt!
}
enum AllocatorActionType {
VaultCreated
Deposited
Migrated
Redeemed
TransferIn
TransferOut
ExitQueueEntered
ExitedAssetsClaimed
OsTokenMinted
OsTokenBurned
OsTokenLiquidated
OsTokenRedeemed
BoostDeposited
BoostExitQueueEntered
BoostExitedAssetsClaimed
}
"""
Allocator action
"""
type AllocatorAction @entity(immutable: true) {
"Set to `transaction hash-log index`"
id: ID!
"The allocator's vault"
vault: Vault!
"The allocator's address"
address: Bytes!
"The type of the action"
actionType: AllocatorActionType!
"The amount of action's assets"
assets: BigInt
"The amount of action's shares"
shares: BigInt
"The timestamp the action was created at"
createdAt: BigInt!
}
"""
OsToken data
"""
type OsToken @entity {
"Set to 1"
id: ID!
"The OsToken average weekly APY"
apy: BigDecimal!
"The list of OsToken APY snapshot"
apys: [BigDecimal!]!
"The OsToken fee percent"
feePercent: Int!
"The OsToken total supply"
totalSupply: BigInt!
"The OsToken total assets"
totalAssets: BigInt!
"The OsToken holders"
holders: [OsTokenHolder!]! @derivedFrom(field: "osToken")
"The period earned assets"
_periodEarnedAssets: BigInt!
}
"""
Network data
"""
type Network @entity {
"Always 0"
id: ID!
"Defines whether the factories are initialized"
factoriesInitialized: Boolean!
"The total assets locked in the network"
totalAssets: BigInt!
"The total assets earned in the network"
totalEarnedAssets: BigInt!
"Total number of vaults"
vaultsCount: Int!
"The non repeated addresses of all the vaults"
vaultIds: [String!]!
"The non repeated addresses of all the vaults used for osToken rate calculation"
osTokenVaultIds: [String!]!
"Oracles config ipfs hash"
oraclesConfigIpfsHash: String!
"The total number of non repeated vault allocators and osToken holders"
usersCount: Int!
"The timestamp of the last snapshot"
lastSnapshotTimestamp: BigInt!
}
type User @entity {
"User address"
id: ID!
"The total number of vaults, where user is an allocator"
vaultsCount: Int!
"Defines whether the user holds any osToken shares"
isOsTokenHolder: Boolean!
}
"""
Account that is whitelisted in the private Vault
"""
type PrivateVaultAccount @entity {
"<Vault ID>-<address>"
id: ID!
"The address of the account"
address: Bytes!
"The private Vault"
vault: Vault!
"The timestamp when the account was added"
createdAt: BigInt!
}
"""
Account that is blocked in the Vault
"""
type VaultBlockedAccount @entity {
"<Vault ID>-<address>"
id: ID!
"The address of the account"
address: Bytes!
"The blocklist Vault"
vault: Vault!
"The timestamp when the account was added"
createdAt: BigInt!
}
"""
Reward splitter used to distribute fee accumulated in the vault
"""
type RewardSplitter @entity {
"Reward splitter address"
id: ID!
"The address of the account that can modify the reward splitter share holders"
owner: Bytes!
"The total number of shares"
totalShares: BigInt!
"The Vault that reward splitter belongs to"
vault: Vault!
"Shareholders of the reward splitter"
shareHolders: [RewardSplitterShareHolder!]! @derivedFrom(field: "rewardSplitter")
}
"""
Reward splitter shareholder
"""
type RewardSplitterShareHolder @entity {
"<RewardSplitter ID>-<holder address>"
id: ID!
"The reward splitter"
rewardSplitter: RewardSplitter!
"The address of the vault"
vault: Vault!
"The address of shareholder"
address: Bytes!
"The amount of shares"
shares: BigInt!
"The amount of earned vault shares"
earnedVaultShares: BigInt!
"The amount of earned vault assets"
earnedVaultAssets: BigInt!
}
"""
StakeWise V3 transaction
"""
type Transaction @entity(immutable: true) {
"Transaction hash"
id: ID!
}
"""
StakeWise V2 pool data
"""
type V2Pool @entity {
"1"
id: ID!
"V2 Pool total assets"
totalAssets: BigInt!
"Total rewards accumulated"
rewardAssets: BigInt!
"Total assets staked"
principalAssets: BigInt!
"Total penalty accrued"
penaltyAssets: BigInt!
"The staking fee percent charged by the pool"
feePercent: Int!
"Whether V2 Pool has migrated to V3"
migrated: Boolean!
"The current exchange rate for 10^18 staked token"
rate: BigInt!
"The pool average weekly total APY"
apy: BigDecimal!
"The list of pool APY snapshot"
apys: [BigDecimal!]!
"Last rewards update timestamp"
rewardsTimestamp: BigInt
}
"""
StakeWise V2 pool user
"""
type V2PoolUser @entity {
"The address of the user"
id: ID!
"The balance of the user"
balance: BigInt!
}
"""
Vesting Escrow
"""
type VestingEscrow @entity(immutable: true) {
"The vesting escrow address"
id: ID!
"The vesting escrow token address"
token: String!
"The vesting escrow recipient"
recipient: Bytes!
}
"""
The OsToken config
"""
type OsTokenConfig @entity {
"The ID of the OsTokenConfig"
id: ID!
"The vault osToken LTV percent"
ltvPercent: BigInt!
"The leverage strategy max OsToken minting LTV"
leverageMaxMintLtvPercent: BigInt!
"The vault osToken liquidation threshold percent"
liqThresholdPercent: BigInt!
}
"""
The OsToken vault exit request
"""
type OsTokenExitRequest @entity {
"<Vault ID>-<Exit queue id>"
id: ID!
"The address that can claim the exit"
owner: Bytes!
"The vault where assets are exiting"
vault: Vault!
"The exit request position ticket"
positionTicket: BigInt!
"The processed assets from the exit request. Will be null if the exit request is not processed."
exitedAssets: BigInt
"The total amount of osToken shares exiting"
osTokenShares: BigInt!
"The position's LTV percent"
ltv: BigDecimal!
}
"""
The Aave supplying and borrowing data
"""
type Aave @entity {
"Set to 1"
id: ID!
"The weekly average assets borrow APY"
borrowApy: BigDecimal!
"The list of Aave borrow APY snapshots"
borrowApys: [BigDecimal!]!
"The weekly average OsToken supply APY"
supplyApy: BigDecimal!
"The list of OsToken supply APY snapshots"
supplyApys: [BigDecimal!]!
"The Aave leverage strategy max borrow LTV percent"
leverageMaxBorrowLtvPercent: BigInt!
"The Aave positions in Leveraged strategy"
positions: [AavePosition!]! @derivedFrom(field: "aave")
}
"""
The Aave position in Leverage strategy
"""
type AavePosition @entity {
"Set to user address"
id: ID!
"The address of the user"
user: Bytes!
"The Aave instance"
aave: Aave!
"The total amount of supplied assets to Aave"
suppliedOsTokenShares: BigInt!
"The total amount of borrowed assets from Aave"
borrowedAssets: BigInt!
}
"""
The LeverageStrategy position
"""
type LeverageStrategyPosition @entity {
"Set to `vault ID-user address`"
id: ID!
"The proxy address used for the leverage"
proxy: Bytes!
"The address of the user"
user: Bytes!
"The vault used for the leverage"
vault: Vault!
"The total amount of user osToken shares"
osTokenShares: BigInt!
"The total amount of user assets"
assets: BigInt!
"The total amount of user assets"
totalAssets: BigInt!
"The current borrow LTV percent"
borrowLtv: BigDecimal!
"The percent (in wad) of user's position that is currently exiting"
exitingPercent: BigInt!
"The total amount of user exiting osToken shares"
exitingOsTokenShares: BigInt!
"The total amount of user exiting assets"
exitingAssets: BigInt!
"The unprocessed exit request. Can be null if nothing is exiting."
exitRequest: ExitRequest
}
"""
The snapshot of the allocator state
"""
type AllocatorSnapshot @entity(timeseries: true) {
id: Int8!
timestamp: Timestamp!
allocator: Allocator!
earnedAssets: BigInt!
totalAssets: BigInt!
apy: BigDecimal!
ltv: BigDecimal!
}
"""
The aggregation of the allocator snapshots
"""
type AllocatorStats @aggregation(intervals: ["day"], source: "AllocatorSnapshot") {
id: Int8!
timestamp: Timestamp!
allocator: Allocator!
earnedAssets: BigInt! @aggregate(fn: "sum", arg: "earnedAssets")
totalAssets: BigInt! @aggregate(fn: "last", arg: "totalAssets")
apy: BigDecimal! @aggregate(fn: "last", arg: "apy")
ltv: BigDecimal! @aggregate(fn: "last", arg: "ltv")
}
"""
The snapshot of the OsToken state
"""
type OsTokenSnapshot @entity(timeseries: true) {
id: Int8!
timestamp: Timestamp!
earnedAssets: BigInt!
totalAssets: BigInt!
apy: BigDecimal!
}
"""
The aggregation of the OsToken snapshots
"""
type OsTokenStats @aggregation(intervals: ["day"], source: "OsTokenSnapshot") {
id: Int8!
timestamp: Timestamp!
earnedAssets: BigInt! @aggregate(fn: "sum", arg: "earnedAssets")
totalAssets: BigInt! @aggregate(fn: "last", arg: "totalAssets")
apy: BigDecimal! @aggregate(fn: "last", arg: "apy")
}
"""
The snapshot of the OsTokenHolder state
"""
type OsTokenHolderSnapshot @entity(timeseries: true) {
id: Int8!
timestamp: Timestamp!
osTokenHolder: OsTokenHolder!
earnedAssets: BigInt!
totalAssets: BigInt!
apy: BigDecimal!
}
"""
The aggregation of the OsTokenHolder snapshots
"""
type OsTokenHolderStats @aggregation(intervals: ["day"], source: "OsTokenHolderSnapshot") {
id: Int8!
timestamp: Timestamp!
osTokenHolder: OsTokenHolder!
earnedAssets: BigInt! @aggregate(fn: "sum", arg: "earnedAssets")
totalAssets: BigInt! @aggregate(fn: "last", arg: "totalAssets")
apy: BigDecimal! @aggregate(fn: "last", arg: "apy")
}
"""
The snapshot of the Vault state
"""
type VaultSnapshot @entity(timeseries: true) {
id: Int8!
timestamp: Timestamp!
vault: Vault!
earnedAssets: BigInt!
totalAssets: BigInt!
totalShares: BigInt!
apy: BigDecimal!
}
"""
The aggregation of the Vault snapshots
"""
type VaultStats @aggregation(intervals: ["day"], source: "VaultSnapshot") {
id: Int8!
timestamp: Timestamp!
vault: Vault!
earnedAssets: BigInt! @aggregate(fn: "sum", arg: "earnedAssets")
totalAssets: BigInt! @aggregate(fn: "last", arg: "totalAssets")
totalShares: BigInt! @aggregate(fn: "last", arg: "totalShares")
apy: BigDecimal! @aggregate(fn: "last", arg: "apy")
}
"""
The latest exchange rates
"""
type ExchangeRate @entity {
"Always 0"
id: ID!
"The USD rate of the assets (e.g. ETH, GNO)"
assetsUsdRate: BigDecimal!
"The USD rate of the SWISE"
swiseUsdRate: BigDecimal!
"The USD rate of DAI"
daiUsdRate: BigDecimal!
"The USD rate of USDC"
usdcUsdRate: BigDecimal!
"The USD to EUR rate"
usdToEurRate: BigDecimal!
"The USD to GBP rate"
usdToGbpRate: BigDecimal!
"The USD to CNY rate"
usdToCnyRate: BigDecimal!
"The USD to JPY rate"
usdToJpyRate: BigDecimal!
"The USD to KRW rate"
usdToKrwRate: BigDecimal!
"The USD to AUD rate"
usdToAudRate: BigDecimal!
}
"""
The snapshot of the exchange rates
"""
type ExchangeRateSnapshot @entity(timeseries: true) {
id: Int8!
timestamp: Timestamp!
assetsUsdRate: BigDecimal!
swiseUsdRate: BigDecimal!
daiUsdRate: BigDecimal!
usdcUsdRate: BigDecimal!
usdToEurRate: BigDecimal!
usdToGbpRate: BigDecimal!
usdToCnyRate: BigDecimal!
usdToJpyRate: BigDecimal!
usdToKrwRate: BigDecimal!
usdToAudRate: BigDecimal!
}
"""
The aggregation of the ExchangeRate snapshots
"""
type ExchangeRateStats @aggregation(intervals: ["day"], source: "ExchangeRateSnapshot") {
id: Int8!
timestamp: Timestamp!
assetsUsdRate: BigDecimal! @aggregate(fn: "last", arg: "assetsUsdRate")
swiseUsdRate: BigDecimal! @aggregate(fn: "last", arg: "swiseUsdRate")
daiUsdRate: BigDecimal! @aggregate(fn: "last", arg: "daiUsdRate")
usdcUsdRate: BigDecimal! @aggregate(fn: "last", arg: "usdcUsdRate")
usdToEurRate: BigDecimal! @aggregate(fn: "last", arg: "usdToEurRate")
usdToGbpRate: BigDecimal! @aggregate(fn: "last", arg: "usdToGbpRate")
usdToCnyRate: BigDecimal! @aggregate(fn: "last", arg: "usdToCnyRate")
usdToJpyRate: BigDecimal! @aggregate(fn: "last", arg: "usdToJpyRate")
usdToKrwRate: BigDecimal! @aggregate(fn: "last", arg: "usdToKrwRate")
usdToAudRate: BigDecimal! @aggregate(fn: "last", arg: "usdToAudRate")
}
"Uniswap V3 pool data"
type UniswapPool @entity {
"The address of the pool"
id: ID!
"The address of token0"
token0: Bytes!
"The address of token1"
token1: Bytes!
"Fee tier"
feeTier: BigInt!
"The in range liquidity"
liquidity: BigInt!
"The current price tracked"
sqrtPrice: BigInt!
"The tracker of the accumulated token0 fees"
feesToken0: BigInt!
"The tracker of the accumulated token1 fees"
feesToken1: BigInt!
"The current tick"
tick: Int
"All time token0 swapped"
volumeToken0: BigInt!
"All time token1 swapped"
volumeToken1: BigInt!
"The pool positions"
positions: [UniswapPosition!]! @derivedFrom(field: "pool")
}
"Positions created through UniswapPositionManager"
type UniswapPosition @entity {
"NFT Token ID"
id: ID!
"The address of the position owner"
owner: Bytes!
"The address of the pool"
pool: UniswapPool!
"The amount of token0"
amount0: BigInt!
"The amount of token1"
amount1: BigInt!
"Lower tick of the position"
tickLower: Int!
"Upper tick of the position"
tickUpper: Int!
"Total liquidity of the position"
liquidity: BigInt!
}
"Stores current active distributions"
type Distributor @entity {