Converting arguments as token symbols / names

Example shows how you can convert values of call / event arguments to token symbols if nessesary

By Aleksey · saved 26 February 2021 · run 2 times · Bitquery API v1

What it returns

Filters

The query

query {
  ethereum(network: ethereum) {
    arguments(
      smartContractAddress: {is: "0xc0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac"}
      smartContractEvent: {is: "PairCreated"}
    	options: {limit: 10}
    ) {
      transaction {
        hash
      }
      callDepth
      
    
      token0_address: any(argument: {is: "token0"} of: argument_value)
      token0_symbol: any(argument: {is: "token0"} of: argument_value as: token_symbol)
      token0_name: any(argument: {is: "token0"} of: argument_value as: token_name)
      
      token1_address: any(argument: {is: "token1"} of: argument_value)
      token1_symbol: any(argument: {is: "token1"} of: argument_value as: token_symbol)
      token1_name: any(argument: {is: "token1"} of: argument_value as: token_name)
     
      pair_address: any(argument: {is: "pair"} of: argument_value)
      pair_symbol: any(argument: {is: "pair"} of: argument_value as: token_symbol)
      pair_name: any(argument: {is: "pair"} of: argument_value as: token_name)
      
    }
  }
}

Variables

{
  "from": "2021-01-25T14:00:00.000Z",
  "to": "2021-01-25T15:00:00.000Z",
  "interval": 1440,
  "baseAddresses": [
    "0xd533a949740bb3306d119cc777fa900ba034cd52",
    "ETH",
    "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "0x6b175474e89094c44da98b954eedeac495271d0f"
  ],
  "quoteAddresses": [
    "0x6b175474e89094c44da98b954eedeac495271d0f",
    "ETH",
    "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
    "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
    "0xdac17f958d2ee523a2206206994597c13d831ec7"
  ]
}

Similar queries