SunPump Tokens And Liquidity pools

Returns 100 DEX trades by token and balance updates on Tron, where balance update address is TTfvyr…7AAw and DEX protocol name is sun_pump_v1, sorted by total liquidity: smart contract, currency symbol, currency name, trade price, count, unique of trade seller, unique of trade buyer and 2 more fields.

By Srdjan Stankovic · saved 19 September 2024 · run 7 times · Bitquery API v2

What it returns

Filters

The query

query SunPumpTokensAndPools($from: DateTime, $vault: String) {
  Tron {
    DEXTradeByTokens(
      limit: {count: 200}
      orderBy: {descendingByField: "Trade_lastPrice_maximum"}
      where: {Block: {Time: {since: $from}}, Trade: {Currency: {Native: false}, Dex: {ProtocolName: {is: "sun_pump_v1"}}}, Transaction: {Result: {Success: true}}}
    ) {
      Trade {
        Dex {
          SmartContract
        }
        Currency {
          Symbol
          Name
          SmartContract
        }
        lastPrice: Price(maximum: Block_Number)
        prePrice: Price(minimum: Block_Number)
      }
      count
      sellers: uniq(of: Trade_Seller)
      buyers: uniq(of: Trade_Buyer)
      buy_usd: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}})
      sell_usd: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
    }
    DEXPools: BalanceUpdates(
      orderBy: {ascendingByField: "totalLiquidity"}
      limit: {count: 100}
      where: {BalanceUpdate: {Address: {is: $vault}}}
    ) {
      totalLiquidity: sum(of: BalanceUpdate_Amount, selectWhere: {gt: "200000000"})
      Currency {
        Name
        Symbol
        SmartContract
      }
    }
  }
}

Variables

{
  "vault": "TTfvyrAz86hbZk5iDpKD78pqLGgi8C7AAw"
}

Similar queries