-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubgraph.yaml
153 lines (148 loc) · 4.35 KB
/
subgraph.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
specVersion: 1.1.0
description: DEX Swaps Subgraph on Odyssey
schema:
file: ./schema.graphql
dataSources:
# dummy for getting block data
- kind: ethereum/contract
name: Block
network: odyssey-testnet
source:
abi: ERC20
startBlock: 0
address: '0x1516000000000000000000000000000000000000'
mapping:
kind: ethereum/events
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- Token
abis:
- name: ERC20
file: ./abis/ERC20.abi.json
blockHandlers:
- handler: handleBlock
file: ./src/mappings/block.ts
- kind: ethereum/contract
name: ERC20
network: odyssey-testnet
source:
abi: ERC20
startBlock: 0
mapping:
kind: ethereum/events
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- Account
- Token
- TokenBalance
abis:
- name: ERC20
file: ./abis/ERC20.abi.json
eventHandlers:
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
file: ./src/mappings/erc20.ts
- kind: ethereum/contract
name: UniswapV2Factory
network: odyssey-testnet
source:
abi: UniswapV2Factory
startBlock: 0
mapping:
kind: ethereum/events
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- TokenPair
abis:
- name: UniswapV2Factory
file: ./abis/UniswapV2Factory.abi.json
- name: ERC20
file: ./abis/ERC20.abi.json
- name: UniswapV2Pair
file: ./abis/UniswapV2Pair.abi.json
eventHandlers:
- event: PairCreated(indexed address,indexed address,address,uint256)
handler: handlePairCreated
file: ./src/mappings/uniswap-v2-factory.ts
- kind: ethereum/contract
name: UniswapV2Pair
network: odyssey-testnet
source:
abi: UniswapV2Pair
startBlock: 0
mapping:
kind: ethereum/events
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- DEX
- TokenAddLiquidity
- TokenRemoveLiquidity
- TokenSwap
- TokenPair
abis:
- name: UniswapV2Pair
file: ./abis/UniswapV2Pair.abi.json
eventHandlers:
- event: Mint(indexed address,uint256,uint256)
handler: handlePositionMint
- event: Burn(indexed address,uint256,uint256,indexed address)
handler: handlePositionBurn
- event: Swap(indexed address,uint256,uint256,uint256,uint256,indexed address)
handler: handleTokenSwap
file: ./src/mappings/uniswap-v2-pair.ts
- kind: ethereum/contract
name: UniswapV3Factory
network: odyssey-testnet
source:
abi: UniswapV3Factory
startBlock: 0
mapping:
kind: ethereum/events
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- TokenPair
abis:
- name: UniswapV3Factory
file: ./abis/UniswapV3Factory.abi.json
- name: ERC20
file: ./abis/ERC20.abi.json
- name: UniswapV3Pool
file: ./abis/UniswapV3Pool.abi.json
eventHandlers:
- event: PoolCreated(indexed address,indexed address,indexed uint24,int24,address)
handler: handlePoolCreated
file: ./src/mappings/uniswap-v3-factory.ts
- kind: ethereum/contract
name: UniswapV3Pool
network: odyssey-testnet
source:
abi: UniswapV3Pool
startBlock: 0
mapping:
kind: ethereum/events
apiVersion: 0.0.6
language: wasm/assemblyscript
entities:
- DEX
- TokenAddLiquidity
- TokenRemoveLiquidity
- TokenSwap
- TokenPair
abis:
- name: UniswapV3Pool
file: ./abis/UniswapV3Pool.abi.json
eventHandlers:
- event: Mint(address,indexed address,indexed int24,indexed int24,uint128,uint256,uint256)
handler: handlePositionMint
- event: Burn(indexed address,indexed int24,indexed int24,uint128,uint256,uint256)
handler: handlePositionBurn
# - event: Collect(indexed address,address,indexed int24,indexed int24,uint128,uint128)
# handler: handlePositionCollect
- event: Swap(indexed address,indexed address,int256,int256,uint160,uint128,int24)
handler: handleTokenSwap
file: ./src/mappings/uniswap-v3-pool.ts