-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.graphql
More file actions
457 lines (320 loc) · 9.55 KB
/
Copy pathschema.graphql
File metadata and controls
457 lines (320 loc) · 9.55 KB
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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
type SupportedCollection @entity {
" the ID is supportedcollection and collection address "
id: ID!
" Collection fee revenue collector "
feeCollector: Bytes!
" The trading fee for the collection "
royaltyFees: BigInt!
" Collection verification status "
verificationStatus: Int!
" The collection address "
collection: collection!
}
type ApprovedForAll @entity {
" the ID is approvedforall, collection address and owner address "
id: ID!
" The collection address this account has approved for all "
collection: collection!
" The account that approved all nfts in this collection to marketplace "
account: account!
" The approval status "
approved: Boolean
}
type SaleInfo @entity {
" The ID is the concatenation of the saleinfo, collection address, and token ID "
id: ID!
" The collection address for the sale "
collection: collection!
" The token ID involved in the sale "
tokenId: token!
" The seller of the token "
seller: account!
" The price of the token "
salePrice: BigInt
" The state of the sale; fixedSale, auctionSale and none "
state: String!
" The starting bid for the auction if sale is an auction "
startingBid: BigInt
" The highest bid and current for the auction "
highestBid: BigInt
" The highest bidder for the auction "
highestBidder: account
" The time the auction ends "
validity: BigInt
" The token is approved, for fixedSale only "
approved: Boolean
" The time the auction was created "
blockTimestamp: BigInt!
" The transaction hash for the sale "
transactionHash: Bytes!
}
type CollectionOffer @entity {
" The ID is the concatenation of the collectionoffers, collection address and the offer creator "
id: ID!
" The collection address for the offer "
collection: collection!
" The offer creator "
creator: account!
" The offer amount/value "
amount: BigInt!
" The total count of nfts the Offer creator is offering to buy "
total: BigInt!
" The validity period of the offer "
validity: BigInt
" The time the offer was created "
blockTimestamp: BigInt!
" The transaction hash for the offer "
transactionHash: Bytes!
}
type CollectionsTokenOffer @entity {
" The ID is the concatenation of the collectionstokenoffers, collection address, and tokenId "
id: ID!
" The collection address for the offer "
collection: collection!
" The offer creator "
creator: account!
" The token ID involved in the offer "
tokenId: token!
" The offer amount/value "
value: BigInt!
" The validity period of the offer "
validity: BigInt
" The time the offer was created "
blockTimestamp: BigInt!
" The transaction hash for the offer "
transactionHash: Bytes!
}
type contract @entity {
id: ID!
asERC721: collection
}
type account @entity {
" the wallet address "
id: ID!
" The NFTs owned by this account "
tokens: [token!]! @derivedFrom(field: "owner")
" The points earned by this account "
points: Int!
" The total volume of sales for this account "
totalVolume: BigInt!
" The total sales for this account "
totalSales: Int!
" The total revenue generated for this account "
revenue: BigInt!
" The transfers originating from this account "
transfersFrom: [transfer!] @derivedFrom(field: "senderAddress")
" The transfers recevied by this account"
transfersTo: [transfer!] @derivedFrom(field: "receiverAddress")
" M:M relationship for Accounts and Collections "
accountCollection: [accountCollection!] @derivedFrom(field: "account")
" Tokens on sale for account"
saleInfo: [SaleInfo!] @derivedFrom(field: "seller")
" Tokens bidded by account"
bids: [SaleInfo!] @derivedFrom(field: "highestBidder")
" Marketplace is approved to spend all this account nfts for a collection "
approved: [ApprovedForAll!] @derivedFrom(field: "account")
collectionOffers: [CollectionOffer!] @derivedFrom(field: "creator")
tokenCollectionOffers: [CollectionsTokenOffer!] @derivedFrom(field: "creator")
}
type collection @entity {
" The address of the collection "
id: ID!
" The name of the collection "
name: String
" The symbol for the collection "
symbol: String
" Total Supply of Tokens "
totalSupply: BigInt
" Total Value locked for offers "
TVL: BigInt!
" Mint Price "
mintPrice: BigDecimal
" Tokens for the collection"
tokens: [token!]! @derivedFrom(field: "collection")
" Tokens in the collection for sale"
saleInfo: [SaleInfo!] @derivedFrom(field: "collection")
collectionOffers: [CollectionOffer!] @derivedFrom(field: "collection")
" Collection supports metadata "
supportsMetadata: Boolean
" Total sales "
totalSales: Int!
" Total volume "
totalVolume: BigDecimal!
" Top Sale ever "
topSale: BigDecimal!
" Hourly info about the collection "
hourlyCollectionSnapshot: [hourlyCollectionSnapshot!]!
@derivedFrom(field: "collection")
" Daily info about the collection "
dailyCollectionSnapshot: [dailyCollectionSnapshot!]!
@derivedFrom(field: "collection")
" Weekly info about the collection "
weeklyCollectionSnapshot: [weeklyCollectionSnapshot!]!
@derivedFrom(field: "collection")
" M:M relationship for Accounts and Collections "
accountCollection: [accountCollection!]! @derivedFrom(field: "collection")
}
type token @entity {
" kcc / Collection Addrress - Token Id "
id: ID!
" The collection address "
collection: collection!
" The id of the NFT"
identifier: BigInt!
" The token URI "
tokenURI: String!
" Used to track last fetched time for token metadata "
updatedAtTimestamp: BigInt!
" Token ID / identifier but as a string for fullTextSearch "
tokenId: String!
" The address that currently owns the token "
owner: account
" Transfers involving this token "
transfers: [transfer!]! @derivedFrom(field: "token")
saleInfo: SaleInfo @derivedFrom(field: "tokenId")
}
type accountCollection @entity {
" Account Id - Collection Id "
id: ID!
" Address of the account "
account: account
" Address of the NFT Collection "
collection: collection
" Count of NFT's owned in a collection by the Address"
tokenCount: Int!
}
type transaction @entity {
" the hash of the tx"
id: ID!
" Timestamp for block "
timestamp: Int!
" Block Number "
blockNumber: Int!
" Address who initiated the transaction "
transactionFrom: Bytes!
" Count of how many transfers were not matched to a sale "
unmatchedTransferCount: Int!
" Transfers that occured within the transaction "
transfers: [transfer!]!
" Sale events that occured within the transaction "
sales: [sale!] @derivedFrom(field: "transaction")
" Gas Spent "
gasPrice: BigInt
}
type transfer @entity {
" Block Number and Event Id in which the transfers event occured"
id: ID!
" Transaction hash in which the transfer event occured"
transaction: transaction!
" The collection address "
collection: collection!
" The collection addrress - The token id "
token: token!
" The sender address "
senderAddress: account
" The receiver address "
receiverAddress: account
" Timestamp for block "
timestamp: Int!
" Block Number "
blockNumber: Int!
" The amount of KCS/WKCS paid"
amount: BigDecimal!
" matched sale event for the transfer "
matchedSale: sale
}
type sale @entity {
" Block Number and Event Id in which the sale event occured"
id: ID!
" tx that the sale occured in "
transaction: transaction!
" the currency that the sale occred in "
currency: currency
" Timestamp for block "
timestamp: Int!
" Block Number "
blockNumber: Int!
" the amount of the sale "
amount: BigDecimal!
" The sale type "
strategy: String
}
type currency @entity {
" Currency Address "
id: ID!
decimals: Int
name: String!
symbol: String!
}
type hourlyCollectionSnapshot @entity {
" The collection address - The hour "
id: ID!
" Unix Hour (Timestamp / 3600 * 3600) "
timestamp: Int
" The collection address "
collection: collection!
" The hourly volume "
hourlyVolume: BigDecimal!
" Number of hourly transactions "
hourlyTransactions: Int
" Average sale amount for the day "
hourlyAvgSale: BigDecimal!
" Hourly top sales "
topSale: BigDecimal!
" Hourly bottom sales "
bottomSale: BigDecimal!
}
type dailyCollectionSnapshot @entity {
" The collection address - The day "
id: ID!
" Unix Day (Timestamp / 86400 * 86400) "
timestamp: Int
" The collection address "
collection: collection!
" The daily volume "
dailyVolume: BigDecimal!
" Number of daily transactions "
dailyTransactions: Int
" Average sale amount for the day "
dailyAvgSale: BigDecimal!
" Daily top sales "
topSale: BigDecimal!
" Daily bottom sales "
bottomSale: BigDecimal!
}
type weeklyCollectionSnapshot @entity {
" The collection address - The week "
id: ID!
" Unix Week (Timestamp / 604800 * 604800) "
timestamp: Int
" The collection address "
collection: collection!
" The monthly volume "
weeklyVolume: BigDecimal!
" Number of monthly transactions "
weeklyTransactions: Int
" Average sale amount for the day "
weeklyAvgSale: BigDecimal!
" Weekly top sales "
topSale: BigDecimal!
" Weekly bottom sales "
bottomSale: BigDecimal!
}
type wethTransaction @entity {
" Hash for weth contained transaction "
id: ID!
}
type _Schema_
@fulltext(
name: "marketSearch"
language: en
algorithm: rank
include: [
{ entity: "token", fields: [{ name: "tokenId" }] }
{ entity: "account", fields: [{ name: "id" }] }
{
entity: "collection"
fields: [{ name: "id", name: "name", name: "symbol" }]
}
]
)