-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
169 lines (154 loc) · 3.45 KB
/
schema.graphql
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
enum NativeOrderType {
LimitOrder
}
enum TokenType {
ERC20
}
enum NFTType {
ERC721
ERC1155
}
enum TradeDirection {
Buy
Sell
}
type Transaction @entity {
# tx hash
id: ID!
blockNumber: BigInt!
timestamp: BigInt!
fills: [Fill!]!
nativeOrderFills: [NativeOrderFill!]! @derivedFrom(field: "transaction")
erc721OrderFills: [ERC721OrderFill!]! @derivedFrom(field: "transaction")
erc1155OrderFills: [ERC1155OrderFill!]! @derivedFrom(field: "transaction")
}
type Token @entity {
# token address
id: ID!
symbol: String!
decimals: BigInt!
limitOrderVolume: BigInt!
erc721Volume: BigInt!
erc1155Volume: BigInt!
type: TokenType!
}
type NFT @entity {
# token address
# In case of NFTs: tokenAddress-id
id: ID!
nftId: BigInt
tokenURI: String
collection: Collection
symbol: String!
type: NFTType!
fillCount: BigInt!
tokenVolume: [NFTVolume!]! @derivedFrom(field: "nft")
}
type NFTVolume @entity {
id: ID!
nft: NFT!
token: Token!
volume: BigInt!
fillCount: BigInt!
}
type Collection @entity {
# collection address
id: ID!
name: String
symbol: String!
type: NFTType!
fillCount: BigInt!
nfts: [NFT!]! @derivedFrom(field: "collection")
tokenVolume: [CollectionVolume!]! @derivedFrom(field: "collection")
}
type CollectionVolume @entity {
id: ID!
collection: Collection!
token: Token!
volume: BigInt!
fillCount: BigInt!
}
type Taker @entity {
# taker address
id: ID!
swapCount: BigInt!
nativeOrderFillCount: BigInt!
erc721OrderFillCount: BigInt!
erc1155OrderFillCount: BigInt!
erc721OrderFills: [ERC721OrderFill!]! @derivedFrom(field: "taker")
erc1155OrderFills: [ERC1155OrderFill!]! @derivedFrom(field: "taker")
nativeOrderFills: [NativeOrderFill!]! @derivedFrom(field: "taker")
}
type Maker @entity {
# maker address
id: ID!
erc721OrderFillCount: BigInt!
erc1155OrderFillCount: BigInt!
nativeOrderFillCount: BigInt!
nativeOrderFills: [NativeOrderFill!]! @derivedFrom(field: "maker")
erc721OrderFills: [ERC721OrderFill!]! @derivedFrom(field: "maker")
erc1155OrderFills: [ERC1155OrderFill!]! @derivedFrom(field: "maker")
}
type Fill @entity {
# tx hash - source - log index
id: ID!
blockNumber: BigInt!
timestamp: BigInt!
transaction: Transaction!
logIndex: BigInt
source: String!
recipient: Bytes!
# For native order fills this is the maker.
provider: Bytes
sender: Bytes
inputToken: Token!
outputToken: Token!
inputTokenAmount: BigInt!
outputTokenAmount: BigInt!
}
type NativeOrderFill @entity {
# tx hash - order hash - log index
id: ID!
transaction: Transaction!
timestamp: BigInt!
blockNumber: BigInt!
type: NativeOrderType!
orderHash: Bytes!
taker: Taker!
maker: Maker!
inputToken: Token!
outputToken: Token!
inputTokenAmount: BigInt!
outputTokenAmount: BigInt!
pool: Bytes!
fee: BigInt!
}
type ERC721OrderFill @entity {
# tx hash - order hash - log index
id: ID!
transaction: Transaction!
tradeDirection: TradeDirection!
timestamp: BigInt!
blockNumber: BigInt!
taker: Taker!
maker: Maker!
erc20Token: Token!
erc721Token: Token!
erc20TokenAmount: BigInt!
nonce: BigInt!
}
type ERC1155OrderFill @entity {
# tx hash - order hash - log index
id: ID!
transaction: Transaction!
tradeDirection: TradeDirection!
timestamp: BigInt!
blockNumber: BigInt!
taker: Taker!
maker: Maker!
erc20Token: Token!
erc1155Token: Token!
erc1155TokenAmount: BigInt!
erc20TokenAmount: BigInt!
nonce: BigInt!
}