-
Notifications
You must be signed in to change notification settings - Fork 4
/
schema.graphql
387 lines (355 loc) · 11.5 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
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!
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
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
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
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!
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
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
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
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
}
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!
lastUpdatedTimestamp: Timestamp! @index # Timestamp of the last update
}
type CLFactory_PoolCreated {
id: ID!
token0: String!
token1: String!
tickSpacing: BigInt! @config(precision: 76)
pool: String! @index
timestamp: Timestamp!
chainId: Int!
}
type Gauge_NotifyReward {
id: ID!
from: String!
amount: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
chainId: Int!
}
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!
chainId: Int!
}
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!
chainId: Int!
}
type Pool_Burn {
id: ID!
sourceAddress: String!
sender: String!
to: String!
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
timestamp: Timestamp!
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!
chainId: Int!
}
type Pool_Sync {
id: ID!
reserve0: BigInt! @config(precision: 76)
reserve1: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
chainId: Int!
}
type NFPM_Transfer {
id: ID!
transactionHash: String!
from: String!
to: String!
tokenId: BigInt! @config(precision: 76)
timestamp: Timestamp!
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!
chainId: Int!
}
type VotingReward_Withdraw {
id: ID!
from: String!
tokenId: BigInt! @config(precision: 76)
amount: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
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!
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!
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!
chainId: Int!
}
type PoolFactory_SetCustomFee {
id: ID!
pool: String!
fee: BigInt! @config(precision: 76)
timestamp: Timestamp!
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
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
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
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
chainId: Int!
}
type CLPool_IncreaseObservationCardinalityNext {
id: ID!
observationCardinalityNextOld: BigInt! @config(precision: 76)
observationCardinalityNextNew: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
chainId: Int!
}
type CLPool_Initialize {
id: ID!
sqrtPriceX96: BigInt! @config(precision: 76)
tick: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
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
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
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
chainId: Int!
}
type Voter_WhitelistToken {
id: ID!
whitelister: String!
token: String!
isWhitelisted: Boolean!
timestamp: Timestamp!
chainId: Int!
}
type SuperchainCLFactory_RootPoolCreated {
id: ID!
token0: String!
token1: String!
tickSpacing: BigInt! @config(precision: 76)
pool: String! @index
timestamp: Timestamp!
poolChainId: Int!
chainId: Int!
}
type SuperchainPoolFactory_RootPoolCreated {
id: ID!
token0: String!
token1: String!
stable: Boolean!
pool: String! @index
timestamp: Timestamp!
poolChainId: Int!
chainId: Int!
length: BigInt! @config(precision: 76)
}