-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubgraph.template.yaml
More file actions
192 lines (188 loc) · 5.66 KB
/
subgraph.template.yaml
File metadata and controls
192 lines (188 loc) · 5.66 KB
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
specVersion: 1.2.0
schema:
file: ./schema.graphql
dataSources:
# Vault contract - VaultExternal events
- kind: ethereum
name: VaultExternal
network: {{NETWORK}}
source:
address: "{{VAULT_ADDRESS}}"
abi: VaultExternal
startBlock: {{START_BLOCK}}
mapping:
entities:
- Vault
- Activity
- ActivityCounter
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
abis:
- name: VaultExternal
file: ./abis/VaultExternal.json
- name: ERC20
file: ./abis/Erc20.json
- name: Oracle
file: ./abis/Oracle.json
eventHandlers:
# Vault initialization from VaultExternal
- event: VaultInitialized(indexed address,indexed address,indexed int8,uint256,address)
handler: handleVaultInitialized
file: ./src/mappings/vault.ts
# Vault contract - Tea/ERC1155 events
- kind: ethereum
name: Tea
network: {{NETWORK}}
source:
address: "{{VAULT_ADDRESS}}"
abi: Tea
startBlock: {{START_BLOCK}}
mapping:
entities:
- Vault
- UserPositionTea
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
abis:
- name: Tea
file: ./abis/Tea.json
- name: Vault
file: ./abis/Vault.json
- name: ERC20
file: ./abis/Erc20.json
- name: UniswapV3Factory
file: ./abis/UniswapV3Factory.json
- name: UniswapV3Pool
file: ./abis/UniswapV3Pool.json
eventHandlers:
# TEA transfers (ERC1155) from Tea ABI
- event: TransferSingle(indexed address,indexed address,indexed address,uint256,uint256)
handler: handleSingleTransfer
- event: TransferBatch(indexed address,indexed address,indexed address,uint256[],uint256[])
handler: handleBatchTransfer
file: ./src/mappings/tea.ts
# Vault contract - Core vault events
- kind: ethereum
name: Vault
network: {{NETWORK}}
source:
address: "{{VAULT_ADDRESS}}"
abi: Vault
startBlock: {{START_BLOCK}}
mapping:
entities:
- Vault
- ApePosition
- ApePositionClosed
- TeaPositionClosed
- UserStats
- Activity
- ActivityCounter
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
abis:
- name: Vault
file: ./abis/Vault.json
- name: ERC20
file: ./abis/Erc20.json
- name: Sir
file: ./abis/Sir.json
- name: UniswapV3Factory
file: ./abis/UniswapV3Factory.json
- name: UniswapV3Pool
file: ./abis/UniswapV3Pool.json
- name: Oracle
file: ./abis/Oracle.json
eventHandlers:
# Vault reserves and tax events from Vault ABI
- event: ReservesChanged(indexed uint48,uint144,uint144)
handler: handleReservesChanged
- event: VaultNewTax(indexed uint48,uint8,uint16)
handler: handleVaultTax
# APE token mint/burn events from Vault ABI
- event: Burn(indexed uint48,indexed address,bool,uint256,uint144,uint144,uint144)
handler: handleBurn
- event: {{MINT_EVENT}}
handler: handleMint
file: ./src/mappings/vault.ts
# SIR contract events - consolidated for claims, dividends, and auctions
- kind: ethereum
name: Sir
network: {{NETWORK}}
source:
address: "{{SIR_ADDRESS}}"
abi: Sir
startBlock: {{START_BLOCK}}
mapping:
entities:
- Dividend
- Auction
- AuctionsParticipant
- AuctionStats
- CurrentAuction
- UserStats
- StakingStats
- Activity
- ActivityCounter
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
abis:
- name: Vault
file: ./abis/Vault.json
- name: Sir
file: ./abis/Sir.json
- name: ERC20
file: ./abis/Erc20.json
- name: Quoter
file: ./abis/Quoter.json
- name: UniswapV3Factory
file: ./abis/UniswapV3Factory.json
- name: UniswapV3Pool
file: ./abis/UniswapV3Pool.json
eventHandlers:
# Dividend and claim events
- event: DividendsPaid(uint96,uint80)
handler: handleDividendsPaid
- event: DividendsClaimed(indexed address,uint96)
handler: handleDividendsClaimed
- event: RewardsClaimed(indexed address,indexed uint256,uint80)
handler: handleClaim
# Auction events
- event: AuctionStarted(indexed address,uint256)
handler: handleAuctionStarted
- event: BidReceived(indexed address,indexed address,uint96,uint96)
handler: handleBidReceived
- event: AuctionedTokensSentToWinner(indexed address,indexed address,indexed address,uint256)
handler: handleAuctionedClaimed
# Staking events
- event: Staked(indexed address,uint80)
handler: handleStaked
- event: Unstaked(indexed address,uint80)
handler: handleUnstaked
file: ./src/mappings/consolidated.ts
templates:
- name: APE
kind: ethereum/contract
network: {{NETWORK}}
source:
abi: APE
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/ape.ts
entities:
- APE
- ApePosition
abis:
- name: APE
file: ./abis/APE.json
- name: ERC20
file: ./abis/Erc20.json
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransferFrom