-
Notifications
You must be signed in to change notification settings - Fork 241
/
schema-nft-marketplace.graphql
346 lines (244 loc) · 9.41 KB
/
schema-nft-marketplace.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# Subgraph Schema: NFT Marketplace
# Version: 2.1.0
# See https://github.com/messari/subgraphs/blob/master/docs/SCHEMA.md for details
enum Network {
ARBITRUM_ONE
ARWEAVE_MAINNET
AURORA
AVALANCHE
BOBA
BSC # aka BNB Chain
CELO
COSMOS
CRONOS
MAINNET # Ethereum Mainnet
FANTOM
FUSE
HARMONY
JUNO
MOONBEAM
MOONRIVER
NEAR_MAINNET
OPTIMISM
OSMOSIS
MATIC # aka Polygon
GNOSIS
}
enum NftStandard {
ERC721
ERC1155
UNKNOWN
}
enum SaleStrategy {
" Strategy that executes an order at a fixed price that can be taken either by a bid or an ask. "
FIXED_PRICE
" Strategy that executes an order at a fixed price that can be matched by any tokenId for the collection. "
ANY_ITEM_FROM_COLLECTION
" Strategy that executes an order at a fixed price that can be matched by any tokenId in a set of tokenIds. "
ANY_ITEM_FROM_SET
" Strategy to launch a Dutch Auction for a token where the price decreases linearly until a specified timestamp and end price defined by the seller. "
DUTCH_AUCTION
" Strategy to set up an order that can only be executed by a specific address. "
PRIVATE_SALE
" Other type of sale strategy. "
UNKNOWN
}
type Marketplace @entity @regularPolling {
" Smart contract address of the protocol's main contract (Factory, Registry, etc) "
id: ID!
" Name of the NFT marketplace, for example OpenSea. "
name: String!
" Slug of the NFT marketplace, for example OpenSea. "
slug: String!
" The blockchain network this subgraph is indexing on. "
network: Network!
" Version of the subgraph schema, in SemVer format (e.g. 1.0.0) "
schemaVersion: String!
" Version of the subgraph implementation, in SemVer format (e.g. 1.0.0) "
subgraphVersion: String!
" Version of the methodology used to compute metrics, loosely based on SemVer format (e.g. 1.0.0) "
methodologyVersion: String!
" Number of collections listed on the marketplace. "
collectionCount: Int!
" Trade count of the all collections on the marketplace. "
tradeCount: Int!
" Cumulative trade volume (in ETH) "
cumulativeTradeVolumeETH: BigDecimal!
" Cumulative trade volume (in USD) "
cumulativeTradeVolumeUSD: BigDecimal!
" Revenue in ETH that goes to the marketplace protocol, aka protocol fee. "
marketplaceRevenueETH: BigDecimal!
" Revenue in USD that goes to the marketplace protocol, aka protocol fee. "
marketplaceRevenueUSD: BigDecimal!
" Revenue in ETH that goes to creator, aka royalty fee. "
creatorRevenueETH: BigDecimal!
" Revenue in USD that goes to creator, aka royalty fee. "
creatorRevenueUSD: BigDecimal!
" Sum of marketplaceRevenueETH and creatorRevenueETH. "
totalRevenueETH: BigDecimal!
" Sum of marketplaceRevenueUSD and creatorRevenueUSD. "
totalRevenueUSD: BigDecimal!
" Cumulative unique traders. "
cumulativeUniqueTraders: Int!
" Trades on the marketplace. "
trades: [Trade!]! @derivedFrom(field: "marketplace")
" Marketplace collections. "
collections: [Collection!]! @derivedFrom(field: "marketplace")
" Marketplace daily snapshots. "
snapshots: [MarketplaceDailySnapshot!]! @derivedFrom(field: "marketplace")
}
type Collection @entity @regularPolling {
" Contract address. "
id: ID!
" Collection name, mirrored from the smart contract. Leave null if not available. "
name: String
" Collection symbol, mirrored from the smart contract. Leave null if not available. "
symbol: String
" NFT Standard the collection uses. "
nftStandard: NftStandard!
" Marketplace that this collection was traded in. "
marketplace: Marketplace!
" Royalty fee rate in percentage. E.g. 2.5% should be 2.5 "
royaltyFee: BigDecimal!
" Cumulative trade volume (in ETH) "
cumulativeTradeVolumeETH: BigDecimal!
" Cumulative trade volume (in USD) "
cumulativeTradeVolumeUSD: BigDecimal!
" Revenue in ETH that goes to the marketplace protocol, aka protocol fee. "
marketplaceRevenueETH: BigDecimal!
" Revenue in USD that goes to the marketplace protocol, aka protocol fee. "
marketplaceRevenueUSD: BigDecimal!
" Revenue in ETH that goes to creator, aka royalty fee. "
creatorRevenueETH: BigDecimal!
" Revenue in USD that goes to creator, aka royalty fee. "
creatorRevenueUSD: BigDecimal!
" Sum of marketplaceRevenueETH and creatorRevenueETH. "
totalRevenueETH: BigDecimal!
" Sum of marketplaceRevenueUSD and creatorRevenueUSD. "
totalRevenueUSD: BigDecimal!
" Trade count of the collection on the marketplace. "
tradeCount: Int!
" Buyer count. "
buyerCount: Int!
" Seller count. "
sellerCount: Int!
" Trades of the collection. "
trades: [Trade!]! @derivedFrom(field: "collection")
" Collection daily snapshots. "
snapshots: [CollectionDailySnapshot!]! @derivedFrom(field: "collection")
}
" Trades exist such as a combination of taker/order and bid/ask. "
type Trade @entity @transaction {
" { Transaction hash }-{ Log index }-{ (optional) ID within bundle } "
id: ID!
" Event transaction hash. "
transactionHash: String!
" Event log index. "
logIndex: Int!
" Block timestamp where the trade is executed. "
timestamp: BigInt!
" Block number where the trade is executed. "
blockNumber: BigInt!
" Whether the trade is in a bundle. "
isBundle: Boolean!
" Collection involved. "
collection: Collection!
" Marketplace involved. "
marketplace: Marketplace!
" Token ID of the traded NFT. "
tokenId: BigInt!
" The amount of token to transfer. It is set at 1 except for ERC1155 batch. "
amount: BigInt!
" Price (in ETH). If only 1 tokenId is involved, then the price is determined by the token only. If the trade is incurred by a batch purchasing (available in x2y2), then the price is the average price in the batch. "
priceETH: BigDecimal!
" Price (in USD). If only 1 tokenId is involved, then the price is determined by the token only. If the trade is incurred by a batch purchasing (available in x2y2), then the price is the average price in the batch. "
priceUSD: BigDecimal!
" Stretegy that the trade is executed. "
strategy: SaleStrategy!
" Buyer account address. "
buyer: String!
" Seller account address. "
seller: String!
}
type MarketplaceDailySnapshot @entity @dailySnapshot {
" { Contract address }-{# of days since Unix epoch time} "
id: ID!
" The marketplace that this snapshot belongs to. "
marketplace: Marketplace!
" Block number where the snapshot is taken. "
blockNumber: BigInt!
" Block timestamp when the snapshot is taken. "
timestamp: BigInt!
" Number of collections listed on the marketplace. "
collectionCount: Int!
" Cumulative trade volume (in ETH) "
cumulativeTradeVolumeETH: BigDecimal!
" Cumulative trade volume (in USD) "
cumulativeTradeVolumeUSD: BigDecimal!
" Revenue in ETH that goes to the marketplace protocol, aka protocol fee. "
marketplaceRevenueETH: BigDecimal!
" Revenue in USD that goes to the marketplace protocol, aka protocol fee. "
marketplaceRevenueUSD: BigDecimal!
" Revenue in ETH that goes to creator, aka royalty fee. "
creatorRevenueETH: BigDecimal!
" Revenue in USD that goes to creator, aka royalty fee. "
creatorRevenueUSD: BigDecimal!
" Sum of marketplaceRevenueETH and creatorRevenueETH. "
totalRevenueETH: BigDecimal!
" Sum of marketplaceRevenueUSD and creatorRevenueUSD. "
totalRevenueUSD: BigDecimal!
" Trade count of the all collections on the marketplace. "
tradeCount: Int!
" Cumulative unique traders. "
cumulativeUniqueTraders: Int!
" Daily active traders. "
dailyActiveTraders: Int!
" Number of traded collections of the day. "
dailyTradedCollectionCount: Int!
" Number of traded items of the day. "
dailyTradedItemCount: Int!
}
type CollectionDailySnapshot @entity @dailySnapshot {
" { Contract address }-{# of days since epoch unix time } "
id: ID!
" The collection that this snapshot belongs to. "
collection: Collection!
" Block number where the snapshot is taken. "
blockNumber: BigInt!
" Block timestamp when the snapshot is taken. "
timestamp: BigInt!
" Royalty fee rate in percentage. E.g. 2.5% should be 2.5 "
royaltyFee: BigDecimal!
" Minimum sale price of the day (in ETH) "
dailyMinSalePriceETH: BigDecimal!
" Minimum sale price of the day (in USD) "
dailyMinSalePriceUSD: BigDecimal!
" Maximum sale price of the day (in ETH) "
dailyMaxSalePriceETH: BigDecimal!
" Maximum sale price of the day (in USD) "
dailyMaxSalePriceUSD: BigDecimal!
" Cumulative trade volume (in ETH) "
cumulativeTradeVolumeETH: BigDecimal!
" Cumulative trade volume (in USD) "
cumulativeTradeVolumeUSD: BigDecimal!
" Daily trade volume (in ETH) "
dailyTradeVolumeETH: BigDecimal!
" Daily trade volume (in USD) "
dailyTradeVolumeUSD: BigDecimal!
" Revenue in ETH that goes to the marketplace protocol, aka protocol fee. "
marketplaceRevenueETH: BigDecimal!
" Revenue in USD that goes to the marketplace protocol, aka protocol fee. "
marketplaceRevenueUSD: BigDecimal!
" Revenue in ETH that goes to creator, aka royalty fee. "
creatorRevenueETH: BigDecimal!
" Revenue in USD that goes to creator, aka royalty fee. "
creatorRevenueUSD: BigDecimal!
" Sum of marketplaceRevenueETH and creatorRevenueETH. "
totalRevenueETH: BigDecimal!
" Sum of marketplaceRevenueUSD and creatorRevenueUSD. "
totalRevenueUSD: BigDecimal!
" Trade count of the collection on the marketplace. "
tradeCount: Int!
" Number of traded items of the day. "
dailyTradedItemCount: Int!
}