-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
136 lines (96 loc) · 3.92 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
enum ProposalStatus {
PENDING
ACTIVE
CANCELLED
QUEUED
EXECUTED
}
type TokenHolder @entity {
"A TokenHolder is any address that holds any amount of Compound Tokens, the id used is the blockchain address."
id: ID!
"Delegate address of the token holder which will participate in votings. Delegates don't need to hold any tokens and can even be the token holder itself."
delegate: Delegate
"Compound Token balance of this address expressed in the smallest unit of the CompoundToken"
tokenBalanceRaw: BigInt!
"Compound Token balance of this address expressed as a BigDecimal normalized value for the Compound Token"
tokenBalance: BigDecimal!
"Total amount of Compound Token ever held by this address expressed in the smallest unit of the CompoundToken"
totalTokensHeldRaw: BigInt!
"Total amount of Compound Token ever held by this address expressed as a BigDecimal normalized value for the Compound Token"
totalTokensHeld: BigDecimal!
}
type Delegate @entity {
"A Delegate is any address that has been delegated with voting tokens by a token holder, id is the blockchain address of said delegate"
id: ID!
"Amount of votes delegated to this delegate to be used on proposal votings expressed in the smallest unit of the CompoundToken"
delegatedVotesRaw: BigInt!
"Amount of votes delegated to this delegate to be used on proposal votings expressed as a BigDecimal normalized value for the Compound Token"
delegatedVotes: BigDecimal!
tokenHoldersRepresentedAmount: Int!
"Token holders that this delegate represents"
tokenHoldersRepresented: [TokenHolder!]! @derivedFrom(field: "delegate")
"Votes that a delegate has made in different proposals"
votes: [Vote!]! @derivedFrom(field: "voter")
"Proposals that the delegate has created"
proposals: [Proposal!]! @derivedFrom(field: "proposer")
}
type Proposal @entity {
"Internal proposal ID, in this implementation it seems to be a autoincremental id"
id: ID!
"Delegate that proposed the change"
proposer: Delegate!
"Targets data for the change"
targets: [Bytes!]
"Values data for the change"
values: [BigInt!]
"Signature data for the change"
signatures: [String!]
"Call data for the change"
calldatas: [Bytes!]
"Block number from where the voting starts"
startBlock: BigInt!
"Block number from where the voting ends"
endBlock: BigInt!
"String description of the change"
description: String!
"Status of the proposal"
status: ProposalStatus!
"Once the proposal is queued for execution it will have an ETA of the execution"
executionETA: BigInt
"Votes associated to this proposal"
votes: [Vote!]! @derivedFrom(field: "proposal")
}
type Vote @entity {
"Delegate ID + Proposal ID"
id: ID!
"Whether the vote is in favour or against the proposal"
support: Boolean!
"Amount of votes in favour or against expressed in the smallest unit of the CompoundToken"
votesRaw: BigInt!
"Amount of votes in favour or against expressed as a BigDecimal normalized value for the Compound Token"
votes: BigDecimal!
"Delegate that emitted the vote"
voter: Delegate!
"Proposal that is being voted on"
proposal: Proposal!
}
type Governance @entity {
"Unique entity used to keep track of common aggregated data"
id: ID!
"Number of proposals created"
proposals: BigInt!
"Total number of token holders currently"
currentTokenHolders: BigInt!
"Total number of delegates participating on the governance currently"
currentDelegates: BigInt!
"Total number of token holders"
totalTokenHolders: BigInt!
"Total number of delegates that held delegated votes"
totalDelegates: BigInt!
"Total number of votes delegated expressed in the smallest unit of the Compound Token"
delegatedVotesRaw: BigInt!
"Total number of votes delegated expressed as a BigDecimal normalized value for the Compound Token"
delegatedVotes: BigDecimal!
"Number of proposals currently queued for execution"
proposalsQueued: BigInt!
}