forked from notional-finance/subgraph-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubgraph.template.yaml
145 lines (145 loc) · 5.76 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
specVersion: 0.0.2
description: Notional V2 Subgraph
repository: https://github.com/notional-finance/notional
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Governor
network: {{networkName}}
source:
address: '{{ governor }}'
abi: Governor
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
language: wasm/assemblyscript
entities:
- Proposal
- Vote
- Delegate
abis:
- name: Governor
file: ./abi/Governor.json
eventHandlers:
# TODO: need to update threshold, blocks, minDelay etc
- event: ProposalCreated(indexed uint256,indexed address,address[],uint256[],bytes[],uint256,uint256)
handler: handleProposalCreated
- event: VoteCast(indexed address,indexed uint256,bool,uint256)
handler: handleVoteCast
- event: ProposalCanceled(indexed uint256)
handler: handleProposalCanceled
- event: ProposalQueued(indexed uint256,uint256)
handler: handleProposalQueued
- event: ProposalExecuted(indexed uint256)
handler: handleProposalExecuted
file: ./src/governor.ts
- kind: ethereum/contract
name: NoteERC20
network: {{networkName}}
source:
address: '{{ note }}'
abi: NoteERC20
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
language: wasm/assemblyscript
entities:
- Delegate
abis:
- name: NoteERC20
file: ./abi/NoteERC20.json
eventHandlers:
- event: DelegateChanged(indexed address,indexed address,indexed address)
handler: handleDelegateChanged
- event: DelegateVotesChanged(indexed address,uint256,uint256)
handler: handleDelegateVotesChanged
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
file: ./src/noteERC20.ts
- kind: ethereum/contract
name: Notional
network: {{networkName}}
source:
address: '{{ notional }}'
abi: Notional
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
language: wasm/assemblyscript
entities:
- Currency
- ETHExchangeRate
- AssetExchangeRate
- CashGroup
- nToken
- TransferOperator
abis:
- name: Notional
file: ./abi/Notional.json
- name: ERC20
file: ./abi/ERC20.json
eventHandlers:
# Governance Events
- event: ListCurrency(uint16)
handler: handleListCurrency
- event: UpdateETHRate(uint16)
handler: handleUpdateETHRate
- event: UpdateAssetRate(uint16)
handler: handleUpdateAssetRate
- event: UpdateCashGroup(uint16)
handler: handleUpdateCashGroup
- event: DeployNToken(uint16,address)
handler: handleDeployNToken
- event: UpdateDepositParameters(uint16)
handler: handleUpdateDepositParameters
- event: UpdateInitializationParameters(uint16)
handler: handleUpdateInitializationParameters
- event: UpdateIncentiveEmissionRate(uint16,uint32)
handler: handleUpdateIncentiveEmissionRate
- event: UpdateTokenCollateralParameters(uint16)
handler: handleUpdateTokenCollateralParameters
- event: UpdateGlobalTransferOperator(address,bool)
handler: handleUpdateGlobalTransferOperator
- event: UpdateAuthorizedCallbackContract(address,bool)
handler: handleUpdateAuthorizedCallbackContract
- event: UpdateMaxCollateralBalance(uint16,uint72)
handler: handleUpdateMaxCollateralBalance
- event: SetSettlementRate(indexed uint256,indexed uint256,uint128)
handler: handleSetSettlementRate
- event: MarketsInitialized(uint16)
handler: handleMarketsInitialized
- event: SweepCashIntoMarkets(uint16,int256)
handler: handleSweepCashIntoMarkets
# These two events update the whole account
- event: AccountContextUpdate(indexed address)
handler: handleAccountContextUpdate
- event: AccountSettled(indexed address)
handler: handleAccountSettled
# Does account update for nToken
- event: nTokenSupplyChange(indexed address,indexed uint16,int256)
handler: handleNTokenSupplyChange
# Updates markets and emits trade events
- event: LendBorrowTrade(indexed address,indexed uint16,uint40,int256,int256)
handler: handleLendBorrowTrade
- event: AddRemoveLiquidity(indexed address,indexed uint16,uint40,int256,int256,int256)
handler: handleAddRemoveLiquidity
- event: SettledCashDebt(indexed address,indexed uint16,indexed address,int256,int256)
handler: handleSettledCashDebt
- event: nTokenResidualPurchase(indexed uint16,indexed uint40,indexed address,int256,int256)
handler: handleNTokenResidualPurchase
# fCash Transfers
# - event: TransferSingle(indexed address,indexed address,indexed address,uint256,uint256)
# handler: handleERC115Transfer
# - event: TransferBatch(indexed address,indexed address,indexed address,uint256[],uint256[])
# handler: handleERC115BatchTransfer
- event: LiquidateLocalCurrency(indexed address,indexed address,uint16,int256)
handler: handleLiquidateLocalCurrency
- event: LiquidateCollateralCurrency(indexed address,indexed address,uint16,uint16,int256,int256,int256)
handler: handleLiquidateCollateralCurrency
- event: LiquidatefCashEvent(indexed address,indexed address,uint16,uint16,int256,uint256[],int256[])
handler: handleLiquidatefCash
file: ./src/notional.ts