-
Notifications
You must be signed in to change notification settings - Fork 14
/
schema.graphql
421 lines (316 loc) · 9.44 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
enum PrizePoolState {
Opened
Started
Awarded
}
enum PrizePoolType {
Compound
yVault
Stake
YieldSource
}
# ID: `${comptroller.address}`
type Comptroller @entity {
id: ID!
owner: Bytes!
players: [DripTokenPlayer!]! @derivedFrom(field: "comptroller")
balanceDrips: [BalanceDrip!]! @derivedFrom(field: "comptroller")
volumeDrips: [VolumeDrip!]! @derivedFrom(field: "comptroller")
}
# id `streamId`
type SablierStream @entity {
id: ID!
prizePool: PrizePool!
}
# ID: `${prizePool.address}`
type PrizePool @entity {
id: ID!
deactivated: Boolean!
owner: Bytes
reserveRegistry: Bytes
prizeStrategy: PrizeStrategy
prizePoolType: PrizePoolType
compoundPrizePool: CompoundPrizePool
stakePrizePool: StakePrizePool
yieldSourcePrizePool: YieldSourcePrizePool
reserveFeeControlledToken: Bytes!
sablierStream: SablierStream @derivedFrom(field: "prizePool")
underlyingCollateralToken: Bytes
underlyingCollateralDecimals: BigInt
underlyingCollateralName: String
underlyingCollateralSymbol: String
maxExitFeeMantissa: BigInt!
liquidityCap: BigInt!
cumulativePrizeGross: BigInt!
cumulativePrizeReserveFee: BigInt!
cumulativePrizeNet: BigInt!
currentPrizeId: BigInt!
currentState: PrizePoolState!
prizes: [Prize!]! @derivedFrom(field: "prizePool")
tokenCreditRates: [CreditRate!]! @derivedFrom(field: "prizePool")
tokenCreditBalances: [CreditBalance!]! @derivedFrom(field: "prizePool")
prizePoolAccounts: [PrizePoolAccount!]! @derivedFrom(field: "prizePool")
controlledTokens: [ControlledToken!]! @derivedFrom(field: "controller") # controlled tokens may not exist until transfer is called
}
# ID: `${compoundPrizePool.address}`
type CompoundPrizePool @entity {
id: ID!
cToken: Bytes
}
# ID: `${stakePrizePool.address}`
type StakePrizePool @entity {
id: ID!
stakeToken: Bytes # ! ?
}
# ID: `${yieldSourcePrizePool.address}`
type YieldSourcePrizePool @entity {
id: ID!
yieldSource: Bytes # ! ?
}
# ID: `${prizeStrategy.address}`
type PrizeStrategy @entity {
id: ID!
singleRandomWinner: SingleRandomWinnerPrizeStrategy
multipleWinners: MultipleWinnersPrizeStrategy
}
# ID: `${singleRandomWinner.address}` (will be same address as PrizeStrategy)
type SingleRandomWinnerPrizeStrategy @entity {
id: ID!
owner: Bytes
tokenListener: Comptroller
prizePool: PrizePool
rng: Bytes
ticket: ControlledToken
sponsorship: ControlledToken
prizePeriodSeconds: BigInt!
prizePeriodStartedAt: BigInt!
prizePeriodEndAt: BigInt!
externalErc20Awards: [SingleRandomWinnerExternalErc20Award!]! @derivedFrom(field: "prizeStrategy")
externalErc721Awards: [SingleRandomWinnerExternalErc721Award!]! @derivedFrom(field: "prizeStrategy")
}
# ID: `${prizePool.address}-${prizeCount}`
# dynamically generated type, not mapped to a specific contract
type Prize @entity {
id: ID!
prizePool: PrizePool!
awardStartOperator: Bytes
awardedOperator: Bytes
prizePeriodStartedTimestamp: BigInt
lockBlock: BigInt
awardedBlock: BigInt
awardedTimestamp: BigInt
rngRequestId: BigInt
randomNumber: BigInt
numberOfSubWinners: BigInt
numberOfExternalAwardedErc20Winners: BigInt
totalTicketSupply: BigInt # cache of num tickets sold when this prize was awarded
awardedControlledTokens: [AwardedControlledToken!]! @derivedFrom(field: "prize")
awardedExternalErc20Tokens: [AwardedExternalErc20Token!]! @derivedFrom(field: "prize")
awardedExternalErc721Nfts: [AwardedExternalErc721Nft!]! @derivedFrom(field: "prize")
}
# ID: `${prizePool.id}-${winner}`
type AwardedControlledToken @entity {
id: ID!
winner: Bytes!
amount: BigInt!
token: ControlledToken!
prize: Prize!
}
# ID: `${prize.id}-${token.address} -${winnerAddress} -{Prize::winnerIndex}`
# dynamically generated type, not mapped to a specific contract
type AwardedExternalErc20Token @entity {
id: ID!
address: Bytes!
name: String
symbol: String
decimals: BigInt
balanceAwarded: BigInt
prize: Prize!
winner: Bytes
}
# ID: `${prize.id}-${token.address}`
# dynamically generated type, not mapped to a specific contract
type AwardedExternalErc721Nft @entity {
id: ID!
address: Bytes!
tokenIds: [BigInt!]
prize: Prize
winner: Bytes
}
# ID: `${controlledToken.address}`
type ControlledToken @entity {
id: ID!
name: String!
symbol: String!
decimals: BigInt
controller: PrizePool
totalSupply: BigInt!
numberOfHolders: BigInt!
balances: [ControlledTokenBalance!]! @derivedFrom(field:"controlledToken")
}
type ControlledTokenBalance @entity {
id: ID! # composite key of (address, controlledToken)
account: Account!
controlledToken: ControlledToken!
balance: BigInt
}
# ID: `${prizeStrategy.address}-${token.address}`
# dynamically generated type, not mapped to a specific contract
type SingleRandomWinnerExternalErc20Award @entity {
id: ID!
address: Bytes!
name: String
symbol: String
decimals: BigInt
prizeStrategy: SingleRandomWinnerPrizeStrategy
}
# ID: `${prizeStrategy.address}-${token.address}`
# dynamically generated type, not mapped to a specific contract
type SingleRandomWinnerExternalErc721Award @entity {
id: ID!
address: Bytes!
tokenIds: [BigInt!]
prizeStrategy: SingleRandomWinnerPrizeStrategy
}
# join table
type PrizePoolAccount @entity{
id: ID! #composite prizerpool id - accountid
prizePool: PrizePool!
account: Account!
}
# id address
type Account @entity {
id: ID!
prizePoolAccounts: [PrizePoolAccount!]! @derivedFrom(field: "account")
controlledTokenBalances: [ControlledTokenBalance!] @derivedFrom(field: "account")
}
# ID: `${prizePool.address}-${controlledToken.address}`
# dynamically generated type, not mapped to a specific contract
type CreditRate @entity {
id: ID!
prizePool: PrizePool!
creditLimitMantissa: BigInt!
creditRateMantissa: BigInt!
}
# ID: `${prizePool.address}-${controlledToken.address}`
# dynamically generated type, not mapped to a specific contract
type CreditBalance @entity {
id: ID!
prizePool: PrizePool!
balance: BigInt
timestamp: BigInt
initialized: Boolean
}
# ID: `${comptroller.address}-${dripToken.address}-${player.address}`
# dynamically generated type, not mapped to a specific contract
type DripTokenPlayer @entity {
id: ID!
comptroller: Comptroller!
dripToken: Bytes!
address: Bytes!
# claimable balance
balance: BigInt!
}
# ID: `${balanceDripId}-${player.address}`
# dynamically generated type, not mapped to a specific contract
type BalanceDripPlayer @entity {
id: ID!
balanceDrip: BalanceDrip!
address: Bytes!
}
# ID: `${comptroller.address}-${sourceToken.address}-${measureToken.address}-${dripToken.address}`
# dynamically generated type, not mapped to a specific contract
type BalanceDrip @entity {
id: ID!
comptroller: Comptroller!
sourceAddress: Bytes!
measureToken: Bytes!
dripToken: Bytes!
dripRatePerSecond: BigInt
exchangeRateMantissa: BigInt
timestamp: BigInt
players: [BalanceDripPlayer!]! @derivedFrom(field: "balanceDrip")
deactivated: Boolean!
}
# ID: `${volumeDripId}-${player.address}`
# dynamically generated type, not mapped to a specific contract
type VolumeDripPlayer @entity {
id: ID!
volumeDrip: VolumeDrip!
address: Bytes!
periodIndex: BigInt!
balance: BigInt!
}
# ID: `${volumeDripId}-${periodIndex}`
# dynamically generated type, not mapped to a specific contract
type VolumeDripPeriod @entity {
id: ID!
volumeDrip: VolumeDrip!
periodIndex: BigInt!
totalSupply: BigInt
dripAmount: BigInt
endTime: BigInt
isDripping: Boolean!
}
# ID: `${comptroller.address}-${sourceToken.address}-${measureToken.address}-${dripToken.address}-${isReferral}`
# dynamically generated type, not mapped to a specific contract
type VolumeDrip @entity {
id: ID!
comptroller: Comptroller!
sourceAddress: Bytes!
measureToken: Bytes!
dripToken: Bytes!
referral: Boolean!
periodSeconds: BigInt
dripAmount: BigInt
periodCount: BigInt
deposits: [VolumeDripPlayer!]! @derivedFrom(field: "volumeDrip")
periods: [VolumeDripPeriod!]! @derivedFrom(field: "volumeDrip")
deactivated: Boolean!
}
# id address of prizeStrategy
type MultipleWinnersPrizeStrategy @entity {
id: ID!
owner: Bytes
numberOfWinners: BigInt
splitExternalERC20Awards: Boolean
tokenListener: Bytes
prizePool: PrizePool
rng: Bytes
ticket: ControlledToken
sponsorship: ControlledToken
prizePeriodSeconds: BigInt!
prizePeriodStartedAt: BigInt!
prizePeriodEndAt: BigInt!
prizeSplits: [PrizeSplit!] @derivedFrom(field: "prizeStrategy")
blockListedAddresses: [Bytes!]
externalErc20Awards: [MultipleWinnersExternalErc20Award!]! @derivedFrom(field: "prizeStrategy")
externalErc721Awards: [MultipleWinnersExternalErc721Award!]! @derivedFrom(field: "prizeStrategy")
}
# ID: prizeStrategy.address-index
type PrizeSplit @entity{
id: ID!
percentage: BigInt!
target: Bytes!
tokenType: BigInt! # 0 or 1 (sponsorship or ticket)
prizeStrategy: MultipleWinnersPrizeStrategy
}
# ID: `${prizeStrategy.address}-${token.address}`
# dynamically generated type, not mapped to a specific contract
type MultipleWinnersExternalErc20Award @entity {
id: ID!
address: Bytes!
name: String
symbol: String
decimals: BigInt
balanceAwarded: BigInt
prizeStrategy: MultipleWinnersPrizeStrategy
}
# ID: `${prizeStrategy.address}-${token.address}`
# dynamically generated type, not mapped to a specific contract
type MultipleWinnersExternalErc721Award @entity {
id: ID!
address: Bytes!
tokenIds: [BigInt!]
prizeStrategy: MultipleWinnersPrizeStrategy
}