Top traders with their bought, sold and total volume

Returns 5 DEX trades by token on Solana, where currency mint address is A1Xqfc…M3Vk and DEX program address is MoonCV…QTrG, sorted by volume, highest first: protocol name, protocol family, program address, currency symbol, currency name, currency mint address, account address and sum of trade side amount in USD.

By Akshat · saved 13 August 2024 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query TopTraders {
  Solana {
    DEXTradeByTokens(
      orderBy: {descendingByField: "volume"}
      limit: {count: 5}
      where: {Trade: {Currency: {MintAddress: {is: "A1XqfcD1vMEhUNwEKvBVRWFV48ZLDL4oheFVCPEcM3Vk"}}, Dex: {ProgramAddress: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}}}, Transaction: {Result: {Success: true}}}
    ) {
      Trade {
        Dex {
          ProtocolName
          ProtocolFamily
          ProgramAddress
        }
        Currency {
          Symbol
          Name
          MintAddress
        }
        Account {
          Address
        }
      }
      bought: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}})
      sold: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}})
      volume: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Similar queries