-
Notifications
You must be signed in to change notification settings - Fork 10
/
subgraph.yaml.mustache
74 lines (64 loc) · 2.4 KB
/
subgraph.yaml.mustache
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
# Subgraph manifest
# schema: https://github.com/graphprotocol/graph-node/blob/master/docs/subgraph-manifest.md
specVersion: 0.0.2
description: >
Gnosis Protocol introduces a new, fully decentralized exchange mechanism for ERC20 tokens with the following properties:
Batch auctions,
Multidimensional order books with ring trades, and
Uniform clearing prices in every batch
More info in https://docs.gnosis.io/protocol
repository: https://github.com/gnosis/dex-subgraph
schema:
file: ./schema.graphql
dataSources:
# BatchExchange contract
- kind: ethereum/contract
name: BatchExchange
network: {{ network }}
source:
address: '{{ address }}'
abi: BatchExchange
{{#startBlock}}
startBlock: {{ startBlock }}
{{/startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.3
language: wasm/assemblyscript
file: ./src/mappings/index.ts
entities:
- Order
- Token
abis:
- name: BatchExchange
file: ./abis/BatchExchange.json
- name: Erc20
file: ./abis/Erc20.json
eventHandlers:
# Tokens
- event: TokenListing(address,uint16)
handler: onTokenListing
# Deposits
- event: Deposit(indexed address,indexed address,uint256,uint32)
handler: onDeposit
# Withdrawals
- event: Withdraw(indexed address,indexed address,uint256)
handler: onWithdraw
- event: WithdrawRequest(indexed address,indexed address,uint256,uint32)
handler: onWithdrawRequest
# Orders
- event: OrderPlacement(indexed address,uint16,indexed uint16,indexed uint16,uint32,uint32,uint128,uint128)
handler: onOrderPlacement
# TODO: Update to @graphprotocol/graph-cli@0.19.0 when it's released
- event: OrderCancellation(indexed address,uint16)
handler: onOrderCancellation
- event: OrderDeletion(indexed address,uint16)
handler: onOrderDeletion
# Trades
- event: Trade(indexed address,indexed uint16,indexed uint16,uint16,uint128,uint128)
handler: onTrade
- event: TradeReversion(indexed address,indexed uint16,indexed uint16,uint16,uint128,uint128)
handler: onTradeReversion
# Solution Submission
- event: SolutionSubmission(indexed address,uint256,uint256,uint256,uint256,uint128[],uint16[])
handler: onSolutionSubmission