generated from TomAFrench/subgraph-template
-
Notifications
You must be signed in to change notification settings - Fork 18
/
schema.graphql
321 lines (228 loc) · 7.18 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
type VotingEscrow @entity {
" VotingEscrow contract address "
id: ID!
" Amount of B-80BAL-20WETH BPT locked, only applies on mainnet "
stakedSupply: BigDecimal
" List of veBAL locks created "
locks: [VotingEscrowLock!] @derivedFrom(field: "votingEscrowID")
" List of veBAL locks created "
omniLocks: [OmniVotingEscrowLock!] @derivedFrom(field: "votingEscrowID")
}
type OmniVotingEscrowLock @entity {
" Equal to: <userAdress>-<omniVotingEscrow> "
id: ID!
" User on the local chain (reference to User entity) "
localUser: User!
" User address on the remote chain "
remoteUser: Bytes!
" Chain where the lock was bridged to "
dstChainId: Int!
" veBAL balance at the moment user locks "
bias: BigDecimal!
" veBAL decay rate (per second) "
slope: BigDecimal!
" Timestamp the lock was created [seconds] "
timestamp: Int!
" Reference to VotingEscrow entity "
votingEscrowID: VotingEscrow!
}
type VotingEscrowLock @entity {
" Equal to: <userAdress>-<votingEscrow> "
id: ID!
" Reference to User entity "
user: User!
" veBAL balance at the moment user locks "
bias: BigDecimal!
" veBAL decay rate (per second) "
slope: BigDecimal!
" Timestamp at which the lock was created [seconds] "
timestamp: Int!
" Timestamp at which B-80BAL-20WETH BPT can be unlocked by user [seconds] "
unlockTime: BigInt!
" Amount of B-80BAL-20WETH BPT the user has locked "
lockedBalance: BigDecimal!
" Reference to VotingEscrow entity "
votingEscrowID: VotingEscrow!
" Timestamp at which the lcok was created [seconds]. Same as timestamp "
updatedAt: Int!
}
type LockSnapshot @entity {
" Equal to <userAddress>-<timestamp> "
id: ID!
" Reference to User entity "
user: User!
" veBAL balance at the moment user locks "
bias: BigDecimal!
" veBAL decay rate (per second) "
slope: BigDecimal!
" Timestamp at which the snapshot was taken [seconds] "
timestamp: Int!
}
type GaugeFactory @entity {
" Factory contract address "
id: ID!
" Number of gauges created through the factory "
numGauges: Int!
" List of gauges created through the factory "
gauges: [LiquidityGauge!] @derivedFrom(field: "factory")
}
type LiquidityGauge @entity {
" LiquidityGauge contract address "
id: ID!
" ERC20 token symbol "
symbol: String!
" Reference to Gauge entity - created when LiquidityGauge is added to GaugeController"
gauge: Gauge
" Reference to Pool entity "
pool: Pool
" Address of the pool (lp_token of the gauge) "
poolAddress: Bytes!
" Pool ID if lp_token is a Balancer pool; null otherwise "
poolId: Bytes
" Whether Balancer DAO killed the gauge "
isKilled: Boolean!
" Whether the LiquidityGauge is the most recent added to GaugeController "
isPreferentialGauge: Boolean!
" Relative weight cap of the gauge (0.01 = 1%) - V2 factories only "
relativeWeightCap: BigDecimal
" Address of the contract that streams reward tokens to the gauge - ChildChainLiquidityGauge only "
streamer: Bytes
" Factory contract address "
factory: GaugeFactory!
" Total of BPTs users have staked in the LiquidityGauge "
totalSupply: BigDecimal!
" List of reward tokens depositted in the gauge - ChildChainLiquidityGauge only "
rewardTokensList: [Bytes!]
" List of user shares "
shares: [GaugeShare!] @derivedFrom(field: "gauge")
" List of reward tokens depositted in the gauge "
tokens: [RewardToken!] @derivedFrom(field: "gauge")
}
enum Chain {
Arbitrum
Gnosis
Polygon
Optimism
Avalanche
PolygonZkEvm
Base
Fraxtal
}
type RootGauge @entity {
" RootGauge contract address"
id: ID!
" Chain where emissions by this gauge will be bridged to "
chain: Chain!
" Address where emissions by this gauge will be bridged to "
recipient: Bytes!
" Reference to Gauge entity - created when LiquidityGauge is added to GaugeController"
gauge: Gauge
" Whether Balancer DAO killed the gauge "
isKilled: Boolean!
" Relative weight cap of the gauge (0.01 = 1%) - V2 factories only "
relativeWeightCap: BigDecimal
" Factory contract address "
factory: GaugeFactory!
}
type SingleRecipientGauge @entity {
" SingleRecipientGauge contract address"
id: ID!
" Address where emissions for this gauge will be sent to "
recipient: Bytes!
" Reference to Gauge entity - created when SingleRecipientGauge is added to GaugeController"
gauge: Gauge
" Whether Balancer DAO killed the gauge "
isKilled: Boolean!
" Relative weight cap of the gauge (0.01 = 1%) - V2 factories only "
relativeWeightCap: BigDecimal
" Factory contract address "
factory: GaugeFactory!
}
type Gauge @entity {
" Equal to: <gaugeAddress>-<typeID> "
id: ID!
" Address of the gauge "
address: Bytes!
" Type of the gauge "
type: GaugeType!
" Timestamp at which Balancer DAO added the gauge to GaugeController [seconds] "
addedTimestamp: Int!
" Reference to LiquidityGauge "
liquidityGauge: LiquidityGauge
" Reference to RootGauge "
rootGauge: RootGauge
}
type Pool @entity {
" Address of the pool (lp_token of the gauge) "
id: ID!
" Pool ID if lp_token is a Balancer pool; null otherwise "
poolId: Bytes
" Address of the pool (lp_token of the gauge) "
address: Bytes!
" Most recent, unkilled gauge in the GaugeController "
preferentialGauge: LiquidityGauge
" List of the pool's gauges addresses "
gaugesList: [Bytes!]!
" List of gauges created for the pool "
gauges: [LiquidityGauge!] @derivedFrom(field: "pool")
}
type RewardToken @entity {
" Equal to: <tokenAddress>-<gaugeAddress> "
id: ID!
" ERC20 token symbol - empty string if call to symbol() reverts "
symbol: String!
" ERC20 token decimals - zero if call to decimals() reverts "
decimals: Int!
" Reference to LiquidityGauge entity "
gauge: LiquidityGauge!
" Rate of reward tokens streamed per second "
rate: BigDecimal
" Timestamp at which finishes the period of rewards "
periodFinish: BigInt
" Amount of reward tokens that has been deposited into the gauge "
totalDeposited: BigDecimal!
}
type GaugeShare @entity {
" Equal to: <userAddress>-<gaugeAddress> "
id: ID!
" Reference to User entity "
user: User!
" Reference to LiquidityGauge entity "
gauge: LiquidityGauge!
" User's balance of gauge deposit tokens "
balance: BigDecimal!
}
type GaugeType @entity {
" Type ID "
id: ID!
" Name of the type - empty string if call reverts "
name: String!
}
type GaugeVote @entity {
" Equal to: <userAddress>-<gaugeAddress> "
id: ID!
" Reference to User entity "
user: User!
" Reference to Gauge entity "
gauge: Gauge!
" Weight of veBAL power user has used to vote "
weight: BigDecimal
" Timestamp at which user voted [seconds] "
timestamp: BigInt
}
type User @entity {
" User address "
id: ID!
" List of votes on gauges "
gaugeVotes: [GaugeVote!] @derivedFrom(field: "user")
" List of gauge the user has shares "
gaugeShares: [GaugeShare!] @derivedFrom(field: "user")
" List of locks the user created "
votingLocks: [VotingEscrowLock!] @derivedFrom(field: "user")
" List of omni locks the user created "
omniVotingLocks: [OmniVotingEscrowLock!] @derivedFrom(field: "localUser")
}
type GaugeInjector @entity {
" GaugeInjector contract address "
id: ID!
}