Pair Details - Multiple Queries

Returns one transfer on Ethereum, where transfer receiver is 0x448d…cd2a, balance update address is 0x448d…cd2a and currency smart contract is 0xc02a…6cc2 or 0xdac1…1ec7, sorted by balance, highest first: transfer amount, currency symbol, balance update address, currency name, smart contract, sum of balance update amount, buy smart contract and 7 more fields.

By lukas · saved 14 January 2024 · Bitquery API v2

What it returns

Filters

The query

query ($lp_addresses: [String!]) {
  EVM(dataset: combined, network: eth) {
    Initaial_liquidity: Transfers(
      limit: {count: 2}
      orderBy: {ascending: Block_Time}
      where: {Transfer: {Receiver: {in: $lp_addresses}}}
    ) {
      Transfer {
        Amount
        Currency {
          Symbol
        }
      }
    }
    Current_lquidity: BalanceUpdates(
      where: {BalanceUpdate: {Address: {in: $lp_addresses}}, Currency: {SmartContract: {in: ["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "0xdac17f958d2ee523a2206206994597c13d831ec7"]}}}
      orderBy: {descendingByField: "balance"}
    ) {
      BalanceUpdate {
        Address
      }
      Currency {
        Name
        SmartContract
      }
      balance: sum(of: BalanceUpdate_Amount, selectWhere: {gt: "0"})
      BalanceUpdate {
        Address
      }
    }
    Volume: DEXTrades(
      where: {Block: {Time: {since: "2024-01-01T10:01:55.000Z"}}, Trade: {Dex: {Pair: {SmartContract: {in: $lp_addresses}}}}}
    ) {
      Trade {
        Buy {
          Currency {
            SmartContract
          }
        }
        Sell {
          Currency {
            SmartContract
          }
        }
      }
      token1_vol: sum(of: Trade_Buy_Amount)
      token2_vol: sum(of: Trade_Sell_Amount)
    }
    Token_details: DEXTrades(
      where: {Trade: {Dex: {Pair: {SmartContract: {in: $lp_addresses}}}}}
      limit: {count: 1}
    ) {
      Trade {
        token1: Buy {
          Currency {
            Symbol
          }
        }
        token2: Sell {
          Currency {
            Symbol
          }
        }
      }
    }
    Creation_Date: Transfers(
      where: {Transfer: {Currency: {SmartContract: {in: $lp_addresses}}}}
    ) {
      Transfer {
        Currency {
          SmartContract
        }
      }
      Transaction {
        Hash(minimum: Block_Number)
      }
      Block {
        Time
      }
    }
  }
}

Variables

{
  "lp_addresses": [
    "0x448d27bd311f42d48ef0ada37d01d5427f3fcd2a"
  ]
}

Similar queries