-
Notifications
You must be signed in to change notification settings - Fork 0
/
subgraph.template.yaml
381 lines (370 loc) · 16.3 KB
/
subgraph.template.yaml
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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
specVersion: 0.0.2
description: Subgraph for Aave protocol
repository: https://github.com/nascentxyz/aave-subgraph
schema:
file: ./{{type}}/schema.graphql
dataSources:
- kind: ethereum/contract
name: AavePoolRegistrationHandler
network: { { network } }
source:
address: "{{aavePoolRegistrarAddress}}"
abi: LendingPoolAddressesProvider
startBlock: { { aavePoolRegistrarStartBlock } }
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- LendingPoolAddressesProvider
abis:
- name: LendingPoolAddressesProvider
file: ./build/contracts/LendingPoolAddressesProvider.json
eventHandlers:
- event: LendingPoolManagerUpdated(indexed address)
handler: handleAavePoolRegistration
file: ./{{type}}/mapping/address-provider-registry.ts
- kind: ethereum/contract
name: LendingPoolAddressesProviderRegistry
network: { { network } }
source:
address: "{{addressesProviderRegistryAddress}}"
abi: LendingPoolAddressesProviderRegistry
startBlock: { { addressesProviderRegistryStartBlock } }
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- LendingPoolAddressesProvider
abis:
- name: LendingPoolAddressesProviderRegistry
file: ./build/contracts/LendingPoolAddressesProviderRegistry.json
eventHandlers:
- event: AddressesProviderRegistered(indexed address)
handler: handleAddressesProviderRegistered
file: ./{{type}}/mapping/address-provider-registry.ts
- kind: ethereum/contract
name: ProxyPriceProvider
network: { { network } }
source:
address: "{{proxyPriceProviderAddress}}"
startBlock: { { proxyPriceProviderStartBlock } }
abi: ChainlinkProxyPriceProvider
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- ChainlinkAggregator
- PriceOracle
- PriceOracleAsset
abis:
- name: ChainlinkProxyPriceProvider
file: ./build/contracts/ChainlinkProxyPriceProvider.json
- name: GenericOracleI
file: ./build/contracts/GenericOracleI.json
- name: IExtendedPriceAggregator
file: ./build/contracts/IExtendedPriceAggregator.json
eventHandlers:
- event: AssetSourceUpdated(indexed address,indexed address)
handler: handleAssetSourceUpdated
- event: FallbackOracleUpdated(indexed address)
handler: handleFallbackOracleUpdated
file: ./{{type}}/mapping/proxy-price-provider.ts
- kind: ethereum/contract
name: ChainlinkUSDETHOracle
network: { { network } }
source:
address: "{{chainlinkUSDETHOracleAddress}}"
startBlock: { { chainlinkUSDETHOracleStartBlock } }
abi: ChainlinkUSDETHOracleI
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- PriceOracle
abis:
- name: ChainlinkUSDETHOracleI
file: ./build/contracts/ChainlinkUSDETHOracleI.json
eventHandlers:
- event: AnswerUpdated(indexed int256,indexed uint256)
handler: handleChainlinkUSDETHPriceUpdated
file: ./{{type}}/mapping/price-oracle.ts
- kind: ethereum/contract
name: ChainlinkSourcesRegistry
network: { { network } }
source:
address: "{{chainlinkSourcesRegistryAddress}}"
startBlock: { { chainlinkSourcesRegistryStartBlock } }
abi: ChainlinkSourcesRegistry
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- PriceOracle
abis:
- name: ChainlinkSourcesRegistry
file: ./abis/ChainlinkSourcesRegistry.json
- name: ChainlinkProxyPriceProvider
file: ./build/contracts/ChainlinkProxyPriceProvider.json
- name: IExtendedPriceAggregator
file: ./build/contracts/IExtendedPriceAggregator.json
- name: GenericOracleI
file: ./build/contracts/GenericOracleI.json
eventHandlers:
- event: AggregatorUpdated(address,address)
handler: handleChainlinkAggregatorUpdated
file: ./{{type}}/mapping/proxy-price-provider.ts
templates:
- kind: ethereum/contract
name: LendingPoolAddressesProvider
network: { { network } }
source:
abi: LendingPoolAddressesProvider
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- LendingPoolAddressesProvider
abis:
- name: LendingPoolAddressesProvider
file: ./build/contracts/LendingPoolAddressesProvider.json
eventHandlers:
- event: ProxyCreated(bytes32,indexed address)
handler: handleProxyCreated
- event: LendingPoolParametersProviderUpdated(indexed address)
handler: handleLendingPoolParametersProviderUpdated
- event: LendingPoolManagerUpdated(indexed address)
handler: handleLendingPoolManagerUpdated
- event: LendingPoolLiquidationManagerUpdated(indexed address)
handler: handleLendingPoolLiquidationManagerUpdated
- event: LendingPoolDataProviderUpdated(indexed address)
handler: handleLendingPoolDataProviderUpdated
- event: PriceOracleUpdated(indexed address)
handler: handlePriceOracleUpdated
- event: LendingRateOracleUpdated(indexed address)
handler: handleLendingRateOracleUpdated
- event: FeeProviderUpdated(indexed address)
handler: handleFeeProviderUpdated
file: ./{{type}}/mapping/lending-pool-address-provider.ts
- kind: ethereum/contract
name: LendingPoolConfigurator
network: { { network } }
source:
abi: LendingPoolConfigurator
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- Reserve
abis:
- name: LendingPoolConfigurator
file: ./build/contracts/LendingPoolConfigurator.json
- name: ERC20Detailed
file: ./build/contracts/ERC20Detailed.json
- name: IERC20DetailedBytes
file: ./build/contracts/IERC20DetailedBytes.json
- name: DefaultReserveInterestRateStrategy
file: ./build/contracts/DefaultReserveInterestRateStrategy.json
eventHandlers:
- event: ReserveInitialized(indexed address,indexed address,address)
handler: handleReserveInitialized
- event: BorrowingDisabledOnReserve(indexed address)
handler: handleBorrowingDisabledOnReserve
- event: BorrowingEnabledOnReserve(address,bool)
handler: handleBorrowingEnabledOnReserve
- event: ReserveBaseLtvChanged(address,uint256)
handler: handleReserveBaseLtvChanged
- event: ReserveLiquidationThresholdChanged(address,uint256)
handler: handleReserveLiquidationThresholdChanged
- event: ReserveLiquidationBonusChanged(address,uint256)
handler: handleReserveLiquidationBonusChanged
- event: ReserveInterestRateStrategyChanged(address,address)
handler: handleReserveInterestRateStrategyChanged
- event: StableRateDisabledOnReserve(indexed address)
handler: handleStableRateDisabledOnReserve
- event: StableRateEnabledOnReserve(indexed address)
handler: handleStableRateEnabledOnReserve
- event: ReserveActivated(indexed address)
handler: handleReserveActivated
- event: ReserveFreezed(indexed address)
handler: handleReserveFreezed
- event: ReserveUnfreezed(indexed address)
handler: handleReserveUnfreezed
- event: ReserveDeactivated(indexed address)
handler: handleReserveDeactivated
- event: ReserveEnabledAsCollateral(indexed address,uint256,uint256,uint256)
handler: handleReserveEnabledAsCollateral
- event: ReserveDisabledAsCollateral(indexed address)
handler: handleReserveDisabledAsCollateral
file: ./{{type}}/mapping/lending-pool-configurator.ts
- kind: ethereum/contract
name: LendingPoolCore
network: { { network } }
source:
abi: LendingPoolCore
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- PoolReserve
- ReserveParamsHistory
abis:
- name: LendingPoolCore
file: ./build/contracts/LendingPoolCore.json
eventHandlers:
- event: ReserveUpdated(indexed address,uint256,uint256,uint256,uint256,uint256) # deprecated
handler: handleReserveUpdated
- event: ReserveDataUpdated(indexed address,uint256,uint256,uint256,uint256,uint256,uint256) # new one
handler: handleReserveDataUpdated
file: ./{{type}}/mapping/lending-pool-core.ts
- kind: ethereum/contract
name: AToken
network: { { network } }
source:
abi: AToken
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- AToken
- UserReserve
abis:
- name: AToken
file: ./build/contracts/AToken.json
- name: LendingPoolCore
file: ./build/contracts/LendingPoolCore.json
eventHandlers:
- event: MintOnDeposit(indexed address,uint256,uint256,uint256)
handler: handleMintOnDeposit
- event: Redeem(indexed address,uint256,uint256,uint256)
handler: handleRedeem
- event: BurnOnLiquidation(indexed address,uint256,uint256,uint256)
handler: handleBurnOnLiquidation
- event: BalanceTransfer(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256)
handler: handleBalanceTransfer
- event: InterestStreamRedirected(indexed address,indexed address,uint256,uint256,uint256)
handler: handleInterestStreamRedirected
- event: RedirectedBalanceUpdated(indexed address,uint256,uint256,uint256,uint256)
handler: handleRedirectedBalanceUpdated
- event: InterestRedirectionAllowanceChanged(indexed address,indexed address)
handler: handleInterestRedirectionAllowanceChanged
file: ./{{type}}/mapping/a-token.ts
- kind: ethereum/contract
name: LendingPool
network: { { network } }
source:
abi: LendingPool
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- ReserveOperation
- InterestRateHistory
- Reserve
- UserReserve
- User
abis:
- name: LendingPool
file: ./build/contracts/LendingPool.json
eventHandlers:
- event: Deposit(indexed address,indexed address,uint256,indexed uint16,uint256)
handler: handleDeposit
- event: Borrow(indexed address,indexed address,uint256,uint256,uint256,uint256,uint256,indexed uint16,uint256)
handler: handleBorrow
- event: RedeemUnderlying(indexed address,indexed address,uint256,uint256)
handler: handleRedeemUnderlying
- event: Repay(indexed address,indexed address,indexed address,uint256,uint256,uint256,uint256)
handler: handleRepay
- event: LiquidationCall(indexed address,indexed address,indexed address,uint256,uint256,uint256,address,bool,uint256)
handler: handleLiquidationCall
- event: Swap(indexed address,indexed address,uint256,uint256,uint256,uint256)
handler: handleSwap
- event: RebalanceStableBorrowRate(indexed address,indexed address,uint256,uint256,uint256)
handler: handleRebalanceStableBorrowRate
- event: FlashLoan(indexed address,indexed address,uint256,uint256,uint256,uint256)
handler: handleFlashLoan
- event: ReserveUsedAsCollateralEnabled(indexed address,indexed address)
handler: handleReserveUsedAsCollateralEnabled
- event: ReserveUsedAsCollateralDisabled(indexed address,indexed address)
handler: handleReserveUsedAsCollateralDisabled
- event: OriginationFeeLiquidated(indexed address,indexed address,indexed address,uint256,uint256,uint256)
handler: handleOriginationFeeLiquidated
file: ./{{type}}/mapping/lending-pool.ts
- kind: ethereum/contract
name: FallbackPriceOracle
network: { { network } }
source:
abi: GenericOracleI
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- PriceOracle
- PriceOracleReserve
abis:
- name: GenericOracleI
file: ./build/contracts/GenericOracleI.json
eventHandlers:
- event: AssetPriceUpdated(address,uint256,uint256)
handler: handleAssetPriceUpdated
- event: EthPriceUpdated(uint256,uint256)
handler: handleEthPriceUpdated
- event: ProphecySubmitted(indexed address,indexed address,uint96,uint96)
handler: handleProphecySubmitted
file: ./{{type}}/mapping/price-oracle.ts
- kind: ethereum/contract
name: ChainlinkAggregator
network: { { network } }
source:
abi: IExtendedPriceAggregator
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- PriceOracleReserve
abis:
- name: IExtendedPriceAggregator
file: ./build/contracts/IExtendedPriceAggregator.json
- name: ChainlinkProxyPriceProvider
file: ./build/contracts/ChainlinkProxyPriceProvider.json
eventHandlers:
- event: AnswerUpdated(indexed int256,indexed uint256,uint256)
handler: handleChainlinkAnswerUpdated
file: ./{{type}}/mapping/price-oracle.ts
- kind: ethereum/contract
name: UniswapExchange
network: { { network } }
source:
abi: IUniswapExchange
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
entities:
- PriceOracleReserve
abis:
- name: IUniswapExchange
file: ./build/contracts/IUniswapExchange.json
- name: ChainlinkProxyPriceProvider
file: ./build/contracts/ChainlinkProxyPriceProvider.json
eventHandlers:
- event: TokenPurchase(indexed address,indexed uint256,indexed uint256)
handler: updateUniswapAssetPrice
- event: EthPurchase(indexed address,indexed uint256,indexed uint256)
handler: updateUniswapAssetPrice
- event: AddLiquidity(indexed address,indexed uint256,indexed uint256)
handler: updateUniswapAssetPrice
- event: RemoveLiquidity(indexed address,indexed uint256,indexed uint256)
handler: updateUniswapAssetPrice
file: ./{{type}}/mapping/uniswap-exchange.ts