forked from aavegotchi/aavegotchi-core-subgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
386 lines (291 loc) · 8.38 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
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
type AavegotchiOption @entity {
"AavegotchiOption id is composed by <PORTAL-ID>-<GOTCHI-OPTION>"
id: ID!
portalOptionId: Int!
owner: User!
portal: Portal!
randomNumber: BigInt!
numericTraits: [Int!]!
collateralType: Bytes!
minimumStake: BigInt!
baseRarityScore: Int!
}
type Aavegotchi @entity {
id: ID!
gotchiId: BigInt!
owner: User
originalOwner: User
portal: Portal! @derivedFrom(field: "gotchi")
hauntId: BigInt!
name: String!
nameLowerCase: String!
randomNumber: BigInt!
status: BigInt!
numericTraits: [Int!]!
modifiedNumericTraits: [Int!]!
withSetsNumericTraits: [Int!]
equippedWearables: [Int!]!
equippedSetID: BigInt
equippedSetName: String
possibleSets: BigInt
# equippedSetName: String
# equippedSetTraitBonuses:[Int!]
# rarityScoreWithSet:BigInt!
# numericTraitsWithSet:[Int!]
collateral: Bytes!
escrow: Bytes!
stakedAmount: BigInt!
minimumStake: BigInt!
kinship: BigInt! #The kinship value of this Aavegotchi. Default is 50.
lastInteracted: BigInt!
experience: BigInt! #How much XP this Aavegotchi has accrued. Begins at 0.
toNextLevel: BigInt!
usedSkillPoints: BigInt! #number of skill points used
level: BigInt! #the current aavegotchi level
baseRarityScore: BigInt!
modifiedRarityScore: BigInt!
withSetsRarityScore: BigInt
locked: Boolean!
listings: [ERC721Listing!]! @derivedFrom(field: "gotchi")
"Block in which the Aavegotchi entity was created"
createdAt: BigInt
"Block in which the Aavegotchi was claimed. Should coincide with createdAt"
claimedAt: BigInt
timesTraded: BigInt!
historicalPrices: [BigInt!]
activeListing: BigInt
lending: BigInt
}
enum PortalStatus {
Bought
Opened
Claimed
}
type Portal @entity {
id: ID!
gotchiId: BigInt
buyer: User
hauntId: BigInt!
owner: User
gotchi: Aavegotchi
status: PortalStatus
boughtAt: BigInt
openedAt: BigInt
claimedAt: BigInt
timesTraded: BigInt!
historicalPrices: [BigInt!]
activeListing: BigInt
}
type User @entity {
id: ID!
portalsBought: [Portal!]! @derivedFrom(field: "buyer")
gotchisOwned: [Aavegotchi!]! @derivedFrom(field: "owner")
gotchisOriginalOwned: [Aavegotchi!]! @derivedFrom(field: "originalOwner")
portalsOwned: [Portal!]! @derivedFrom(field: "owner")
parcelsOwned: [Parcel!]! @derivedFrom(field: "owner")
gotchisLentOut: [BigInt!]!
gotchisBorrowed: [BigInt!]!
# borrowedGotchis: [GotchiLending!]! @derivedFrom(field: "borrower")
# lendGotchis: [GotchiLending!]! @derivedFrom(field: "originalOwner")
}
type ERC721Listing @entity {
id: ID!
category: BigInt! # 0 = Closed Portal, 1 = VRF Pending, 2 = Open Portal, 3 = Aavegotchi
erc721TokenAddress: Bytes! # The token address of the NFT
tokenId: BigInt! # The token ID of the NFT
seller: Bytes! # The creator of the listing
buyer: Bytes
recipient: Bytes
timeCreated: BigInt! # Time at which listed was created
timePurchased: BigInt # Time when the listing was purchased
cancelled: Boolean # If the listing is cancelled
priceInWei: BigInt! # How much the listing is (in GHST)
gotchi: Aavegotchi # If the listing is for a gotchi, this will be populated
portal: Portal # If the listing is for a portal, this will be populated
parcel: Parcel # if the listing is for a parcel, this will be populated
hauntId: BigInt
kinship: BigInt
experience: BigInt
collateral: Bytes
baseRarityScore: BigInt
modifiedRarityScore: BigInt
equippedWearables: [Int!]
blockCreated: BigInt!
fudBoost: BigInt # boost of parcels
fomoBoost: BigInt # boost of parcels
alphaBoost: BigInt # boost of parcels
kekBoost: BigInt # boost of parcels
district: BigInt # district of parcel
coordinateX: BigInt # coordinate x of parcel
coordinateY: BigInt # coordinate y of parcel
size: BigInt # size of parcel
parcelHash: String # address/hash of parcel
nameLowerCase: String
amountEquippedWearables: Int
soldBefore: Boolean
claimedAt: BigInt
# Traits of Gotchi
nrgTrait: BigInt
aggTrait: BigInt
spkTrait: BigInt
brnTrait: BigInt
eysTrait: BigInt
eycTrait: BigInt
}
type ERC1155Listing @entity {
id: ID!
category: BigInt! # 0 = Wearable, #1 = Badge, #2 = Consumable, #3 = Ticket
erc1155TokenAddress: Bytes!
erc1155TypeId: BigInt!
seller: Bytes!
priceInWei: BigInt!
quantity: BigInt!
cancelled: Boolean!
timeCreated: BigInt! # Time at which listed was created
timeLastPurchased: BigInt! # Time when the listing was purchased
sold: Boolean!
rarityLevel: BigInt
rarityScoreModifier: BigInt
nrgTraitModifier: BigInt
aggTraitModifier: BigInt
spkTraitModifier: BigInt
brnTraitModifier: BigInt
eysTraitModifier: BigInt
eycTraitModifier: BigInt
}
type ERC1155Purchase @entity {
id: ID!
listingID: BigInt!
category: BigInt! # 0 = Wearable, #1 = Badge, #2 = Consumable, #3 = Ticket
erc1155TokenAddress: Bytes!
erc1155TypeId: BigInt!
seller: Bytes!
buyer: Bytes!
recipient: Bytes
priceInWei: BigInt!
quantity: BigInt!
#cancelled: Boolean!
# timeCreated: BigInt! # Time at which listed was created
timeLastPurchased: BigInt! # Time when the listing was purchased
#sold: Boolean!
rarityLevel: BigInt
}
type Statistic @entity {
"There will be a single Statistic entity with id = '0'"
id: ID!
"Total amount of portals that have been bought."
portalsBought: BigInt!
"Total amount of portals that have been opened"
portalsOpened: BigInt!
"Total amount of Aavegotchis claimed"
aavegotchisClaimed: BigInt!
"Total amount of Aavegotchis sacrificed"
aavegotchisSacrificed: BigInt!
"Total amount of Aavegotchis borrowed"
aavegotchisBorrowed: BigInt!
erc721ActiveListingCount: BigInt! #Total # of active ERC721 Listings
erc1155ActiveListingCount: BigInt! #Total # of active ERC1155 Listings
erc721TotalVolume: BigInt! #Total traded volume in GHST
erc1155TotalVolume: BigInt! #Total traded volume in GHST
#new
totalWearablesVolume: BigInt!
totalConsumablesVolume: BigInt!
totalTicketsVolume: BigInt!
}
type ItemType @entity {
id: ID!
svgId: BigInt!
name: String!
desc: String
author: String
traitModifiers: [Int!]
slotPositions: [Boolean!]
ghstPrice: BigInt!
maxQuantity: BigInt!
totalQuantity: BigInt!
rarityScoreModifier: Int!
canPurchaseWithGhst: Boolean!
minLevel: Int
canBeTransferred: Boolean!
category: Int!
kinshipBonus: Int
experienceBonus: BigInt
consumed: BigInt!
}
type WearableSet @entity {
id: ID!
name: String!
allowedCollaterals: [Int!]
wearableIds: [Int!]
traitBonuses: [Int!]
}
type Parcel @entity {
id: ID!
tokenId: BigInt!
parcelId: String!
owner: User!
coordinateX: BigInt!
coordinateY: BigInt!
district: BigInt!
parcelHash: String!
fudBoost: BigInt!
fomoBoost: BigInt!
alphaBoost: BigInt!
kekBoost: BigInt!
size: BigInt!
auctionId: String
timesTraded: BigInt!
historicalPrices: [BigInt!]
activeListing: BigInt
}
### lending
type GotchiLending @entity {
id: ID!
rentDuration: BigInt!
upfrontCost: BigInt!
period: BigInt!
gotchi: Aavegotchi!
# gotch filter attributes
gotchiBRS: BigInt
gotchiTokenId: BigInt!
gotchiKinship: BigInt!
# profit split
splitOwner: BigInt
splitBorrower: BigInt
splitOther: BigInt
# tokens to share
tokensToShare: [Bytes!]!
whitelist: Whitelist
whitelistMembers: [Bytes!]!
whitelistId: BigInt
thirdPartyAddress: Bytes
borrower: Bytes
lender: Bytes
originalOwner: Bytes
cancelled: Boolean!
completed: Boolean!
lastClaimed: BigInt
timeAgreed: BigInt
timeCreated: BigInt
timeEnded: BigInt
claimed: [ClaimedToken!]! @derivedFrom(field: "lending")
}
type ClaimedToken @entity {
id: ID!
lending: GotchiLending!
token: Bytes!
amount: BigInt!
}
type Whitelist @entity {
id: ID!
name: String!
members: [Bytes!]!
owner: User!
ownerAddress: Bytes!
"Access Right for max borrowed Gotchis, default 1"
maxBorrowLimit: Int
}
#type Upgrade @entity {
# id: ID!
# calldata:
#}