Photon EVM API
This section will guide you through different APIs which will tell you how to get data like realtime trades, price of a token, buys, sells, sell volume, makers, top holders of a token, liquidity of a pair and many more just like how Photon shows for EVM Chains.
Get the Top Trading Pairs
The query will fetch you the Top Trading Pairs in desceneding order of the total number of trades took place in them just like how Photon shows in its UI. You can check out the video tutorial here to understand the query better.
You can find the query here
query TrendingPairs {
EVM(dataset: combined, network: eth) {
DEXTradeByTokens(
orderBy: {descendingByField: "TradeCount"}
where: {Block: {Time: {since: "2024-06-05T08:08:00Z"}}, TransactionStatus: {Success: true}}
limit: {count: 10}
limitBy: {by: Trade_Dex_Pair_SmartContract, count: 1}
) {
TradeCount: count
Trade {
Dex {
SmartContract
ProtocolName
ProtocolFamily
Pair {
SmartContract
}
}
Currency {
Symbol
SmartContract
}
Side {
Currency {
Symbol
SmartContract
}
}
}
}
}
}