-
Notifications
You must be signed in to change notification settings - Fork 17
/
schema.graphql
200 lines (167 loc) · 4.46 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
enum ProposalState {
Pending
Active
Succeeded
Failed
Canceled
Queued
Executed
}
enum Winner {
Yes
No
Abstain
Na
}
type Executor @entity {
id: ID!
authorized: Boolean!
propositionThreshold: BigInt!
votingDuration: BigInt!
voteDifferential: BigInt!
minimumQuorum: BigInt!
gracePeriod: BigInt!
executionDelay: BigInt!
admin: Bytes!
authorizationBlock: BigInt!
authorizationTimestamp: BigInt!
pendingAdmin: Bytes
}
interface Action @entity {
id: ID!
user: Delegate!
timestamp: Int!
}
type Proposal implements Action @entity {
"""
proposal id
"""
id: ID!
"created timestamp"
timestamp: Int!
state: ProposalState!
ipfsHash: String!
"creator"
user: Delegate!
executor: Executor
targets: [Bytes!]
values: [BigInt!]
signatures: [String!]
calldatas: [Bytes!]
withDelegatecalls: [Boolean!]
startBlock: BigInt!
endBlock: BigInt!
governanceStrategy: Bytes!
currentYesVote: BigInt!
currentNoVote: BigInt!
votes: [Vote!]! @derivedFrom(field: "proposal")
executionTime: BigInt
initiatorQueueing: Bytes
initiatorExecution: Bytes
lastUpdateTimestamp: Int!
lastUpdateBlock: BigInt!
title: String!
description: String!
shortDescription: String!
govContract: Bytes!
totalPropositionSupply: BigInt!
totalVotingSupply: BigInt!
createdBlockNumber: BigInt!
totalCurrentVoters: Int!
aipNumber: BigInt!
author: String!
discussions: String!
}
type Vote implements Action @entity {
"""
voter:proposalid
"""
id: ID!
"voter"
user: Delegate!
timestamp: Int!
proposal: Proposal!
support: Boolean!
votingPower: BigInt!
}
enum PowerType {
Voting
Proposition
}
enum VotingAsset {
Aave
StkAave
}
type Delegation implements Action @entity {
id: ID!
user: Delegate!
timestamp: Int!
powerType: PowerType!
amountRaw: BigInt!
amount: BigDecimal!
delegate: Delegate!
asset: VotingAsset!
}
# Address which holds governance tokens (AAVE, stkAAVE) or has been delegated voting or proposition power from another address
type Delegate @entity {
"Wallet address"
id: ID!
"AAVE Balance"
aaveBalanceRaw: BigInt!
aaveBalance: BigDecimal!
"stkAAVE Balance"
stkAaveBalanceRaw: BigInt!
stkAaveBalance: BigDecimal!
"aaveTotalVotingPower + stkAaveTotalVotingPower"
totalVotingPowerRaw: BigInt!
totalVotingPower: BigDecimal!
"aaveDelegatedPropositionPower + stkAaveDelegatedPropositionPower"
totalPropositionPowerRaw: BigInt!
totalPropositionPower: BigDecimal!
"Votes which this user has participated in"
votes: [Vote!]! @derivedFrom(field: "user")
"Proposals which this user has created"
proposals: [Proposal!]! @derivedFrom(field: "user")
"Delegations which the user has made"
delegations: [Delegation!]! @derivedFrom(field: "user")
"Delegate who will vote or propose on user's behalf"
aaveVotingDelegate: Delegate!
aavePropositionDelegate: Delegate!
"aaveBalance + aaveDelegatedInVotingPower - aaveDelegatedOutVotingPower"
aaveTotalVotingPowerRaw: BigInt!
aaveTotalVotingPower: BigDecimal!
aaveTotalPropositionPowerRaw: BigInt!
aaveTotalPropositionPower: BigDecimal!
aaveDelegatedInVotingPowerRaw: BigInt!
aaveDelegatedInVotingPower: BigDecimal!
aaveDelegatedOutVotingPowerRaw: BigInt!
aaveDelegatedOutVotingPower: BigDecimal!
aaveDelegatedInPropositionPowerRaw: BigInt!
aaveDelegatedInPropositionPower: BigDecimal!
aaveDelegatedOutPropositionPowerRaw: BigInt!
aaveDelegatedOutPropositionPower: BigDecimal!
"Delegate who will vote or propose on user's behalf"
stkAaveVotingDelegate: Delegate!
stkAavePropositionDelegate: Delegate!
"stkAaveBalance + stkAaveDelegatedInVotingPower - stkAaveDelegatedOutVotingPower"
stkAaveTotalVotingPowerRaw: BigInt!
stkAaveTotalVotingPower: BigDecimal!
stkAaveTotalPropositionPowerRaw: BigInt!
stkAaveTotalPropositionPower: BigDecimal!
stkAaveDelegatedInVotingPowerRaw: BigInt!
stkAaveDelegatedInVotingPower: BigDecimal!
stkAaveDelegatedOutVotingPowerRaw: BigInt!
stkAaveDelegatedOutVotingPower: BigDecimal!
stkAaveDelegatedInPropositionPowerRaw: BigInt!
stkAaveDelegatedInPropositionPower: BigDecimal!
stkAaveDelegatedOutPropositionPowerRaw: BigInt!
stkAaveDelegatedOutPropositionPower: BigDecimal!
"Number of users represented for voting"
usersVotingRepresentedAmount: Int!
"Number of users represented for creating proposals"
usersPropositionRepresentedAmount: Int!
"Number of votes a user has cast"
numVotes: Int!
numProposals: Int!
lastUpdateTimestamp: Int!
}