TrendingTokens

Returns 30 DEX trades by token on Solana, where DEX protocol family is not pump and block time after 2024-11-13, sorted by total trades, highest first: currency symbol, currency name, trade price, count and sum of trade side amount in USD.

By Abebe · saved 13 November 2024 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query TrendingTokens($since: DateTime, $usdcAddress: String!, $usdtAddress: String!, $wsolAddress: String!, $minVolume: String, $minTrades: String) {
  Solana {
    DEXTradeByTokens(
      limit: {count: 30}
      orderBy: {descendingByField: "total_trades"}
      where: {Transaction: {Result: {Success: true}}, Block: {Time: {after: $since}}, Trade: {Dex: {ProtocolFamily: {not: "pump"}}}, any: [{Trade: {Currency: {MintAddress: {notIn: [$usdcAddress, $usdtAddress]}}, Side: {Currency: {MintAddress: {is: $wsolAddress}}}}}]}
    ) {
      Trade {
        Currency {
          Symbol
          Name
        }
        lastPrice: Price(maximum: Block_Time)
        startPrice: Price(minimum: Block_Time)
      }
      makers: count(distinct: Transaction_Signer)
      total_trades: count(selectWhere: {ge: $minTrades})
      total_traded_volume: sum(
        of: Trade_Side_AmountInUSD
        selectWhere: {ge: $minVolume}
      )
      total_buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      total_sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      total_buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
      total_sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
    }
  }
}

Variables

{
  "usdcAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
  "usdtAddress": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
	"wsolAddress": "So11111111111111111111111111111111111111112",
  "since":"2024-11-13T06:48:00Z",
  "minVolume": "100000",
  "minTrades": "1000"
}

Similar queries