Solana NFT API
In this section we'll have a look at some examples using the Solana NFT API.
This Solana API is part of our Early Access Program (EAP), which is intended for evaluation purposes.
This program allows you to test the data and its integration into your applications before full-scale implementation. Read more here
Track Latest NFT Trades
The subscription query provided below fetches the most recent NFT trades on the Solana blockchain.
You can find the query here. In this query you will also get failed transactions. To get only successful transactions, set Transaction: {Result: {Success: true}}
subscription {
Solana {
DEXTradeByTokens(where: {Trade: {Currency: {Fungible: false}}}) {
Trade {
Dex {
ProtocolName
ProtocolFamily
}
Currency {
Symbol
}
Amount
Side {
Currency {
Symbol
}
Amount
}
}
}
}
}
Track all NFT balance updates across the Solana Ecosystem
The subscription query provided below fetches the real time nft balance updates of addressses across Solana Ecosystem. This query also gives us NFT balance of the wallets using PreBalance
and PostBalance
.
You can find the query here
subscription {
Solana {
BalanceUpdates(
where: {BalanceUpdate: {Currency: {Fungible: false}}}
) {
BalanceUpdate {
Currency {
Name
MintAddress
TokenCreator {
Address
Share
}
}
Account {
Address
}
PreBalance
PostBalance
}
}
}
}
Get Most Traded NFTs Recently
The subscription query provided fetches the most-traded NFTs in the last few hours. Since Solana information on v2 endpoint is part of the EAP, only realtime information is available, the aggregate might not be accurate beyond a few hours. You can find the query here
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "amt"}
where: {Trade: {Currency: {Fungible: false}}}
) {
amt: sum(of: Trade_Amount)
Trade {
Dex {
ProtocolName
ProtocolFamily
}
Currency {
Symbol
MintAddress
}
}
count
}
}
}