Search…
Subgraph Sample Request
Requesting data from the NFTX Subgraph.
The NFTX app is powered by a combination of Web3 calls for realtime data (token prices, connected wallet holdings etc) and calls to The Graph for the data that can't easily be requested from the blockchain.
Below are some common requests that you can make to the NFTX V2 subgraph to retrieve data about the vaults and their holdings.

NFTX V2 Subgraph Endpoint

You can make POST requests to the following endpoint.
http://api.thegraph.com/subgraphs/name/nftx-project/nftx-v2

Global Fees

This request returns the global fees (default fees) that are applied to all vaults. The vaults have their own fees also applied to them so check what the usesFactoryFees is set to. If it is set to true then the global fees are used, if it is set to false then the fees defined on the vault are used.
Request
Response
1
{
2
globals {
3
fees {
4
mintFee
5
randomRedeemFee
6
targetRedeemFee
7
randomSwapFee
8
targetSwapFee
9
}
10
}
11
}
Copied!
1
{
2
"data": {
3
"globals": [
4
{
5
"fees": {
6
"mintFee": "100000000000000000",
7
"randomRedeemFee": "40000000000000000",
8
"targetRedeemFee": "60000000000000000",
9
"randomSwapFee": "40000000000000000",
10
"targetSwapFee": "60000000000000000"
11
}
12
}
13
]
14
}
15
}
Copied!

Retrieve first 10 Published Vaults with Holdings

This request returns the first 10 vaults that have been finalised and have more than 0 NFTs in the holdings. To get all vaults change the first: 10 to first: 1000 .
Request
Response
1
{
2
vaults(
3
first: 10
4
where: { vaultId_gte: 0, isFinalized: true, totalHoldings_gt: 0 }
5
) {
6
vaultId
7
token {
8
id
9
name
10
symbol
11
}
12
}
13
}
Copied!
1
{
2
"data": {
3
"vaults": [
4
{
5
"vaultId": "297",
6
"token": {
7
"id": "0x00c4a73f10b05228c64e971cf81ae84426a64780",
8
"name": "MineablePunks",
9
"symbol": "MPUNK"
10
}
11
},
12
{
13
"vaultId": "370",
14
"token": {
15
"id": "0x00d0a61c5cb78f236a715fe08a6bb4a72514f460",
16
"name": "R0N1 World",
17
"symbol": "RONI"
18
}
19
},
20
{
21
"vaultId": "220",
22
"token": {
23
"id": "0x0115bd305885999562d593c94328fe25190dbc90",
24
"name": "EtherGals",
25
"symbol": "ETHGAL"
26
}
27
},
28
{
29
"vaultId": "379",
30
"token": {
31
"id": "0x011671956844f31620bb8b9709f32230186a307a",
32
"name": "Turtle Town",
33
"symbol": "TRTL"
34
}
35
},
36
{
37
"vaultId": "131",
38
"token": {
39
"id": "0x01b0b287f784ccd19cf0a7c11127a70963fd9d30",
40
"name": "Party Penguins",
41
"symbol": "PPENG"
42
}
43
},
44
{
45
"vaultId": "411",
46
"token": {
47
"id": "0x03b1a9e8bc6cbe4beaeeac277a042a584fe0af59",
48
"name": "Goopdoods Vault",
49
"symbol": "GOOP"
50
}
51
},
52
{
53
"vaultId": "286",
54
"token": {
55
"id": "0x03f80ed11125f72537b8ad25855f907f5ef53c65",
56
"name": "HoneyBadger by Robness 734 ttl",
57
"symbol": "HONEYB"
58
}
59
},
60
{
61
"vaultId": "145",
62
"token": {
63
"id": "0x04c5d215401411c4f28e167b3e9e3290d1178cd8",
64
"name": "JunkYard Dogs",
65
"symbol": "JYD"
66
}
67
},
68
{
69
"vaultId": "126",
70
"token": {
71
"id": "0x051218de982d91c3af03187ed3d8a0dde8231333",
72
"name": "Nice Drips",
73
"symbol": "DRIP"
74
}
75
},
76
{
77
"vaultId": "427",
78
"token": {
79
"id": "0x055c4497506ee438c6f7a73a8750561d4a334712",
80
"name": "Rebel's Haunted Mansion",
81
"symbol": "REBEL"
82
}
83
}
84
]
85
}
86
}
Copied!

Single Vault Details

If you want all the details for a single vault you can pass across the vaultId as an argument
Request
Response
1
{
2
vaults(
3
first: 1000
4
where: { vaultId: 0 }
5
) {
6
vaultId
7
id
8
is1155
9
isFinalized
10
totalHoldings
11
totalMints
12
totalRedeems
13
totalFees
14
totalSwaps
15
createdAt
16
holdings(first: 1000, orderBy: tokenId, orderDirection: asc) {
17
id
18
tokenId
19
amount
20
dateAdded
21
}
22
token {
23
id
24
name
25
symbol
26
}
27
fees {
28
mintFee
29
randomRedeemFee
30
targetRedeemFee
31
randomSwapFee
32
targetSwapFee
33
}
34
usesFactoryFees
35
asset {
36
id
37
name
38
symbol
39
}
40
manager {
41
id
42
}
43
createdBy {
44
id
45
}
46
eligibilityModule {
47
id
48
eligibleIds
49
eligibleRange
50
}
51
features {
52
enableMint
53
enableRandomRedeem
54
enableTargetRedeem
55
enableRandomSwap
56
enableTargetSwap
57
}
58
inventoryStakingPool {
59
id
60
dividendToken {
61
symbol
62
}
63
}
64
lpStakingPool {
65
id
66
stakingToken {
67
id
68
}
69
}
70
}
71
}
72
Copied!
1
{
2
"data": {
3
"vaults": [
4
{
5
"vaultId": "0",
6
"id": "0x269616d549d7e8eaa82dfb17028d0b212d11232a",
7
"is1155": false,
8
"isFinalized": true,
9
"totalHoldings": "147",
10
"totalMints": "341",
11
"totalRedeems": "194",
12
"totalFees": "6599999999999999000",
13
"totalSwaps": "193",
14
"createdAt": "1624265437",
15
"token": {
16
"id": "0x269616d549d7e8eaa82dfb17028d0b212d11232a",
17
"name": "CryptoPunks",
18
"symbol": "PUNK"
19
},
20
"fees": {
21
"mintFee": "50000000000000000",
22
"randomRedeemFee": "20000000000000000",
23
"targetRedeemFee": "30000000000000000",
24
"randomSwapFee": "20000000000000000",
25
"targetSwapFee": "30000000000000000"
26
},
27
"usesFactoryFees": false,
28
"asset": {
29
"id": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb",
30
"name": "CRYPTOPUNKS",
31
"symbol": "Ͼ"
32
},
33
"manager": {
34
"id": "0x0000000000000000000000000000000000000000"
35
},
36
"createdBy": {
37
"id": "0x3fce5449c7449983e263227c5aaeacb4a80b87c9"
38
},
39
"eligibilityModule": null,
40
"features": {
41
"enableMint": true,
42
"enableRandomRedeem": true,
43
"enableTargetRedeem": true,
44
"enableRandomSwap": true,
45
"enableTargetSwap": true
46
},
47
"inventoryStakingPool": {
48
"id": "0x08765c76c758da951dc73d3a8863b34752dd76fb",
49
"dividendToken": {
50
"symbol": "xPUNK"
51
}
52
},
53
"lpStakingPool": {
54
"id": "0xfb2f1c0e0086bcef24757c3b9bfe91585b1a280f",
55
"stakingToken": {
56
"id": "0x0463a06fbc8bf28b3f120cd1bfc59483f099d332"
57
}
58
},
59
"holdings": [
60
{
61
"tokenId": "197"
62
},
63
{
64
"tokenId": "402"
65
},
66
{
67
"tokenId": "441"
68
},
69
{
70
"tokenId": "548"
71
},
72
{
73
"tokenId": "669"
74
},
75
{
76
"tokenId": "675"
77
},
78
{
79
"tokenId": "680"
80
},
81
{
82
"tokenId": "743"
83
},
84
{
85
"tokenId": "1011"
86
},
87
{
88
"tokenId": "1071"
89
},
90
{
91
"tokenId": "1109"
92
},
93
{
94
"tokenId": "1194"
95
},
96
{
97
"tokenId": "1254"
98
},
99
{
100
"tokenId": "1322"
101
},
102
{
103
"tokenId": "1345"
104
},
105
{
106
"tokenId": "1350"
107
},
108
{
109
"tokenId": "1436"
110
},
111
{
112
"tokenId": "1461"
113
},
114
{
115
"tokenId": "1482"
116
},
117
{
118
"tokenId": "1628"
119
},
120
{
121
"tokenId": "1713"
122
},
123
{
124
"tokenId": "1813"
125
},
126
{
127
"tokenId": "1893"
128
},
129
{
130
"tokenId": "1927"
131
},
132
{
133
"tokenId": "1940"
134
},
135
{
136
"tokenId": "2043"
137
},
138
{
139
"tokenId": "2170"
140
},
141
{
142
"tokenId": "2197"
143
},
144
{
145
"tokenId": "2233"
146
},
147
{
148
"tokenId": "2286"
149
},
150
{
151
"tokenId": "2339"
152
},
153
{
154
"tokenId": "2398"
155
},
156
{
157
"tokenId": "2447"
158
},
159
{
160
"tokenId": "2511"
161
},
162
{
163
"tokenId": "2522"
164
},
165
{
166
"tokenId": "2557"
167
},
168
{
169
"tokenId": "2575"
170
},
171
{
172
"tokenId": "2595"
173
},
174
{
175
"tokenId": "2629"
176
},
177
{
178
"tokenId": "2733"
179
},
180
{
181
"tokenId": "2791"
182
},
183
{
184
"tokenId": "2808"
185
},
186
{
187
"tokenId": "2837"
188
},
189
{
190
"tokenId": "2907"
191
},
192
{
193
"tokenId": "2941"
194
},
195
{
196
"tokenId": "3050"
197
},
198
{
199
"tokenId": "3067"
200
},
201
{
202
"tokenId": "3082"
203
},
204
{
205
"tokenId": "3118"
206
},
207
{
208
"tokenId": "3143"
209
},
210
{
211
"tokenId": "3235"
212
},
213
{
214
"tokenId": "3241"
215
},
216
{
217
"tokenId": "3257"
218
},
219
{
220
"tokenId": "3453"
221
},
222
{
223
"tokenId": "3527"
224
},
225
{
226
"tokenId": "3610"
227
},
228
{
229
"tokenId": "3627"
230
},
231
{
232
"tokenId": "3789"
233
},
234
{
235
"tokenId": "4011"
236
},
237
{
238
"tokenId": "4050"
239
},
240
{
241
"tokenId": "4064"
242
},
243
{
244
"tokenId": "4091"
245
},
246
{
247
"tokenId": "4195"
248
},
249
{
250
"tokenId": "4306"
251
},
252
{
253
"tokenId": "4348"
254
},
255
{
256
"tokenId": "4357"
257
},
258
{
259
"tokenId": "4406"
260
},
261
{
262
"tokenId": "4455"
263
},
264
{
265
"tokenId": "4486"
266
},
267
{
268
"tokenId": "4493"
269
},
270
{
271
"tokenId": "4496"
272
},
273
{
274
"tokenId": "4546"
275
},
276
{
277
"tokenId": "4563"
278
},
279
{
280
"tokenId": "4643"
281
},
282
{
283
"tokenId": "4875"
284
},
285
{
286
"tokenId": "4912"
287
},
288
{
289
"tokenId": "4930"
290
},
291
{
292
"tokenId": "4933"
293
},
294
{
295
"tokenId": "4951"
296
},
297
{
298
"tokenId": "5067"
299
},
300
{
301
"tokenId": "5254"
302
},
303
{
304
"tokenId": "5354"
305
},
306
{
307
"tokenId": "5462"
308
},
309
{
310
"tokenId": "5467"
311
},
312
{
313
"tokenId": "5516"
314
},
315
{
316
"tokenId": "5703"
317
},
318
{
319
"tokenId": "5766"
320
},
321
{
322
"tokenId": "5821"
323
},
324
{
325
"tokenId": "5881"
326
},
327
{
328
"tokenId": "5945"
329
},
330
{
331
"tokenId": "5962"
332
},
333
{
334
"tokenId": "5999"
335
},
336
{
337
"tokenId": "6028"
338
},
339
{
340
"tokenId": "6193"
341
},
342
{
343
"tokenId": "6276"
344
},
345
{
346
"tokenId": "6335"
347
},
348
{
349
"tokenId": "6341"
350
},
351
{
352
"tokenId": "6434"
353
},
354
{
355
"tokenId": "6561"
356
},
357
{
358
"tokenId": "6584"
359
},
360
{
361
"tokenId": "6603"
362
},
363
{
364
"tokenId": "6646"
365
},
366
{
367
"tokenId": "6772"
368
},
369
{
370
"tokenId": "6804"
371
},
372
{
373
"tokenId": "6997"
374
},
375
{
376
"tokenId": "7032"
377
},
378
{
379
"tokenId": "7054"
380
},
381
{
382
"tokenId": "7281"
383
},
384
{
385
"tokenId": "7304"
386
},
387
{
388
"tokenId": "7486"
389
},
390
{
391
"tokenId": "7608"
392
},
393
{
394
"tokenId": "7626"
395
},
396
{
397
"tokenId": "7628"
398
},
399
{
400
"tokenId": "7754"
401
},
402
{
403
"tokenId": "7957"
404
},
405
{
406
"tokenId": "8054"
407
},
408
{
409
"tokenId": "8089"
410
},
411
{
412
"tokenId": "8150"
413
},
414
{
415
"tokenId": "8208"
416
},
417
{
418
"tokenId": "8308"
419
},
420
{
421
"tokenId": "8331"
422
},
423
{
424
"tokenId": "8409"
425
},
426
{
427
"tokenId": "8444"
428
},
429
{
430
"tokenId": "8470"
431
},
432
{
433
"tokenId": "8538"
434
},
435
{
436
"tokenId": "8542"
437
},
438
{
439
"tokenId": "8730"
440
},
441
{
442
"tokenId": "8755"
443
},
444
{
445
"tokenId": "8858"
446
},
447
{
448
"tokenId": "8885"
449
},
450
{
451
"tokenId": "8922"
452
},
453
{
454
"tokenId": "9215"
455
},
456
{
457
"tokenId": "9228"
458
},
459
{
460
"tokenId": "9243"
461
},
462
{
463
"tokenId": "9364"
464
},
465
{
466
"tokenId": "9370"
467
},
468
{
469
"tokenId": "9386"
470
},
471
{
472
"tokenId": "9442"
473
},
474
{
475
"tokenId": "9490"
476
},
477
{
478
"tokenId": "9620"
479
},
480
{
481
"tokenId": "9747"
482
},
483
{
484
"tokenId": "9815"
485
},
486
{
487
"tokenId": "9846"
488
},
489
{
490
"tokenId": "9887"
491
},
492
{
493
"tokenId": "9903"
494
},
495
{
496
"tokenId": "9924"
497
},
498
{
499
"tokenId": "9956"
500
}
501
]
502
}
503
]
504
}
505
}
Copied!

NFTX App Request

While there are a number of requests made to the subgraph to run the NFTX site the main request most integrations require is to retrieve all current vaults with the available NFTs available for purchase, and the facility to calculate the price.
This uses a combination of all the requests listed above.
Request
Response
1
{
2
globals {
3
fees {
4
mintFee
5
randomRedeemFee
6
targetRedeemFee
7
randomSwapFee
8
targetSwapFee
9
}
10
}
11
vaults(
12
first: 1000
13
where: { vaultId_gte: 0, isFinalized: true, totalHoldings_gt: 0 }
14
) {
15
vaultId
16
id
17
is1155
18
isFinalized
19
totalHoldings
20
totalMints
21
totalRedeems
22
totalFees
23
totalSwaps
24
createdAt
25
holdings(first: 1000, orderBy: tokenId, orderDirection: asc) {
26
id
27
tokenId
28
amount
29
dateAdded
30
}
31
token {
32
id
33
name
34
symbol
35
}
36
fees {
37
mintFee
38
randomRedeemFee
39
targetRedeemFee
40
randomSwapFee
41
targetSwapFee
42
}
43
usesFactoryFees
44
asset {
45
id
46
name
47
symbol
48
}
49
manager {
50
id
51
}
52
createdBy {
53
id
54
}
55
eligibilityModule {
56
id
57
eligibleIds
58
eligibleRange
59
}
60
features {
61
enableMint
62
enableRandomRedeem
63
enableTargetRedeem
64
enableRandomSwap
65
enableTargetSwap
66
}
67
inventoryStakingPool {
68
id
69
dividendToken {
70
symbol
71
}
72
}
73
lpStakingPool {
74
id
75
stakingToken {
76
id
77
}
78
}
79
}
80
}
Copied!
1
// response truncated for brevity.
2
{
3
"data": {
4
"globals": [
5
{
6
"fees": {
7
"mintFee": "100000000000000000",
8
"randomRedeemFee": "40000000000000000",
9
"targetRedeemFee": "60000000000000000",
10
"randomSwapFee": "40000000000000000",
11
"targetSwapFee": "60000000000000000"
12
}
13
}
14
],
15
"vaults": [
16
{
17
"vaultId": "297",
18
"id": "0x00c4a73f10b05228c64e971cf81ae84426a64780",
19
"is1155": false,
20
"isFinalized": true,
21
"totalHoldings": "38",
22
"totalMints": "47",
23
"totalRedeems": "9",
24
"totalFees": "2440000000000000000",
25
"totalSwaps": "0",
26
"createdAt": "1639894659",
27
"holdings": [
28
{
29
"id": "0x276c-0x00c4a73f10b05228c64e971cf81ae84426a64780",
30
"tokenId": "10092",
31
"amount": "1",
32
"dateAdded": "1646022345"
33
},
34
{
35
...37 more nfts listed here....
36
}
37
],
38
"token": {
39
"id": "0x00c4a73f10b05228c64e971cf81ae84426a64780",
40
"name": "MineablePunks",
41
"symbol": "MPUNK"
42
},
43
"fees": {
44
"mintFee": "100000000000000000",
45
"randomRedeemFee": "50000000000000000",
46
"targetRedeemFee": "100000000000000000",
47
"randomSwapFee": "50000000000000000",
48
"targetSwapFee": "100000000000000000"
49
},
50
"usesFactoryFees": true,
51
"asset": {
52
"id": "0x595a8974c1473717c4b5d456350cd594d9bda687",
53
"name": "MineablePunks",
54
"symbol": "MPUNKS"
55
},
56
"manager": {
57
"id": "0x0000000000000000000000000000000000000000"
58
},
59
"createdBy": {
60
"id": "0x33569c101562e1faf5b24581057e5cee4c8288d7"
61
},
62
"eligibilityModule": null,
63
"features": {
64
"enableMint": true,
65
"enableRandomRedeem": true,
66
"enableTargetRedeem": true,
67
"enableRandomSwap": true,
68
"enableTargetSwap": true
69
},
70
"inventoryStakingPool": {
71
"id": "0x013cf78239144abcf06bbd56d3d190c65d7f9635",
72
"dividendToken": {
73
"symbol": "xMPUNK"
74
}
75
},
76
"lpStakingPool": {
77
"id": "0xfda2d4ea96ae4c6c21b34ec4e607576163a55ec0",
78
"stakingToken": {
79
"id": "0xe7d5d6b7d3a3c70174d6b567697287a3322c4789"
80
}
81
}
82
},
83
.... more vaults.....
84
]
85
}
86
}
Copied!