-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
775 lines (533 loc) · 16.3 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
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
enum PoolStatus {
PoolOpen
FundingDeal
DealOpen
}
enum DealType {
UpfrontDeal
SponsorDeal
}
enum NotificationType {
InvestmentWindowAlert
InvestmentWindowEnded
DealProposed
HolderSet
SponsorFeesReady
VestingCliffBegun
WithdrawUnredeemed
DealTokensVestingBegun
AllDealTokensVested
FundingWindowAlert
FundingWindowEnded
DealNotFunded
UpfrontDealFullyFunded
HolderClaimFunds
AcceptanceWindowAlert
AcceptanceWindowEnded
}
enum NotificationTarget {
DealInvestor
PoolInvestor
Sponsor
Holder
}
enum NFTType {
ERC721
ERC1155
}
type PoolCreated @entity {
" the address of the pool "
id: ID!
dealType: DealType!
" represents the pool token name `aePool-${name}` "
name: String!
" represents the pool token symbol `aeP-${symbol}` "
symbol: String!
" the cap on the amount of purchase tokens in the pool. If 0 - that means uncapped "
purchaseTokenCap: BigInt!
" the address of the purchase token "
purchaseToken: Bytes!
" the symbol of the purchase token "
purchaseTokenSymbol: String!
" the duration of the pool assuming no deal is presented when purchasers can withdraw all of their locked funds "
duration: BigInt!
" the fee paid to the sponsor when a purchaser accepts a deal "
sponsorFee: BigInt!
" the address of the sponsor for fee payments. only the msg.sender of the createPool method can be the sponsor "
sponsor: Bytes!
" the amount of time a purchaser gets to enter. After which the purchase period is locked. "
purchaseDuration: BigInt
" the timestamp a purchaser can no longer enter the pool. After which the purchase period is locked. "
purchaseExpiry: BigInt
" the number of decimals on the purchase token "
purchaseTokenDecimals: Int
" the block timestamp when the pool was created"
timestamp: BigInt!
" if there is an allow list on the pool "
hasAllowList: Boolean!
" the current status of the pool "
poolStatus: PoolStatus!
" the total amount of contributions to the pool "
contributions: BigInt!
" the total supply of pool tokens "
totalSupply: BigInt!
" the address of the current proposed deal on the pool "
dealAddress: Bytes
" details of the created deal "
deal: Deal
totalAmountAccepted: BigInt!
totalAmountFunded: BigInt!
totalAmountWithdrawn: BigInt!
totalAmountEarnedBySponsor: BigInt!
dealsCreated: Int!
vestingStarts: BigInt
vestingEnds: BigInt
holder: Bytes!
"poolName-sponsorAddress-purchaseTokenSymbol"
filter: String!
totalUsersInvested: Int!
totalAddressesInvested: [String!]!
hasNftList: Boolean!
nftCollectionRules: [NftCollectionRule!]!
" details of the created upfront deal "
upfrontDeal: UpfrontDeal
totalVouchers: Int!
vouchers: [String!]!
}
type TotalPoolsCreated @entity {
" the id is always just 1 "
id: ID!
" the number of pools created - we use this for pagination "
count: BigInt!
}
type PurchasePoolToken @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the address of the pool token purchaser "
purchaser: Bytes!
" the address of the pool "
poolAddress: Bytes!
" the amount of purchase tokens spent "
purchaseTokenAmount: BigInt!
" the timestamp the purchase was made "
timestamp: BigInt!
}
type WithdrawFromPool @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the address of the pool token purchaser "
purchaser: Bytes!
" the address of the pool "
poolAddress: Bytes!
" the amount of purchase tokens spent "
purchaseTokenAmount: BigInt!
}
type AcceptDeal @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the address of the deal token purchaser "
purchaser: Bytes!
" the address of the pool "
poolAddress: Bytes!
" the address of the deal "
dealAddress: Bytes!
" the fee going to the sponsor "
sponsorFee: BigInt!
" the fee going to Aelin stakers "
aelinFee: BigInt!
" the amount of pool tokens spent. will also equal the amount of deal tokens received "
poolTokenAmount: BigInt!
}
type DealCreated @entity {
" the address of the deal "
id: ID!
" the name of the deal "
name: String!
" the symbol of the deal "
symbol: String!
" the address of the pool "
poolAddress: Bytes!
" the address of the sponsor "
sponsor: Bytes!
}
type DealDetail @entity {
" the address of the deal "
id: ID!
" the underlying deal token address "
underlyingDealToken: Bytes!
" the underlying deal token symbol "
underlyingDealTokenSymbol: String!
" the underlying deal token decimals "
underlyingDealTokenDecimals: Int!
" the underlying deal token totalSupply "
underlyingDealTokenTotalSupply: BigInt!
" the total amount of purchse tokens for the deal "
purchaseTokenTotalForDeal: BigInt!
" the total amount of underlying deal tokens available for the deal "
underlyingDealTokenTotal: BigInt!
" the vesting period which is linear for all deals in v1 "
vestingPeriod: BigInt!
" the vesting cliff after which linear vesting starts "
vestingCliff: BigInt!
" the initial period in which a deal can be accepted by the purchaser according to their pro rata ownership of the deal "
proRataRedemptionPeriod: BigInt!
" the timestamp when the pro rata redemption period starts "
proRataRedemptionPeriodStart: BigInt
" after the pro rata period, anyone who maxxed out their contribution during the pro rata period can now use their remaining pool shares to buy deal tokens until the deal is full "
openRedemptionPeriod: BigInt!
" the address of the holder of the underlying deal tokens who is receiving the underlying purchaser tokens "
holder: Bytes!
" is the deal fully funded "
isDealFunded: Boolean!
" the exipration of the holder funding period "
holderFundingExpiration: BigInt!
" the duration of the holder funding period "
holderFundingDuration: BigInt!
}
type SetSponsor @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the address of the new sponsor "
sponsor: Bytes!
}
type SetHolder @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the address of the new holder "
holder: Bytes!
}
type AelinToken @entity {
" the address the token "
id: ID!
" the name of the token "
name: String!
" the symbol of the token "
symbol: String!
" the number of decimals of the token "
decimals: Int!
}
type DealFullyFunded @entity {
" the address of the deal "
id: ID!
" the address of the pool "
poolAddress: Bytes!
" the start of the pro rata redemption period "
proRataRedemptionStart: BigInt!
" the start of the open redemption period "
openRedemptionStart: BigInt!
" the end of the pro rata redemption period "
proRataRedemptionExpiry: BigInt!
" the end of the open redemption period "
openRedemptionExpiry: BigInt!
}
type DepositDealToken @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the address of the underlying deal token "
underlyingDealTokenAddress: Bytes!
" the address of the depositor "
depositor: Bytes!
" the address of the deal contract "
dealContract: Bytes!
" the amount of underlying deal tokens deposited "
underlyingDealTokenAmount: BigInt!
}
type WithdrawUnderlyingDealToken @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the address of the underlying deal token "
underlyingDealTokenAddress: Bytes!
" the address of the depositor "
depositor: Bytes!
" the address of the deal contract "
dealContract: Bytes!
" the amount of underlying deal tokens deposited "
underlyingDealTokenAmount: BigInt!
}
type Transfer @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the sender "
from: Bytes!
" the recipient "
to: Bytes!
" the amount sent "
value: BigInt!
}
type ClaimedUnderlyingDealToken @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the address of the underlying deal token "
underlyingDealTokenAddress: Bytes!
" address of the claim recipient. when sending deal tokens, both the sender and recipient need to claim their vested tokens; gas fees are paid by the sender "
recipient: Bytes!
" the number of underlying deal tokens claimed "
underlyingDealTokensClaimed: BigInt!
" the address of the deal contract "
dealAddress: Bytes!
}
type VestingDeal @entity {
" userAddress - dealAddress "
id: ID!
user: User!
poolName: String!
tokenToVest: Bytes!
tokenToVestSymbol: String!
investorDealTotal: BigInt!
" Should be removed since this value changes with time "
remainingAmountToVest: BigInt!
totalVested: BigInt!
vestingPeriodEnds: BigInt!
vestingPeriodStarts: BigInt!
poolAddress: Bytes!
underlyingDealTokenDecimals: Int!
pool: PoolCreated!
"timestamp of the last time the user claimed"
lastClaim: BigInt!
}
type TotalDealsBySponsor @entity {
" sponsor address "
id: ID!
" number of deals created "
count: Int!
}
type Deposit @entity {
" the transaction hash + event log index of the PurchasePoolTokenEvent event "
id: ID!
" the address of user depositing "
userAddress: Bytes!
" the block timestamp when the user deposited"
timestamp: BigInt!
poolName: String!
sponsor: Bytes!
" amount of purchase tokens deposited "
amountDeposited: BigInt!
" pool where the funds are deposited "
pool: PoolCreated!
}
type UserAllocationStat @entity {
" userAddress - poolAddress "
id: ID!
userAddress: Bytes!
totalWithdrawn: BigInt!
totalAccepted: BigInt!
poolTokenBalance: BigInt!
remainingProRataAllocation: BigInt!
pool: PoolCreated!
}
type DealAccepted @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
" the address of user accepting the deal "
userAddress: Bytes!
" the block timestamp when the user deposited"
timestamp: BigInt!
poolName: String!
" amount of purchase tokens invested "
investmentAmount: BigInt!
" amount of deal tokens "
dealTokenAmount: BigInt!
" pool where the funds are deposited "
pool: PoolCreated!
}
type DealSponsored @entity {
" poolAddress + sponsorAddress"
id: ID!
" the address of the sponsor "
sponsor: Bytes!
" the block timestamp when the user deposited"
timestamp: BigInt!
" represents the pool token name `aePool-${name}` "
poolName: String!
amountEarned: BigInt!
totalAccepted: BigInt!
totalInvested: BigInt!
sponsorFee: BigInt!
pool: PoolCreated!
}
type Vest @entity {
" the transaction hash + event log index of the purchase event "
id: ID!
poolName: String!
" the address of user depositing "
userAddress: Bytes!
" the block timestamp when the user deposited"
timestamp: BigInt!
amountVested: BigInt!
pool: PoolCreated!
}
type DealFunded @entity {
" the transaction hash + event log index "
id: ID!
holder: Bytes!
timestamp: BigInt!
poolName: String!
amountRaised: BigInt!
purchaseTokenSymbol: String!
purchaseTokenDecimals: Int!
amountFunded: BigInt!
underlyingDealTokenSymbol: String!
underlyingDealTokenDecimals: Int!
pool: PoolCreated!
}
type Withdraw @entity {
" the transaction hash + event log index of the WithdrawFromPoolEvent event "
id: ID!
" the address of user withdrawing "
userAddress: Bytes!
" the block timestamp when the user withdrew"
timestamp: BigInt!
poolName: String!
" withdrawn amount of purchase tokens "
amountWithdrawn: BigInt!
" pool where the funds are withdrawn "
sponsorFee: BigInt!
pool: PoolCreated!
}
type Deal @entity {
" the address of the deal "
id: ID!
" the name of the deal "
name: String!
" the symbol of the deal "
symbol: String!
" the address of the pool "
poolAddress: Bytes!
" the underlying deal token address "
underlyingDealToken: Bytes!
" the underlying deal token symbol "
underlyingDealTokenSymbol: String!
" the underlying deal token decimals "
underlyingDealTokenDecimals: Int!
" the underlying deal token totalSupply "
underlyingDealTokenTotalSupply: BigInt!
" the total amount of purchse tokens for the deal "
purchaseTokenTotalForDeal: BigInt!
" the total amount of underlying deal tokens available for the deal "
underlyingDealTokenTotal: BigInt!
" the vesting period which is linear for all deals in v1 "
vestingPeriod: BigInt!
" the vesting cliff after which linear vesting starts "
vestingCliff: BigInt!
vestingPeriodStarts: BigInt!
" the initial period in which a deal can be accepted by the purchaser according to their pro rata ownership of the deal "
proRataRedemptionPeriod: BigInt!
" the timestamp when the pro rata redemption period starts "
proRataRedemptionPeriodStart: BigInt
" after the pro rata period, anyone who maxxed out their contribution during the pro rata period can now use their remaining pool shares to buy deal tokens until the deal is full "
openRedemptionPeriod: BigInt!
" the start of the pro rata redemption period "
proRataRedemptionStart: BigInt!
" the start of the open redemption period "
openRedemptionStart: BigInt!
" the end of the pro rata redemption period "
proRataRedemptionExpiry: BigInt!
" the end of the open redemption period "
openRedemptionExpiry: BigInt!
" the address of the holder of the underlying deal tokens who is receiving the underlying purchaser tokens "
holder: Bytes!
" is the deal fully funded "
isDealFunded: Boolean!
" the exipration of the holder funding period "
holderFundingExpiration: BigInt!
" the duration of the holder funding period "
holderFundingDuration: BigInt!
underlyingPerDealExchangeRate: BigInt!
totalAmountUnredeemed: BigInt!
" the block timestamp when the deal was created"
timestamp: BigInt!
dealFundedAt: BigInt!
totalUsersAccepted: Int!
totalUsersRejected: Int!
maxDealTotalSupply: BigInt!
}
type UpfrontDeal @entity {
" the address of the deal "
id: ID!
" the name of the deal "
name: String!
" the symbol of the deal "
symbol: String!
" the underlying deal token address "
underlyingDealToken: Bytes!
" the underlying deal token symbol "
underlyingDealTokenSymbol: String!
" the underlying deal token decimals "
underlyingDealTokenDecimals: Int!
" the underlying deal token totalSupply "
underlyingDealTokenTotalSupply: BigInt!
" the total amount of purchse tokens for the deal "
purchaseTokenTotalForDeal: BigInt!
" the total amount of underlying deal tokens available for the deal "
underlyingDealTokenTotal: BigInt!
" the vesting period which is linear for all deals in v1 "
vestingPeriod: BigInt!
" the address of the holder of the underlying deal tokens who is receiving the underlying purchaser tokens "
holder: Bytes!
maxDealTotalSupply: BigInt!
purchaseTokenPerDealToken: BigInt!
purchaseRaiseMinimum: BigInt!
vestingCliffPeriod: BigInt!
allowDeallocation: Boolean!
dealStart: BigInt
totalAmountUnredeemed: BigInt!
holderClaim: Boolean
sponsorClaim: Boolean
totalRedeemed: BigInt!
totalUsersAccepted: Int!
remainingDealTokens: BigInt!
merkleRoot: Bytes
ipfsHash: String
}
type History @entity {
"userAddress"
id: ID!
user: User!
deposits: [Deposit!]!
dealsAccepted: [DealAccepted!]!
withdraws: [Withdraw!]!
vests: [Vest!]!
dealsSponsored: [DealSponsored!]!
dealsFunded: [DealFunded!]!
}
type User @entity {
"userAddress"
id: ID!
history: History! @derivedFrom(field: "user")
poolsVouched: [PoolCreated!]!
poolsVouchedAmt: Int!
poolsInvested: [PoolCreated!]!
poolsInvestedAmt: Int!
poolsSponsored: [PoolCreated!]!
poolsSponsoredAmt: Int!
poolsAsHolder: [PoolCreated!]!
poolsAsHolderAmt: Int!
dealsAccepted: [DealAccepted!]!
dealsAcceptedAmt: Int!
upfrontDealsAccepted: [PoolCreated!]!
upfrontDealsAcceptedAmt: Int!
vestingDeals: [VestingDeal!]! @derivedFrom(field: "user")
allocationsStat: [UserAllocationStat!]!
}
type Notification @entity {
"poolAddress - NotificationType"
id: ID!
type: NotificationType!
message: String!
pool: PoolCreated!
triggerStart: BigInt!
triggerEnd: BigInt!
target: NotificationTarget!
}
type NftCollectionRule @entity {
"poolAddress - collectionAddress"
id: ID!
poolAddress: Bytes!
nftType: NFTType!
collectionAddress: Bytes!
purchaseAmount: BigInt!
purchaseAmountPerToken: Boolean!
erc1155TokenIds: [BigInt!]!
erc721Blacklisted: [BigInt!]!
erc1155TokensAmtEligible: [BigInt!]!
}