-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
291 lines (264 loc) · 7.76 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
# AUTOGENERATED USING build.sh DO NOT EDIT THIS VERSION
"""
Links all our contracts to individual ethereum accounts so they can be queried as a list
"""
type Account @entity {
id: Bytes!
asERC20: ERC20Contract
ERC20balances: [ERC20Balance!]! @derivedFrom(field: "account")
ERC20approvalsOwner: [ERC20Approval!]! @derivedFrom(field: "owner")
ERC20approvalsSpender: [ERC20Approval!]! @derivedFrom(field: "spender")
ERC20transferFromEvent: [ERC20Transfer!]! @derivedFrom(field: "from")
ERC20transferToEvent: [ERC20Transfer!]! @derivedFrom(field: "to")
asRollStaker: RollStakerContract
PRVStakingBalances: [PRVStakingBalance!]! @derivedFrom(field: "account")
PRVDepositEvent: [PRVDeposit!]! @derivedFrom(field: "receiver")
PRVWithdrawEvent: [PRVWithdraw!]! @derivedFrom(field: "receiver")
PRVExitEvent: [PRVExit!]! @derivedFrom(field: "receiver")
asTokenLocker: TokenLockerContract
ARVLocks: [ARVLock!]! @derivedFrom(field: "account")
ARVDeposits: [ARVDeposit!]! @derivedFrom(field: "owner")
ARVBoosts: [ARVBoostToMax!]! @derivedFrom(field: "owner")
ARVIncreaseAmounts: [ARVIncreaseAmount!]! @derivedFrom(field: "owner")
ARVIncreaseDurations: [ARVIncreaseDuration!]! @derivedFrom(field: "owner")
ARVWithdraws: [ARVWithdrawal!]! @derivedFrom(field: "owner")
ARVExits: [ARVEarlyExit!]! @derivedFrom(field: "owner")
ARVEjects: [ARVEject!]! @derivedFrom(field: "owner")
events: [Event!]! @derivedFrom(field: "emitter")
}
interface Event {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
}
type Transaction @entity(immutable: true) {
id: ID!
timestamp: BigInt!
blockNumber: BigInt!
events: [Event!]! @derivedFrom(field: "transaction")
}
type ERC20Contract @entity(immutable: true) {
id: Bytes!
asAccount: Account!
name: String
symbol: String
decimals: Int!
totalSupply: ERC20Balance!
balances: [ERC20Balance!]! @derivedFrom(field: "contract")
approvals: [ERC20Approval!]! @derivedFrom(field: "contract")
transfers: [ERC20Transfer!]! @derivedFrom(field: "contract")
}
type ERC20Balance @entity {
id: ID!
contract: ERC20Contract!
account: Account
value: BigDecimal!
valueExact: BigInt!
transferFromEvent: [ERC20Transfer!]! @derivedFrom(field: "fromBalance")
transferToEvent: [ERC20Transfer!]! @derivedFrom(field: "toBalance")
}
type ERC20Transfer implements Event @entity(immutable: true) {
id: ID!
emitter: Account!
transaction: Transaction!
timestamp: BigInt!
contract: ERC20Contract!
from: Account
fromBalance: ERC20Balance
to: Account
toBalance: ERC20Balance
value: BigDecimal!
valueExact: BigInt!
}
type ERC20Approval @entity {
id: ID!
contract: ERC20Contract!
owner: Account!
spender: Account!
value: BigDecimal!
valueExact: BigInt!
}
type RollStakerContract @entity(immutable: true) {
id: Bytes!
asAccount: Account!
currentEpochId: Int
stakingToken: ERC20Contract!
epochBalances: [BigInt!]
epochPendingBalance: BigInt
balances: [PRVStakingBalance!]! @derivedFrom(field: "contract")
deposits: [PRVDeposit!]! @derivedFrom(field: "contract")
withdraws: [PRVWithdraw!]! @derivedFrom(field: "contract")
exits: [PRVExit!]! @derivedFrom(field: "contract")
}
type PRVStakingBalance @entity {
id: ID!
contract: RollStakerContract!
account: Account!
value: BigDecimal!
valueExact: BigInt!
depositEvent: [PRVDeposit!]! @derivedFrom(field: "receiverBalance")
withdrawEvent: [PRVWithdraw!]! @derivedFrom(field: "receiverBalance")
exitEvent: [PRVExit!]! @derivedFrom(field: "receiverBalance")
}
type PRVDeposit implements Event @entity(immutable: true) {
id: ID!
emitter: Account!
transaction: Transaction!
timestamp: BigInt!
contract: RollStakerContract!
depositor: Account!
receiver: Account!
receiverBalance: PRVStakingBalance
epochDepositedAt: Int!
epochActiveFrom: Int!
value: BigDecimal!
valueExact: BigInt!
}
type PRVWithdraw implements Event @entity(immutable: true) {
id: ID!
emitter: Account!
transaction: Transaction!
timestamp: BigInt!
contract: RollStakerContract!
receiver: Account!
receiverBalance: PRVStakingBalance!
epoch: Int!
value: BigDecimal!
valueExact: BigInt!
}
type PRVExit implements Event @entity(immutable: true) {
id: ID!
emitter: Account!
transaction: Transaction!
timestamp: BigInt!
contract: RollStakerContract!
receiver: Account!
receiverBalance: PRVStakingBalance!
value: BigDecimal!
valueExact: BigInt!
epoch: Int!
}
type TokenLockerContract @entity(immutable: true) {
id: Bytes!
asAccount: Account!
veToken: ERC20Contract!
locks: [ARVLock!]! @derivedFrom(field: "contract")
deposits: [ARVDeposit!]! @derivedFrom(field: "contract")
boosts: [ARVBoostToMax!]! @derivedFrom(field: "contract")
increaseAmounts: [ARVIncreaseAmount!]! @derivedFrom(field: "contract")
increaseDurations: [ARVIncreaseDuration!]! @derivedFrom(field: "contract")
withdraws: [ARVWithdrawal!]! @derivedFrom(field: "contract")
exits: [ARVEarlyExit!]! @derivedFrom(field: "contract")
ejects: [ARVEject!]! @derivedFrom(field: "contract")
}
"""
Represents the current amount, duration and timestamp of a lock,
along with associated events
"""
type ARVLock @entity {
id: ID!
contract: TokenLockerContract!
account: Account
auxoValue: BigDecimal!
auxoValueExact: BigInt!
arvValue: BigDecimal!
arvValueExact: BigInt!
lockedAt: BigInt!
lockDuration: BigInt!
deposits: [ARVDeposit!]! @derivedFrom(field: "lock")
boosts: [ARVBoostToMax!]! @derivedFrom(field: "lock")
increaseAmounts: [ARVIncreaseAmount!]! @derivedFrom(field: "lock")
increaseDurations: [ARVIncreaseDuration!]! @derivedFrom(field: "lock")
withdraws: [ARVWithdrawal!]! @derivedFrom(field: "lock")
exits: [ARVEarlyExit!]! @derivedFrom(field: "lock")
ejects: [ARVEject!]! @derivedFrom(field: "lock")
}
type ARVDeposit implements Event @entity(immutable: true) {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
owner: Account!
contract: TokenLockerContract!
amount: BigDecimal!
amountExact: BigInt!
lockDuration: BigInt!
lock: ARVLock!
arvMinted: BigDecimal!
arvMintedExact: BigInt!
}
type ARVBoostToMax implements Event @entity(immutable: true) {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
contract: TokenLockerContract!
owner: Account!
amount: BigDecimal!
amountExact: BigInt!
lock: ARVLock!
arvMinted: BigDecimal!
arvMintedExact: BigInt!
}
type ARVIncreaseAmount implements Event @entity(immutable: true) {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
contract: TokenLockerContract!
owner: Account!
amount: BigDecimal!
amountExact: BigInt!
lock: ARVLock!
arvMinted: BigDecimal!
arvMintedExact: BigInt!
}
type ARVIncreaseDuration implements Event @entity(immutable: true) {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
contract: TokenLockerContract!
owner: Account!
amount: BigDecimal!
amountExact: BigInt!
lockDuration: BigInt!
lockedAt: BigInt!
lock: ARVLock!
arvMinted: BigDecimal!
arvMintedExact: BigInt!
}
type ARVWithdrawal implements Event @entity(immutable: true) {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
contract: TokenLockerContract!
owner: Account!
amount: BigDecimal!
amountExact: BigInt!
lock: ARVLock!
}
type ARVEarlyExit implements Event @entity(immutable: true) {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
contract: TokenLockerContract!
owner: Account!
amount: BigDecimal!
amountExact: BigInt!
lock: ARVLock!
}
type ARVEject implements Event @entity(immutable: true) {
id: ID!
transaction: Transaction!
emitter: Account!
timestamp: BigInt!
owner: Account!
amount: BigDecimal!
amountExact: BigInt!
contract: TokenLockerContract
lock: ARVLock!
}