forked from beefyfinance/cowcentrated-subgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubgraph.template.yaml
177 lines (170 loc) · 5.31 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
specVersion: 1.0.0
description: Beefy Finance Automated Liquidity Manager Subgraph
repository: https://github.com/beefyfinance/subgraphs
schema:
file: ./schema.graphql
indexerHints:
prune: auto # we have our own snapshotting mechanism
dataSources:
- kind: ethereum/contract
name: BeefyCLVaultFactory
network: {{network}}
source:
address: "{{vaultFactoryAddress}}"
abi: BeefyVaultConcLiqFactory
startBlock: {{vaultFactoryStartBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.7 # 0xgraph's version
language: wasm/assemblyscript
file: ./src/mapping/factory.ts
entities: &entities
- Token
- Transaction
- ClockTick
- Protocol
- ProtocolSnapshot
- BeefyCLVault
- BeefyCLVaultSnapshot
- BeefyCLRewardPool
- BeefyCLStrategy
- BeefyCLVaultHarvestEvent
- BeefyCLVaultUnderlyingFeesCollectedEvent
- Investor
- InvestorSnapshot
- InvestorPosition
- InvestorPositionSnapshot
- InvestorPositionInteraction
abis: &abis
- name: BeefyVaultConcLiqFactory
file: ./abis/beefy/concliq/BeefyVaultConcLiqFactory.json
- name: BeefyVaultConcLiq
file: ./abis/beefy/concliq/BeefyVaultConcLiq.json
- name: BeefyStrategyFactory
file: ./abis/beefy/concliq/BeefyStrategyFactory.json
- name: BeefyStrategy
file: ./abis/beefy/concliq/BeefyStrategy.json
- name: BeefyRewardPoolFactory
file: ./abis/beefy/concliq/BeefyRewardPoolFactory.json
- name: BeefyRewardPool
file: ./abis/beefy/concliq/BeefyRewardPool.json
- name: IERC20
file: ./abis/IERC20/IERC20.json
- name: Multicall3
file: ./abis/multicall/Multicall3.json
eventHandlers:
- event: ProxyCreated(address)
handler: handleVaultCreated
- kind: ethereum/contract
name: BeefyCLStrategyFactory
network: {{network}}
source:
address: "{{strategyFactoryAddress}}"
abi: BeefyStrategyFactory
startBlock: {{strategyFactoryStartBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.7 # 0xgraph's version
language: wasm/assemblyscript
file: ./src/mapping/factory.ts
entities: *entities
abis: *abis
eventHandlers:
- event: GlobalPause(bool)
handler: handleGlobalStrategyPause
- kind: ethereum/contract
name: BeefyRewardPoolFactory
network: {{network}}
source:
address: "{{rewardPoolFactoryAddress}}"
abi: BeefyRewardPoolFactory
startBlock: {{rewardPoolFactoryStartBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.7 # 0xgraph's version
language: wasm/assemblyscript
file: ./src/mapping/factory.ts
entities: *entities
abis: *abis
eventHandlers:
- event: ProxyCreated(address)
handler: handleRewardPoolCreated
- kind: ethereum/contract
name: Clock
network: {{network}}
source:
address: "{{vaultFactoryAddress}}"
abi: BeefyVaultConcLiqFactory
startBlock: {{vaultFactoryStartBlock}} # same as BeefyCLVaultFactory
mapping:
kind: ethereum/events
apiVersion: 0.0.7 # 0xgraph's version
language: wasm/assemblyscript
file: ./src/mapping/clock.ts
entities: *entities
abis: *abis
blockHandlers:
- handler: handleClockTick
filter:
kind: polling
every: {{clockTickBlocks}}
templates:
- name: BeefyCLVault
kind: ethereum/contract
network: {{network}}
source:
abi: BeefyVaultConcLiq
mapping:
kind: ethereum/events
apiVersion: 0.0.7 # 0xgraph's version
language: wasm/assemblyscript
file: ./src/mapping/vault.ts
entities: *entities
abis: *abis
eventHandlers:
- event: Initialized(uint8)
handler: handleInitialized
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- name: BeefyCLStrategy
kind: ethereum/contract
network: {{network}}
source:
abi: BeefyStrategy
mapping:
kind: ethereum/events
apiVersion: 0.0.7 # 0xgraph's version
language: wasm/assemblyscript
file: ./src/mapping/strategy.ts
entities: *entities
abis: *abis
eventHandlers:
- event: Initialized(uint8)
handler: handleInitialized
- event: Paused(address)
handler: handlePaused
- event: Unpaused(address)
handler: handleUnpaused
- event: Harvest(uint256,uint256)
handler: handleHarvest
- event: ClaimedFees(uint256,uint256,uint256,uint256)
handler: handleClaimedFees
- event: ClaimedOutput(uint256)
handler: handleClaimedOutput
- name: BeefyCLRewardPool
kind: ethereum/contract
network: {{network}}
source:
abi: BeefyRewardPool
mapping:
kind: ethereum/events
apiVersion: 0.0.7 # 0xgraph's version
language: wasm/assemblyscript
file: ./src/mapping/reward-pool.ts
entities: *entities
abis: *abis
eventHandlers:
- event: Initialized(uint8)
handler: handleInitialized
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer