Average-Price-for-24-hours-of-a-token-on-OpenBook-DEX-on-Solana

Returns the latest DEX trade on Solana, where DEX protocol family is OpenBook, sell currency symbol is USDC and buy currency symbol is WSOL: average of trade buy price.

By Kshitij Mahajan · saved 3 June 2024 · run 4 times · Bitquery API v2

What it returns

Filters

The query

query PriceAverage {
  Solana {
    DEXTrades(
      limit: {count: 1}
      orderBy: {descending: Block_Time}
      where: {Trade: {Dex: {ProtocolFamily: {is: "OpenBook"}}, Sell: {Currency: {Symbol: {is: "USDC"}}}, Buy: {Currency: {Symbol: {is: "WSOL"}}}}, Block: {Time: {after: "2024-06-03T00:00:00Z", before: "2024-06-04T00:00:00Z"}}}
    ) {
      tokenPrice: average(of: Trade_Buy_Price)
    }
  }
}

Similar queries