price of a token at a specific time in history

Returns one DEX trade by token on Ethereum, where currency smart contract is 0x7777…489c and block time after 2024-08-04, sorted by block number: chain ID, block number, block time, seller, buyer, trade amount, smart contract and 8 more fields.

By gaurav · saved 6 August 2024 · run 5 times · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network, $limit: Int, $token: String) {
  EVM(network: $network, dataset: combined) {
    DEXTradeByTokens(
      orderBy: {ascending: Block_Number}
      limit: {count: $limit}
      where: {Trade: {Currency: {SmartContract: {is: $token}}}, Block: {Time: {after: "2024-08-04T09:53:11Z"}}}
    ) {
      ChainId
      Block {
        Number
        Time
      }
      Trade {
        Seller
        Buyer
        Amount
        Currency {
          SmartContract
          Symbol
          Name
        }
        Price
        Side {
          Amount
          Currency {
            SmartContract
            Symbol
            Name
          }
        }
      }
      Transaction {
        Hash
      }
    }
  }
}

Variables

{
  "mempool": false,
  "network": "eth",
  "limit": 1,
  "offset": 0,
  "token": "0x7777cec341e7434126864195adef9b05dcc3489c",
  "dateFormat": "%Y-%m-%d"
}

Similar queries