-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
48 lines (43 loc) · 1.03 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
type Account @entity(immutable: true) {
id: Bytes!
createdBuckets: [Bucket!]! @derivedFrom(field: "creator")
investments: [Investment!]! @derivedFrom(field: "investor")
withdrawals: [Withdrawal!]! @derivedFrom(field: "investor")
}
type TokenAllocation @entity(immutable: true) {
id: ID!
token: Bytes!
weightage: BigInt!
}
type Bucket @entity(immutable: true) {
id: Bytes!
creator: Account!
name: String!
description: String!
tokenURI: String!
createdAt: BigInt!
tokenAllocations: [TokenAllocation!]!
investments: [Investment!]! @derivedFrom(field: "bucket")
withdrawals: [Withdrawal!]! @derivedFrom(field: "bucket")
}
type Allocation @entity(immutable: true) {
id: ID!
token: Bytes!
amount: BigInt!
}
type Investment @entity(immutable: true) {
id: ID!
bucket: Bucket!
investor: Account!
investmentToken: Bytes!
investmentAmount: BigInt!
allocations: [Allocation!]!
investedAt: BigInt!
}
type Withdrawal @entity(immutable: true) {
id: ID!
bucket: Bucket!
investor: Account!
amounts: [Allocation!]!
withdrawnAt: BigInt!
}