Trade_Virtu

This is token trade query for PnL and ROI Input: - wallet: required - token: optional

By bitquery1 · saved 19 March 2024 · run 7 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($account: String!, $token: String!, $network: evm_network!, $since: DateTime!, $till: DateTime!) {
  EVM(dataset: combined, network: $network) {
    sellside: DEXTrades(
      where: {Transaction: {From: {is: $account}}, Trade: {Sell: {Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}}, Success: true, Buy: {Currency: {SmartContract: {is: $token}}}}, Block: {Time: {since: $since, till: $till}}}
      orderBy: {descending: Block_Time}
    ) {
      Block {
        Time
      }
      Fee {
        SenderFee
      }
      Trade {
        Buy {
          Amount
          Currency {
            Symbol
            SmartContract
          }
          Price
        }
        Sell {
          Amount
          Currency {
            Symbol
            SmartContract
          }
          Price
        }
        Dex {
          ProtocolName
        }
      }
      Transaction {
        Hash
      }
    }
    buyside: DEXTrades(
      where: {Transaction: {From: {is: $account}}, Trade: {Buy: {Currency: {SmartContract: {is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}}}, Success: true, Sell: {Currency: {SmartContract: {is: $token}}}}, Block: {Time: {since: $since, till: $till}}}
      orderBy: {descending: Block_Time}
    ) {
      Block {
        Time
      }
      Fee {
        SenderFee
      }
      Trade {
        Buy {
          Amount
          Currency {
            Symbol
            SmartContract
          }
          Price
        }
        Sell {
          Amount
          Currency {
            Symbol
            SmartContract
          }
          Price
        }
        Dex {
          ProtocolName
        }
      }
      Transaction {
        Hash
      }
    }
  }
}

Variables

{
  "token": "0x102dc1840f0c3c179670f21fa63597e82df34e60",
  "account": "0x3eb81b24f5c89fe0119998bb8772413d32fec77c",
  "network": "eth",
  "since": "2024-02-18T11:13:19Z",
  "till": "2024-03-19T21:43:19Z"
}

Similar queries