forked from Data-Nexus/rocket-pool-mainnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
637 lines (445 loc) · 19.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
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
# Entity that represents the RocketPool protocol.
type RocketPoolProtocol @entity {
# The name of the RocketPool protocol.
id: ID!
# All stakers that have had ETH rewards while staking with RocketPool.
stakersWithETHRewards: [Staker!]!
# All stakers that currently have an rETH balance greater than 0.
activeStakers: [Staker!]!
# All stakers that have ever held rETH.
stakers: [Staker!]!
# Last known staker network balance checkpoint.
lastNetworkStakerBalanceCheckPoint: NetworkStakerBalanceCheckpoint
# All nodes that are registered with the RocketPool protocol.
nodes: [Node!]!
# All timezones associated with registered nodes.
nodeTimezones: [NetworkNodeTimezone!]!
# Last known RPL reward interval.
lastRPLRewardInterval: RPLRewardInterval
# Last known node network balance checkpoint.
lastNetworkNodeBalanceCheckPoint: NetworkNodeBalanceCheckpoint
# All node network balance checkpoints for the RocketPool protocol.
networkNodeBalanceCheckpoints: [NetworkNodeBalanceCheckpoint!]!
# All addresses holding rETH
stakersWithAnRETHBalance: BigInt!
}
# An address that is/was associated with an rETH balance.
type Staker @entity {
# Address that holds rETH.
id: ID!
# Current rETH balance in WEI.
rETHBalance: BigInt!
" Stakers entry conversion rate as a weighted average "
avgEntry: BigInt!
" Weighted time entry "
AvgEntryTime: BigInt!
# Block number at which this staker first received rETH.
block: BigInt!
# Block timestamp at which this staker first received rETH.
blockTime: BigInt!
}
# Tracks the mint, burn and transfers of rETH.
type RocketETHTransaction @entity(immutable: true) {
# Composite key based on transaction hash of the triggered event and its log index.
id: ID!
# The address that was the original owner of the rETH.
from: Staker!
# The rETH amount (in WEI) being transferred.
amount: BigInt!
# The address that was the recipient of the rETH.
to: Staker!
# The block number of this transaction.
block: BigInt!
# The block timestamp of this transaction.
blockTime: BigInt!
# The transaction hash.
transactionHash: Bytes!
}
#
type RocketETHDailySnapshot @entity {
# day number (timestamp / 86400)
id: ID!
# Staker ETH (in WEI) balance (initial deposit + (ETH network rewards - average node fee)) on the beacon chain at this checkpoint.
stakerETHActivelyStaking: BigInt!
# Staker ETH (in WEI) waiting in the deposit pool at this checkpoint.
stakerETHWaitingInDepositPool: BigInt!
# Staker ETH (in WEI) in the RocketETH contract at this checkpoint.
stakerETHInRocketETHContract: BigInt!
# Staker ETH (in WEI) in RocketPool at this checkpoint.
stakerETHInProtocol: BigInt!
# Average staker ETH rewards (+/-) (in WEI) up to this checkpoint.
averageStakerETHRewards: BigInt!
# Total unique stakers that have an rETH balance (in WEI) greater than 0 at this checkpoint.
stakersWithAnRETHBalance: BigInt!
# Total rETH supply at this checkpoint.
totalRETHSupply: BigInt!
# Exchange rate of ETH:rETH (in WEI) at this checkpoint.
rETHExchangeRate: BigInt!
# Block Number of this checkpoint.
block: BigInt!
# Block Timestamp of this checkpoint.
blockTime: BigInt!
}
# Summarizes staker related balances at a specific block and timestamp.
type NetworkStakerBalanceCheckpoint @entity {
# Composite key based on transaction hash of the triggered event and its log index.
id: ID!
# Id to the the previous checkpoint.
previousCheckpointId: String
# Id to the the next checkpoint.
nextCheckpointId: String
# Staker ETH (in WEI) balance (initial deposit + (ETH network rewards - average node fee)) on the beacon chain at this checkpoint.
stakerETHActivelyStaking: BigInt!
# Staker ETH (in WEI) waiting in the deposit pool at this checkpoint.
stakerETHWaitingInDepositPool: BigInt!
# Staker ETH (in WEI) in the RocketETH contract at this checkpoint.
stakerETHInRocketETHContract: BigInt!
# Staker ETH (in WEI) in RocketPool at this checkpoint.
stakerETHInProtocol: BigInt!
# Average staker ETH rewards (+/-) (in WEI) up to this checkpoint.
averageStakerETHRewards: BigInt!
# Total unique stakers that have an rETH balance (in WEI) greater than 0 at this checkpoint.
stakersWithAnRETHBalance: BigInt!
# Total rETH supply at this checkpoint.
totalRETHSupply: BigInt!
# Exchange rate of ETH:rETH (in WEI) at this checkpoint.
rETHExchangeRate: BigInt!
# Block Number of this checkpoint.
block: BigInt!
# Block Timestamp of this checkpoint.
blockTime: BigInt!
}
# A node address that was registered by a node operator.
type Node @entity {
# Address that is associated with a node on RocketPool.
id: ID!
# Current timezone for this node.
timezone: NetworkNodeTimezone!
# Indicator that determines if a node is currently an oracle node or not.
isOracleNode: Boolean!
# If this node is currently an oracle node, signifies the RPL bond of the ODAO node.
oracleNodeRPLBond: BigInt
# Identifies the block time of the last ODAO state change for this node.
oracleNodeBlockTime: BigInt
# Current RPL staked.
rplStaked: BigInt!
# Current effective RPL staked
effectiveRPLStaked: BigInt!
# Total RPL slashed since this node was registered with RocketPool.
totalRPLSlashed: BigInt!
# Total claim amount accrued via the ODAO reward claim contract.
totalODAORewardsClaimed: BigInt!
# Total claim amount accrued via the regular reward claim contract.
totalNodeRewardsClaimed: BigInt!
# Average reward claim this node has done via the ODAO reward claim contract.
averageODAORewardClaim: BigInt!
# Average reward claim this node has done via the regular reward claim contract.
averageNodeRewardClaim: BigInt!
# Total amount of successfull RPL claims a node has done via the ODAO reward claim contract.
odaoRewardClaimCount: BigInt!
# Total amount of successfull RPL claims a node has done via the regular node reward claim contract.
nodeRewardClaimCount: BigInt!
# Current minimum RPL needed to collateralize all staking minipools of this node by the bare minimum.
minimumEffectiveRPL: BigInt!
# Current maximum RPL needed to collateralize all staking minipools of this node to the absolute maximum.
maximumEffectiveRPL: BigInt!
# Current queueud minipools
queuedMinipools: BigInt!
# Current staking minipools
stakingMinipools: BigInt!
# Current unbonded staking minipools
stakingUnbondedMinipools: BigInt!
# Current withdrawable minipools.
withdrawableMinipools: BigInt!
# Finalized minipools since this node was registered with RocketPool.
totalFinalizedMinipools: BigInt!
# Average minipool fee for the active (NOT finalized or destroyed) minipools for this node operator.
averageFeeForActiveMinipools: BigInt!
# Last node balance checkpoint for this node.
lastNodeBalanceCheckpoint: NodeBalanceCheckpoint
# Associated minipools for this node.
minipoolIds: [String!]
# Associated minipools for this node.
minipools: [Minipool!]! @derivedFrom(field: "node")
# Is the node registerd with the smoothing pool
smoothingPool: Boolean!
# Block number at which this node was first registered with the protocol.
block: BigInt!
# Block timestamp at which this node was first registered with the protocol.
blockTime: BigInt!
}
# The type of RPL Stake transactions.
enum NodeRPLStakeTransactionType {
Staked
Withdrawal
Slashed
}
# Keeps track of the RPL staking transactions for a node.
type NodeRPLStakeTransaction @entity {
# Composite key based on transaction hash of the triggered event and its log index.
id: ID!
# Total number of nodes registered with this timezone.
node: Node!
# The total RPL amount that concerns this transaction.
amount: BigInt!
# The total ETH equivalent at the time of this transaction.
ethAmount: BigInt!
# The type of RPL stake transaction.
type: NodeRPLStakeTransactionType!
# On what block number did this transaction occur.
block: BigInt!
# At what time did this transaction occur.
blockTime: BigInt!
}
# Represents an reward interval during which RPL can be claimed by different types of claimers.
type RPLRewardInterval @entity {
# Composite key based on transaction hash of the triggered event and its log index.
id: ID!
# ID to the previous.
previousIntervalId: String
# ID to the next interval.
nextIntervalId: String
# The total RPL rewards that are claimable for this interval.
claimableRewards: BigInt!
# The total RPL rewards from the previous interval that rolled over into this interval.
claimableRewardsFromPreviousInterval: BigInt!
# The total RPL rewards that are claimable for this interval via the PDAO reward claim contract.
claimablePDAORewards: BigInt!
# The total RPL rewards that are claimable for this interval via the ODAO reward claim contract.
claimableODAORewards: BigInt!
# The total RPL rewards that are claimable for this interval via the regula node reward claim contract.
claimableNodeRewards: BigInt!
# The total RPL rewards claimed during this interval.
totalRPLClaimed: BigInt!
# The total RPL rewards that have been claimed during this interval for the PDAO reward claim contract.
totalPDAORewardsClaimed: BigInt!
# The total RPL rewards that have been claimed during this interval for the ODAO reward claim contract.
totalODAORewardsClaimed: BigInt!
# The total RPL rewards that have been claimed during this interval for the regular node reward claim contract.
totalNodeRewardsClaimed: BigInt!
# Average RPL claim for the ODAO reward claim contract during this interval.
averageODAORewardClaim: BigInt!
# Average RPL claim for the regular node reward claim contract during this interval.
averageNodeRewardClaim: BigInt!
# The total number of claims done for the ODAO reward claim contract during this interval.
odaoRewardClaimCount: BigInt!
# The total number of claims done for the regular node reward claim contract during this interval.
nodeRewardClaimCount: BigInt!
# The total RPL rewards that were given out in this interval.
rplRewardClaims: [RPLRewardClaim!]!
# Indicates if this interval is still active.
isClosed: Boolean!
# Indicates when this interval started.
intervalStartTime: BigInt!
# Indicates when this interval ended.
intervalClosedTime: BigInt
# Indicates how long the interval was supposed to last.
intervalDuration: BigInt!
# Indicates how long the interval actually lasted.
intervalDurationActual: BigInt
# On what block number was this interval created.
block: BigInt!
# At what time was this interval created.
blockTime: BigInt!
}
# Represents an reward interval during which RPL can be claimed by different types of claimers.
type RPLRewardSubmitted @entity {
# Reward Index
id: ID!
rewardIndex: BigInt!
executionBlock: BigInt!
consensusBlock: BigInt!
merkleRoot: Bytes!
merkleTreeCID: String!
intervalsPassed: BigInt!
treasuryRPL: BigInt!
trustedNodeRPL: [BigInt!]!
nodeRPL: [BigInt!]!
nodeETH: [BigInt!]!
userETH: BigInt!
# On what block number was this interval created.
block: BigInt!
# At what time was this interval created.
blockTime: BigInt!
}
# Represents the RPL reward claimer options.
enum RPLRewardClaimerType {
PDAO
ODAO
Node
}
# Represents an RPL reward that has been claimed by an address.
type RPLRewardClaim @entity {
# Composite key based on transaction hash of the triggered event and its log index.
id: ID!
# Id of the associated RPL reward interval parent.
rplRewardIntervalId: String!
# The claiming address.
claimer: String!
# The type of the claimer.
claimerType: RPLRewardClaimerType!
# The total RPL amount of this claim.
amount: BigInt!
# The total ETH equivalent (in WEI) at the time of this reward.
ethAmount: BigInt!
# The transaction hash associated with this claim.
transactionHash: String!
# The block number associated with this claim.
block: BigInt!
# The block timestamp associated with this claim.
blockTime: BigInt!
}
# Represents the network timezones and the registered node(s).
type NetworkNodeTimezone @entity {
# Timezone name.
id: ID!
# Total nodes registered with this timezone.
totalRegisteredNodes: BigInt!
# Block Number on which this timezone was created.
block: BigInt!
# Block Timestamp on which this timezone was created.
blockTime: BigInt!
}
# Represents a network balance checkpoint for all nodes.
type NetworkNodeBalanceCheckpoint @entity {
# Composite key based on transaction hash of the triggered event and its log index.
id: ID!
# Id to the the previous checkpoint.
previousCheckpointId: String
# Id to the the next checkpoint.
nextCheckpointId: String
# Total number of registered RocketPool nodes at this checkpoint.
nodesRegistered: BigInt!
# Total number of oracle nodes registrered with RocketPool at this checkpoint.
oracleNodesRegistered: BigInt!
# RPL staked accross all nodes at this checkpoint.
rplStaked: BigInt!
# Effective RPL staked accross all nodes at this checkpoint.
effectiveRPLStaked: BigInt!
# Minimum RPL needed to collateralize the staking minipools by the absolute minimum at this checkpoint.
minimumEffectiveRPL: BigInt!
# maximum RPL needed to collateralize the staking minipools to the absolute maximum at this checkpoint.
maximumEffectiveRPL: BigInt!
# Minimum RPL needed to start a new minipool at this checkpoint.
minimumEffectiveRPLNewMinipool: BigInt!
# Maximum RPL needed to start a new minipool at this checkpoint.
maximumEffectiveRPLNewMinipool: BigInt!
# Total RPL slashed from all previous checkpoints up to this checkpoint.
totalRPLSlashed: BigInt!
# Total accrued rewards via the ODAO reward claim contract from all previous checkpoints up to this checkpoint.
totalODAORewardsClaimed: BigInt!
# Total accrued rewards via the regular node reward claim contract from all previous checkpoints up to this checkpoint.
totalNodeRewardsClaimed: BigInt!
# Average total accrued rewards via the ODAO reward claim contract from all previous checkpoints up to this checkpoint.
averageTotalODAORewardsClaimed: BigInt!
# Average reward per claim via the ODAO reward claim contract from all previous checkpoints up to this checkpoint.
averageODAORewardClaim: BigInt!
# Average total accrued rewards via the regular node reward claim contract from all previous checkpoints up to this checkpoint.
averageNodeTotalRewardsClaimed: BigInt!
# Average reward per claim via the regular node reward claim contract from all previous checkpoints up to this checkpoint.
averageNodeRewardClaim: BigInt!
# The RPL price in ETH at this checkpoint.
rplPriceInETH: BigInt!
# The average RPL price in ETH up to this checkpoint.
averageRplPriceInETH: BigInt!
# Current queued minipools accross all nodes at this checkpoint.
queuedMinipools: BigInt!
# Current staking minipools accross all nodes at this checkpoint.
stakingMinipools: BigInt!
# Current unbonded staking minipools accross all nodes at this checkpoint.
stakingUnbondedMinipools: BigInt!
# Withdrawable minipools accross all nodes at this checkpoint.
withdrawableMinipools: BigInt!
# Total finalized minipools accross all nodes up to this checkpoint.
totalFinalizedMinipools: BigInt!
# Average minipool fee accross all nodes and the active (NOT finalized or destroyed) minipools at this checkpoint.
averageFeeForActiveMinipools: BigInt!
# Fee to start a new minipool at this checkpoint.
newMinipoolFee: BigInt!
# Block number that was associated with this checkpoint.
block: BigInt!
# Block timestamp that was associated with this checkpoint.
blockTime: BigInt!
}
# Represents a balance checkpoint for a node.
type NodeBalanceCheckpoint @entity {
# Composite key consisting of the NetworkNodeBalanceCheckpoint ID and the Node ID.
id: ID!
# Node that is associated with this checkpoint.
Node: Node!
# Network node balance checkpoint associated with this checkpoint.
NetworkNodeBalanceCheckpoint: NetworkNodeBalanceCheckpoint!
# Indicator that determines if a node is an oracle node or not at this checkpoint.
isOracleNode: Boolean!
# If this node is an oracle node at this checkpoint, signifies the RPL bond of the ODAO node.
oracleNodeRPLBond: BigInt
# Identifies the block time of the last ODAO state change for this node at this checkpoint.
oracleNodeBlockTime: BigInt
# RPL staked at this checkpoint.
rplStaked: BigInt!
# Effective RPL staked at this checkpoint.
effectiveRPLStaked: BigInt!
# Minimum RPL needed to collateralize the staking minipools by the bare minimum at this checkpoint.
minimumEffectiveRPL: BigInt!
# Maximum RPL needed to collateralize the staking minipools by the absolute maximum at this checkpoint.
maximumEffectiveRPL: BigInt!
# Total RPL slashed up to this checkpoint.
totalRPLSlashed: BigInt!
# Total accrued rewards via the ODAO reward claim contract up to this checkpoint.
totalODAORewardsClaimed: BigInt!
# Total accrued claimed rewards via the regular node reward claim contract up to this checkpoint.
totalNodeRewardsClaimed: BigInt!
# Average rewards accrued via the ODAO reward claim contract for this node up to this checkpoint.
averageODAORewardClaim: BigInt!
# Average rewards accrued via the regular node reward claim contract for this node up to this checkpoint.
averageNodeRewardClaim: BigInt!
# Total successfull claims a node has done via the ODAO reward claim contract up to this checkpoint.
odaoRewardClaimCount: BigInt!
# Total successfull claims a node has done via the regular node reward claim contract up to this checkpoint.
nodeRewardClaimCount: BigInt!
# Queued minipools for this node at this checkpoint.
queuedMinipools: BigInt!
# Staking minipools for this node at this checkpoint.
stakingMinipools: BigInt!
# Unbonded staking minipools for this node at this checkpoint.
stakingUnbondedMinipools: BigInt!
# Withdrawable minipools accross for this node at this checkpoint.
withdrawableMinipools: BigInt!
# Total Finalized minipools for this node up to this checkpoint.
totalFinalizedMinipools: BigInt!
# Average minipool fee for this node and the active (NOT finalized or destroyed) minipools at this checkpoint.
averageFeeForActiveMinipools: BigInt!
# Block number that was associated with this checkpoint.
block: BigInt!
# Block timestamp that was associated with this checkpoint.
blockTime: BigInt!
}
# Represents a minipool for a node.
type Minipool @entity {
# Address of the minipool.
id: ID!
# Node that is associated with this minipool.
node: Node!
# Fee that was assigned to this minipool when it was created.
fee: BigInt!
# Node deposit ETH amount (in WEI) that was assigned to this minipool when it was created.
nodeDepositETHAmount: BigInt!
# Block timestamp at which this minipool received a node deposit.
nodeDepositBlockTime: BigInt!
# User deposit ETH amount (in WEI) that was assigned to this minipool.
userDepositETHAmount: BigInt!
# Block timestamp at which this minipool received a user deposit.
userDepositBlockTime: BigInt!
# Block timestamp at which this minipool was queued.
queuedBlockTime: BigInt!
# Block timestamp at which this minipool was dequeued.
dequeuedBlockTime: BigInt!
# Block timestamp at which this minipool was destroyed.
destroyedBlockTime: BigInt!
# Block number at which this minipool transitioned to the staking state.
stakingBlockTime: BigInt!
# Block timestamp at which this minipool was marked as withdrawable.
withdrawableBlockTime: BigInt!
# Block timestamp at which this minipool was marked as finalized.
finalizedBlockTime: BigInt!
}