celo price on a particular date

Returns the latest DEX trade on Ethereum and celo_mainnet, where buy currency is 0x471E…a438 and sell currency is 0x765D…282a: timestamp time, block height, trade index, protocol, full name, buy amount, buy currency symbol and 3 more fields.

By Akshat · saved 18 December 2024 · Bitquery API v1

What it returns

Filters

The query

{
  ethereum(network: celo_mainnet) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1, offset: 0}
      buyCurrency: {is: "0x471EcE3750Da237f93B8E339c536989b8978a438"}
      sellCurrency: {is: "0x765DE816845861e75A25fCA122bb6898B8B1282a"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      tradeIndex
      protocol
      exchange {
        fullName
      }
      buyAmount
      buyCurrency {
        symbol
      }
      buy_amount_usd: buyAmount(in: USD)
      sellAmount
      sellCurrency {
        symbol
      }
      sell_amount_usd: sellAmount(in: USD)
      priceInUSD: expression(get: "sell_amount_usd / buyAmount")
    }
  }
}

Similar queries