How to get following details for a given pool

Initial liquidity,

Total liquidity,

Amount of the pool,

Pool Variation,

Pool Remaining,

1 Like

Please check this query pool details

{
  EVM(dataset: combined, network: eth) {
    Initaial_liquidity: Transfers(
      limit: {count: 2}
      orderBy: {ascending: Block_Time}
      where: {Transfer: {Receiver: {is: "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852"}}}
    ) {
      Transaction {
        Hash
      }
      Block {
        listing_time: Time
      }
      Transfer {
        Amount
        Currency {
          SmartContract
          Name
          Symbol
        }
      }
    }
    Current_lquidity: BalanceUpdates(
      where: {BalanceUpdate: {Address: {is: "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852"}}, Currency: {SmartContract: {in: ["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "0xdac17f958d2ee523a2206206994597c13d831ec7"]}}}
      orderBy: {descendingByField: "balance"}
    ) {
      Currency {
        Name
        SmartContract
      }
      balance: sum(of: BalanceUpdate_Amount, selectWhere: {gt: "0"})
      BalanceUpdate {
        Address
      }
    }
    volume: DEXTrades(
      where: {Block: {Time: {since: "2023-12-28T10:01:55.000Z"}}, Trade: {Dex: {Pair: {SmartContract: {is: "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852"}}}}}
    ) {
      token1_vol: sum(of: Trade_Buy_Amount)
      token2_vol: sum(of: Trade_Sell_Amount)
    }
  }
}

To get Pool variance, you need USD Amount, so for that, we are using v1 as we will need to wait for USD support in v2.

There is buy amount in USD and sell amount in USD and using that pool variance can be calculated

{
  ethereum {
    dexTrades(
      options: {limit: 1, desc: "block.timestamp.time"}
      smartContractAddress: {is: "0x0d4a11d5eeaac28ec3f61d100daf4d40471f1852"}
    ) {
      block {
        timestamp {
          time
        }
      }
      buyAmount(in: USD)
      buyCurrency {
        address
        symbol
      }
      sellAmount(in: USD)
      sellCurrency {
        address
        symbol
      }
    }
  }
}
1 Like