Core Matic Subgraph
The probably best way to discover the subgraph is the GraphQL Playground from thegraph itself: Try the Playground
The full documentation can be found in the repository here
If you want connect to the endpoint please use the following endpoint: https://api.thegraph.com/subgraphs/name/aavegotchi/aavegotchi-core-matic Below you can find some possible use cases:

Examples

Get traits and modified traits of specific Aavegotchi

You can get information about the traits of the gotchi with the following query
1
{
2
aavegotchi(id: 4430) {
3
numericTraits, modifiedNumericTraits
4
}
5
}
Copied!
It will return an array with integers which represents the values of the six different traits. The order is: Energy, Aggression, Spookiness, Brain Size, Eye Shape, Eye Color
1
{
2
"data": {
3
"aavegotchi": {
4
"modifiedNumericTraits": [
5
18,
6
68,
7
10,
8
48,
9
82,
10
22
11
],
12
"numericTraits": [
13
17,
14
68,
15
10,
16
48,
17
82,
18
22
19
]
20
}
21
}
22
}
Copied!

Get Bazaar Listings of items which are a potion

Its also possible to fetch present and historic listings on the bazaar. If you want to fetch all available potions. You must first fetch the itemTypeID of the items you want to fetch and insert the IDs afterwards in your getListings Query:
1
{
2
itemTypes(where:{name_contains: "Potion"}) {
3
name, id
4
}
Copied!
will return
1
"itemTypes": [
2
{
3
"id": "126",
4
"name": "Kinship Potion"
5
},
6
{
7
"id": "127",
8
"name": "Greater Kinship Potion"
9
},
10
{
11
"id": "128",
12
"name": "XP Potion"
13
},
14
{
15
"id": "129",
16
"name": "Greater XP Potion"
17
}
18
]
Copied!
Afterwards you can get the Listings with:
1
erc1155Listings(where: {id_in: ["126", "127","128","129"]}) {
2
priceInWei, seller, quantity, erc1155TypeId, erc1155TokenAddress
3
}
Copied!
which will return
1
"erc1155Listings": [
2
{
3
"erc1155TokenAddress": "0x86935f11c86623dec8a25696e1c19a8659cbf95d",
4
"erc1155TypeId": "78",
5
"priceInWei": "200000000000000000000",
6
"quantity": "1",
7
"seller": "0xded1fd193cd8b55c2f9c42b3257d5a9088c7d137"
8
},
9
{
10
"erc1155TokenAddress": "0x86935f11c86623dec8a25696e1c19a8659cbf95d",
11
"erc1155TypeId": "106",
12
"priceInWei": "1100000000000000000000",
13
"quantity": "1",
14
"seller": "0x75ddb7ab958135bbe2dab48d6286826f6aa5e3b4"
15
},
16
{
17
"erc1155TokenAddress": "0x86935f11c86623dec8a25696e1c19a8659cbf95d",
18
"erc1155TypeId": "105",
19
"priceInWei": "3000000000000000000000",
20
"quantity": "1",
21
"seller": "0xf3152f7f73b3cc394708e6c465c4bc8598cc44f5"
22
},
23
{
24
"erc1155TokenAddress": "0x86935f11c86623dec8a25696e1c19a8659cbf95d",
25
"erc1155TypeId": "128",
26
"priceInWei": "398000000000000000000",
27
"quantity": "5",
28
"seller": "0xbeaea5d64b81e48e9f91870cbc8ca5f00d8c396f"
29
}
30
],
Copied!

Get user data

In case you need all the data from a specifc user you fetch also the user entities. The user contains arrays of from user bought & owned portals, as well as owned gotchis.
1
user(id: "0x1ad3d72e54fb0eb46e87f82f77b284fc8a66b16c") {
2
portalsOwned{id }, portalsBought {id},gotchisOwned { id, name },id
3
}
Copied!
returns
1
{
2
"data": {
3
"user": {
4
"gotchisOwned": [
5
{
6
"id": "4430",
7
"name": "ChillETH"
8
}
9
],
10
"id": "0x1ad3d72e54fb0eb46e87f82f77b284fc8a66b16c",
11
"portalsBought": [],
12
"portalsOwned": [
13
{
14
"id": "4430"
15
}
16
]
17
}
18
}
19
}
Copied!
Be sure that the ID is case sensitive and you have to provide the address as lowercase!

Get statistics

We also maintain some statistics on the subgraph. Such as portals bought, portal opened and aavegotchis claimed, but also some market data. You can query for volumes from the market:
1
{
2
statistics {
3
portalsBought,
4
portalsOpened,
5
aavegotchisClaimed,
6
erc721TotalVolume,
7
erc1155TotalVolume
8
}
9
}
Copied!
you will get something like
1
{
2
"data": {
3
"statistics": [
4
{
5
"aavegotchisClaimed": "7136",
6
"erc1155TotalVolume": "9486555714498572424804980",
7
"erc721TotalVolume": "11126949887492653499800000",
8
"portalsBought": "10000",
9
"portalsOpened": "7761"
10
}
11
]
12
}
13
}
Copied!
Last modified 3mo ago