-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
300 lines (240 loc) · 5.08 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
type SystemInfo @entity {
id: ID!
exchangeCount: BigInt!
swapCount: BigInt!
tokenCount: BigInt!
updated: BigInt!
updatedAtBlock: BigInt!
updatedAtTransaction: Bytes!
}
type Swap @entity {
id: ID!
# swap address
address: Bytes!
# base swap address
baseSwapAddress: Bytes!
# number of tokens supported
numTokens: Int!
# supported tokens
tokens: [Token!]!
# supported base tokens (for SwapNormal, this is same as tokens; for MetaSwap, this is the corresbonding base pool tokens)
baseTokens: [Token!]!
# supported all tokens (metapool tokens plus basepool tokens)
allTokens: [Token!]!
# token balances
balances: [BigInt!]!
# liquidity provider token
lpToken: Bytes!
# amplification coefficient
A: BigInt!
swapFee: BigInt!
adminFee: BigInt!
withdrawFee: BigInt
virtualPrice: BigInt!
# owner address
owner: Bytes!
events: [SwapEvent!] @derivedFrom(field: "swap")
exchanges: [Exchange!] @derivedFrom(field: "swap")
# cumulative daily tvl
dailyTvls: [DailyTvl!] @derivedFrom(field: "swap")
# cumulative hourly trade volume
hourlyVolumes: [HourlyVolume!] @derivedFrom(field: "swap")
# cumulative daily trade volume
dailyVolumes: [DailyVolume!] @derivedFrom(field: "swap")
# cumulative weekly trade volume
weeklyVolumes: [WeeklyVolume!] @derivedFrom(field: "swap")
TVL: BigDecimal!
APY: BigDecimal!
}
interface PoolTVL @entity {
swap: Swap!
timestamp: BigInt!
tvl: BigDecimal!
}
type DailyTvl implements PoolTVL @entity {
id: ID!
swap: Swap!
timestamp: BigInt!
tvl: BigDecimal!
}
interface TradeVolume @entity {
swap: Swap!
timestamp: BigInt!
volume: BigDecimal!
}
type DailyVolume implements TradeVolume @entity {
id: ID!
swap: Swap!
timestamp: BigInt!
volume: BigDecimal!
}
type HourlyVolume implements TradeVolume @entity {
id: ID!
swap: Swap!
timestamp: BigInt!
volume: BigDecimal!
}
type WeeklyVolume implements TradeVolume @entity {
id: ID!
swap: Swap!
timestamp: BigInt!
volume: BigDecimal!
}
interface SwapEvent @entity {
swap: Swap!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type NewAdminFeeEvent implements SwapEvent @entity {
id: ID!
swap: Swap!
newFee: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type NewSwapFeeEvent implements SwapEvent @entity {
id: ID!
swap: Swap!
newFee: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type NewWithdrawFeeEvent implements SwapEvent @entity {
id: ID!
swap: Swap!
newFee: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type RampAEvent implements SwapEvent @entity {
id: ID!
swap: Swap!
oldA: BigInt!
newA: BigInt!
initialTime: BigInt!
futureTime: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type StopRampAEvent implements SwapEvent @entity {
id: ID!
swap: Swap!
currentA: BigInt!
time: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type AddLiquidityEvent implements SwapEvent @entity {
id: ID!
swap: Swap!
provider: Bytes!
tokenAmounts: [BigInt!]!
fees: [BigInt!]!
invariant: BigInt
lpTokenSupply: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type RemoveLiquidityEvent implements SwapEvent @entity {
id: ID!
swap: Swap!
provider: Bytes!
tokenAmounts: [BigInt!]!
fees: [BigInt!]
invariant: BigInt
lpTokenSupply: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type FlashLoanEvent implements SwapEvent @entity {
id: ID!
swap: Swap!
receiver: Bytes!
tokenIndex: Int!
amount: BigInt!
amountFee: BigInt!
protocolFee: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
interface Exchange {
swap: Swap!
buyer: Bytes!
soldId: BigInt!
tokensSold: BigInt!
boughtId: BigInt!
tokensBought: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type TokenExchange implements Exchange @entity {
id: ID!
swap: Swap!
buyer: Bytes!
boughtId: BigInt!
tokensBought: BigInt!
soldId: BigInt!
tokensSold: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type TokenExchangeUnderlying implements Exchange @entity {
id: ID!
swap: Swap!
buyer: Bytes!
boughtId: BigInt!
tokensBought: BigInt!
soldId: BigInt!
tokensSold: BigInt!
block: BigInt!
timestamp: BigInt!
transaction: Bytes!
}
type Token @entity {
id: ID!
address: Bytes!
decimals: BigInt!
name: String
symbol: String
}
type Lock @entity {
id: ID!
address: Bytes!
amount: BigInt!
end: BigInt!
}
type LockSystemInfo @entity {
id: ID!
lockCount: BigInt!
averageLockTime: BigInt!
updated: BigInt!
updatedAtBlock: BigInt!
updatedAtTransaction: Bytes
}
type Airdropee @entity {
id: ID!
address: Bytes!
count: BigInt!
swapCount: BigInt!
addLiquidityCount: BigInt!
removeLiquidityCount: BigInt!
removeLiquidityImbalanceCount: BigInt!
removeLiquidityOneCount: BigInt!
farmDepositCount: BigInt!
farmWithdrawCount: BigInt!
farmClaimCount: BigInt!
updated: BigInt!
updatedAtBlock: BigInt!
updatedAtTransaction: Bytes
}