-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
74 lines (66 loc) · 1.8 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
type Cohort @entity {
id: ID!
address: Bytes! #address
chain: String! #string
deployer: Bytes! #address
dao: Bytes! #address
token: Bytes! #address
sbtUrl: String! #string
implementation: Bytes! #address
tokenAmount: BigInt! #uint256
sharesAmount: BigInt! #uint256
time: BigInt! #uint256 seconds for slash
treasury: Bytes! #address
createdAt: BigInt! #uint256 timestamp of creation
initiates: [Initiate!] @derivedFrom(field: "cohort")
criesForHelp: [CryForHelp!] @derivedFrom(field: "cohort")
claims: [Claim!] @derivedFrom(field: "cohort")
Sacrifices: [Sacrifice!] @derivedFrom(field: "cohort")
totalMembers: BigInt!
claimedMembers: BigInt!
slashedMembers: BigInt!
successPercentage: BigDecimal!
}
type Initiate @entity {
id: ID! #address + cohort (to support multiple cohorts per same address)
address: Bytes! #address
benefactor: Bytes! #address of sponsor (if no sponsor it == id)
tokenId: BigInt! #uint256 id of SBT
stake: BigInt! #uint256
deadline: BigInt! #uint256
joinedAt: BigInt! #uint256 block timestamp when joined
cohort: Cohort!
claimed: Boolean!
claim: Claim @derivedFrom(field: "initiate")
sacrificed: Boolean!
sacrifice: Sacrifice @derivedFrom(field: "initiate")
}
type CryForHelp @entity {
id: ID!
message: String!
sender: Initiate!
cohort: Cohort!
}
type Claim @entity {
id: ID!
initiate: Initiate!
amount: BigInt! #uint256
cohort: Cohort!
}
type Sacrifice @entity {
id: ID!
initiate: Initiate! # address
amount: BigInt! # uint256
slasher: Bytes! # address
cohort: Cohort!
}
type Metric @entity {
id: ID!
totalCohorts: BigInt! # uint256
totalMembers: BigInt!
claimedMembers: BigInt!
slashedMembers: BigInt!
slashRate: BigDecimal! #should be a float?
claimRate: BigDecimal!
averageCohortSize: BigDecimal!
}