-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathschema.graphql
605 lines (562 loc) · 16.9 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
type LiquidityPoolAggregator {
id: ID! # pool address
chainId: Int!
name: String! # name of the pool
token0_id: String! # token0 id
token1_id: String! # token1 id
token0_address: String! # token0 address
token1_address: String! # token1 address
isStable: Boolean! # whether the pool is a stable AMM or a volatile AMM
isCL: Boolean! # whether the pool is a CL pool
reserve0: BigInt! @config(precision: 76) # reserve of token0 in token units
reserve1: BigInt! @config(precision: 76) # reserve of token1 in token units
totalLiquidityUSD: BigInt! @config(precision: 76) # total liquidity of the swap pool in USD
totalVolume0: BigInt! @config(precision: 76) # total swap volume of token0 in token units
totalVolume1: BigInt! @config(precision: 76) # total swap volume of token1 in token units
totalVolumeUSD: BigInt! @config(precision: 76) # total swap volume of the pool in USD
totalVolumeUSDWhitelisted: BigInt! @config(precision: 76) # total swap volume of the pool in USD
totalFees0: BigInt! @config(precision: 76) # total fees collected in token0 units
totalFees1: BigInt! @config(precision: 76) # total fees collected in token1 units
totalFeesUSD: BigInt! @config(precision: 76) # total fees collected in USD
totalFeesUSDWhitelisted: BigInt! @config(precision: 76) # total fees collected in USD
numberOfSwaps: BigInt! @config(precision: 76) # total number of swaps in the pool
token0Price: BigInt! @config(precision: 76) # price of token0 relative to token1
token1Price: BigInt! @config(precision: 76) # price of token1 relative to token0
totalVotesDeposited: BigInt! @config(precision: 76) # total votes for the pool
totalVotesDepositedUSD: BigInt! @config(precision: 76) # total votes for the pool in USD
totalEmissions: BigInt! @config(precision: 76) # total emissions for the pool in reward token units (VELO form Optimism and AERO for Base)
totalEmissionsUSD: BigInt! @config(precision: 76) # total emissions for the pool in USD
totalBribesUSD: BigInt! @config(precision: 76) # total bribes for the pool in USD
gaugeIsAlive: Boolean! # whether the gauge is alive
token0IsWhitelisted: Boolean! # whether the token0 is whitelisted
token1IsWhitelisted: Boolean! # whether the token1 is whitelisted
lastUpdatedTimestamp: Timestamp! # timestamp of last update
lastSnapshotTimestamp: Timestamp! # timestamp of last snapshot
}
# Snapshot of the LiquidityPool entity
type LiquidityPoolAggregatorSnapshot {
id: ID! # pool address
chainId: Int! # chain id
name: String! # name of the pool
pool: String! # pool address
token0_id: String! # token0 id
token1_id: String! # token1 id
token0_address: String! # token0 address
token1_address: String! # token1 address
isStable: Boolean! # whether the pool is a stable AMM or a volatile AMM
isCL: Boolean!
reserve0: BigInt! @config(precision: 76) # reserve of token0 in token units
reserve1: BigInt! @config(precision: 76) # reserve of token1 in token units
totalLiquidityUSD: BigInt! @config(precision: 76) # total liquidity of the swap pool in USD
totalVolume0: BigInt! @config(precision: 76) # total swap volume of token0 in token units
totalVolume1: BigInt! @config(precision: 76) # total swap volume of token1 in token units
totalVolumeUSD: BigInt! @config(precision: 76) # total swap volume of the pool in USD
totalVolumeUSDWhitelisted: BigInt! @config(precision: 76) # total swap volume of the pool in USD
totalFees0: BigInt! @config(precision: 76) # total fees collected in token0 units
totalFees1: BigInt! @config(precision: 76) # total fees collected in token1 units
totalFeesUSD: BigInt! @config(precision: 76) # total fees collected in USD
totalFeesUSDWhitelisted: BigInt! @config(precision: 76) # total fees collected in USD
numberOfSwaps: BigInt! @config(precision: 76) # total number of swaps in the pool
token0Price: BigInt! @config(precision: 76) # price of token0 relative to token1
token1Price: BigInt! @config(precision: 76) # price of token1 relative to token0
totalVotesDeposited: BigInt! @config(precision: 76) # total votes for the pool
totalVotesDepositedUSD: BigInt! @config(precision: 76) # total votes for the pool in USD
totalEmissions: BigInt! @config(precision: 76) # total emissions for the pool in reward token units (VELO form Optimism and AERO for Base)
totalEmissionsUSD: BigInt! @config(precision: 76) # total emissions for the pool in USD
totalBribesUSD: BigInt! @config(precision: 76) # total bribes for the pool in USD
gaugeIsAlive: Boolean! # whether the gauge is alive
token0IsWhitelisted: Boolean! # whether the token0 is whitelisted
token1IsWhitelisted: Boolean! # whether the token1 is whitelisted
timestamp: Timestamp! # timestamp of last update
}
# Entity for tracking a unique address in the `to` or `from` of a swap event
# Other liquidity pools don't count as users
type User {
id: ID! # user address
numberOfSwaps: BigInt! @config(precision: 76) # total number of swaps the user has made
joined_at_timestamp: Timestamp! # timestamp of the user's first swap (or being swapped to), Not accurate if run in multihead unordered mode.
}
# Entity that tracks the latest state of the token entity
# By nature this entity saves the latest state of the token, and its state at different times should be attained from the snapshot entities
type Token {
id: ID! # token address
address: String! @index # token address
symbol: String! # token symbol
name: String! # token name
chainId: Int! @index
decimals: BigInt! @config(precision: 76) # number of decimals
pricePerUSDNew: BigInt! @config(precision: 76) # price of token per USD
lastUpdatedTimestamp: Timestamp! # timestamp of last update
isWhitelisted: Boolean! # whether the token is whitelisted
}
# Snapshot of the Token entity
type TokenPriceSnapshot {
id: ID! # Unique identifier for the record, could be a combination of token address and chain ID
address: String! @index # Address of the token
pricePerUSDNew: BigInt! @config(precision: 76) # price of token per USD
chainId: Int!
isWhitelisted: Boolean! # whether the token is whitelisted
lastUpdatedTimestamp: Timestamp! @index # Timestamp of the last update
}
# Event for when a a concentrated liquidity pool is created
type CLFactory_PoolCreated {
id: ID!
token0: String!
token1: String!
tickSpacing: BigInt! @config(precision: 76)
pool: String! @index
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
# Event for when a gauge is notified of a reward
type Gauge_NotifyReward {
id: ID!
from: String!
amount: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
# Event for when a voting reward is notified of a reward
type VotingReward_NotifyReward {
id: ID!
from: String!
reward: String!
epoch: BigInt! @config(precision: 76)
pool: String!
amount: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
# Event for when a swap occurs in a pool
type Pool_Swap {
id: ID!
sender: String!
to: String!
amount0In: BigInt! @config(precision: 76)
amount1In: BigInt! @config(precision: 76)
amount0Out: BigInt! @config(precision: 76)
amount1Out: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
# Event for when a burn occurs in a pool
type Pool_Burn {
id: ID!
sourceAddress: String!
sender: String!
to: String!
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type Pool_Mint {
id: ID!
sourceAddress: String!
transactionHash: String!
sender: String!
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type Pool_Sync {
id: ID!
reserve0: BigInt! @config(precision: 76)
reserve1: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type NFPM_Transfer {
id: ID!
transactionHash: String!
from: String!
to: String!
tokenId: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type Voter {
id: ID!
}
type VotingReward_Deposit {
id: ID!
from: String!
tokenId: BigInt! @config(precision: 76)
amount: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type VotingReward_Withdraw {
id: ID!
from: String!
tokenId: BigInt! @config(precision: 76)
amount: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type Voter_Voted {
id: ID!
sender: String!
pool: String!
tokenId: BigInt! @config(precision: 76)
weight: BigInt! @config(precision: 76)
totalWeight: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type Voter_DistributeReward {
id: ID!
sender: String!
pool: String!
gauge: String!
amount: BigInt! @config(precision: 76)
tokensDeposited: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type Voter_GaugeCreated {
id: ID!
poolFactory: String!
votingRewardsFactory: String!
gaugeFactory: String!
pool: String!
bribeVotingReward: String!
feeVotingReward: String!
gauge: String!
creator: String!
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type PoolFactory_SetCustomFee {
id: ID!
pool: String!
fee: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type CLPool_Burn {
id: ID!
owner: String!
tickLower: BigInt! @config(precision: 76)
tickUpper: BigInt! @config(precision: 76)
amount: BigInt! @config(precision: 76)
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type CLPool_Collect {
id: ID!
owner: String!
recipient: String!
tickLower: BigInt! @config(precision: 76)
tickUpper: BigInt! @config(precision: 76)
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type CLPool_CollectFees {
id: ID!
recipient: String!
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type CLPool_Flash {
id: ID!
sender: String!
recipient: String!
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
paid0: BigInt! @config(precision: 76)
paid1: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type CLPool_IncreaseObservationCardinalityNext {
id: ID!
observationCardinalityNextOld: BigInt! @config(precision: 76)
observationCardinalityNextNew: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type CLPool_Initialize {
id: ID!
sqrtPriceX96: BigInt! @config(precision: 76)
tick: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type CLPool_Mint {
id: ID!
sender: String!
owner: String!
transactionHash: String!
tickLower: BigInt! @config(precision: 76)
tickUpper: BigInt! @config(precision: 76)
amount: BigInt! @config(precision: 76)
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type CLPool_SetFeeProtocol {
id: ID!
feeProtocol0Old: BigInt! @config(precision: 76)
feeProtocol1Old: BigInt! @config(precision: 76)
feeProtocol0New: BigInt! @config(precision: 76)
feeProtocol1New: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type CLPool_Swap {
id: ID!
sender: String!
recipient: String!
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
sqrtPriceX96: BigInt! @config(precision: 76)
liquidity: BigInt! @config(precision: 76)
tick: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type Voter_WhitelistToken {
id: ID!
whitelister: String!
token: String!
isWhitelisted: Boolean!
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type SuperchainCLFactory_RootPoolCreated {
id: ID!
token0: String!
token1: String!
tickSpacing: BigInt! @config(precision: 76)
pool: String! @index
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
poolChainId: Int!
chainId: Int!
}
type SuperchainPoolFactory_RootPoolCreated {
id: ID!
token0: String!
token1: String!
stable: Boolean!
pool: String! @index
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
poolChainId: Int!
chainId: Int!
length: BigInt! @config(precision: 76)
}
type VeNFTAggregator {
id: ID!
chainId: Int!
tokenId: BigInt! @config(precision: 76)
owner: String!
locktime: BigInt! @config(precision: 76)
lastUpdatedTimestamp: Timestamp!
totalValueLocked: BigInt! @config(precision: 76)
isAlive: Boolean!
}
type VeNFT_Deposit {
id: ID!
provider: String!
tokenId: BigInt! @config(precision: 76)
depositType: BigInt! @config(precision: 76)
value: BigInt! @config(precision: 76)
locktime: BigInt! @config(precision: 76)
ts: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type VeNFT_Withdraw {
id: ID!
provider: String!
tokenId: BigInt! @config(precision: 76)
value: BigInt! @config(precision: 76)
ts: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type VeNFT_Transfer {
id: ID!
from: String!
to: String!
tokenId: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}
type ALMCore_Rebalance {
id: ID!
pool: String!
tickLower: BigInt! @config(precision: 76)
tickUpper: BigInt! @config(precision: 76)
sqrtPriceX96: BigInt! @config(precision: 76)
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
ammPositionIdBefore: BigInt! @config(precision: 76)
ammPositionIdAfter: BigInt! @config(precision: 76)
timestamp: Timestamp!
chainId: Int!
blockNumber: Int!
logIndex: Int!
}
type ALMCore_Rebalance_AmmPosition {
id: ID!
pool: String!
token0: String!
token1: String!
property: BigInt! @config(precision: 24)
tickLower: BigInt! @config(precision: 24)
tickUpper: BigInt! @config(precision: 24)
liquidity: BigInt! @config(precision: 76)
timestamp: Timestamp!
chainId: Int!
blockNumber: Int!
logIndex: Int!
}
type ALMDeployFactory_StrategyCreated {
id: ID!
pool: String!
lpWrapper: String!
strategyType: BigInt! @config(precision: 8)
tickNeighborhood: BigInt! @config(precision: 24)
tickSpacing: BigInt! @config(precision: 24)
width: BigInt! @config(precision: 24)
maxLiquidityRatioDeviationX96: BigInt! @config(precision: 76)
timestamp: Timestamp!
chainId: Int!
blockNumber: Int!
logIndex: Int!
}
type ALMDeployFactory_StrategyCreated_AmmPosition {
id: ID!
pool: String!
lpWrapper: String!
token0: String!
token1: String!
property: BigInt! @config(precision: 24)
tickLower: BigInt! @config(precision: 24)
tickUpper: BigInt! @config(precision: 24)
liquidity: BigInt! @config(precision: 76)
timestamp: Timestamp!
chainId: Int!
blockNumber: Int!
logIndex: Int!
}
type ALMLPWrapper_Deposit {
id: ID!
sender: String!
recipient: String!
pool: String!
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
lpAmount: BigInt! @config(precision: 76)
totalSupply: BigInt! @config(precision: 76)
timestamp: Timestamp!
chainId: Int!
blockNumber: Int!
logIndex: Int!
}
type ALMLPWrapper_Withdraw {
id: ID!
sender: String!
recipient: String!
pool: String!
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
lpAmount: BigInt! @config(precision: 76)
totalSupply: BigInt! @config(precision: 76)
timestamp: Timestamp!
chainId: Int!
blockNumber: Int!
logIndex: Int!
}
type ALMLPWrapper_Transfer {
id: ID!
from: String!
to: String!
value: BigInt! @config(precision: 76)
timestamp: Timestamp!
chainId: Int!
blockNumber: Int!
logIndex: Int!
}