-
Notifications
You must be signed in to change notification settings - Fork 2
/
subgraph.template.yaml
117 lines (117 loc) · 3.75 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
specVersion: 0.0.2
description: Fixed-rate, fixed-term lending protocol on Ethereum
repository: https://github.com/hifi-finance/hifi-subgraph
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: BalanceSheet
network: {{network}}
source:
abi: BalanceSheet
address: "{{contracts.balanceSheet.address}}"
startBlock: {{contracts.balanceSheet.startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
abis:
- name: BalanceSheet
file: ./abis/BalanceSheetV1.json
- name: Erc20
file: ./abis/Erc20.json
entities:
- Hifi
- Position
- Token
- Vault
eventHandlers:
- event: Borrow(indexed address,indexed address,uint256)
handler: handleBorrow
- event: DepositCollateral(indexed address,indexed address,uint256)
handler: handleDepositCollateral
- event: LiquidateBorrow(indexed address,indexed address,indexed address,uint256,address,uint256)
handler: handleLiquidateBorrow
- event: RepayBorrow(indexed address,indexed address,indexed address,uint256,uint256)
handler: handleRepayBorrow
- event: WithdrawCollateral(indexed address,indexed address,uint256)
handler: handleWithdrawCollateral
file: ./src/mappings/balanceSheet.ts
language: wasm/assemblyscript
- kind: ethereum/contract
name: Fintroller
network: {{network}}
source:
abi: Fintroller
address: "{{contracts.fintroller.address}}"
startBlock: {{contracts.fintroller.startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
abis:
- name: Erc20
file: ./abis/Erc20.json
- name: Fintroller
file: ./abis/FintrollerV1.json
entities:
- Hifi
eventHandlers:
- event: ListBond(indexed address,indexed address)
handler: handleListBond
- event: ListCollateral(indexed address,indexed address)
handler: handleListCollateral
file: ./src/mappings/fintroller.ts
language: wasm/assemblyscript
- kind: ethereum/contract
name: HifiPoolRegistry
network: {{network}}
source:
abi: HifiPoolRegistry
address: "{{contracts.hifiPoolRegistry.address}}"
startBlock: {{contracts.hifiPoolRegistry.startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
abis:
- name: Erc20
file: ./abis/Erc20.json
- name: HifiPool
file: ./abis/HifiPool.json
- name: HifiPoolRegistry
file: ./abis/HifiPoolRegistry.json
entities:
- Hifi
- Pool
eventHandlers:
- event: TrackPool(indexed address)
handler: handleTrackPool
- event: UntrackPool(indexed address)
handler: handleUntrackPool
file: ./src/mappings/hifiPoolRegistry.ts
language: wasm/assemblyscript
templates:
- kind: ethereum/contract
name: HifiPool
network: {{network}}
source:
abi: HifiPool
mapping:
kind: ethereum/events
apiVersion: 0.0.5
abis:
- name: ChainlinkOperator
file: ./abis/ChainlinkOperator.json
- name: Erc20
file: ./abis/Erc20.json
- name: HifiPool
file: ./abis/HifiPool.json
entities:
- Swap
eventHandlers:
- event: AddLiquidity(uint256,indexed address,uint256,uint256,uint256)
handler: handleAddLiquidity
- event: RemoveLiquidity(uint256,indexed address,uint256,uint256,uint256)
handler: handleRemoveLiquidity
- event: Trade(uint256,indexed address,indexed address,int256,int256)
handler: handleTrade
file: ./src/mappings/hifiPool.ts
language: wasm/assemblyscript