GetTradesFromTblDEXTrades

Returns one DEX trade on Solana, where sell currency mint address is FYZzdc…pump or So1111…1112 and buy currency mint address is FYZzdc…pump or So1111…1112, sorted by block slot, highest first: slot, block time, buy account address, buy account owner, buy token owner, buy amount, buy amount in USD and 17 more fields.

By smorgun@live.ru · saved 15 January 2025 · Bitquery API v2

What it returns

Filters

The query

query GetTradesFromTblDEXTrades($token: String!) {
  Solana(dataset: realtime) {
    DEXTrades(
      where: {Trade: {Sell: {Currency: {MintAddress: {in: [$token, "So11111111111111111111111111111111111111112"]}}}, Buy: {Currency: {MintAddress: {in: [$token, "So11111111111111111111111111111111111111112"]}}}}, Transaction: {Result: {Success: true}}}
      limit: {count: 1}
      orderBy: {descending: Block_Slot}
    ) {
      Block {
        Slot
        Time
      }
      Trade {
        Buy {
          Account {
            Address
            Owner
            Token {
              Owner
            }
          }
          Amount
          AmountInUSD
          Currency {
            MintAddress
          }
          Price
          PriceInUSD
        }
        Dex {
          ProgramAddress
          ProtocolFamily
          ProtocolName
        }
        Market {
          MarketAddress
        }
        Sell {
          Account {
            Address
            Owner
            Token {
              Owner
            }
          }
          Amount
          AmountInUSD
          Currency {
            MintAddress
          }
          Price
          PriceInUSD
        }
      }
      Transaction {
        Signature
        Signer
      }
    }
  }
}

Variables

{
  "token": "FYZzdcmPXC4JSSS6iwCbZbViSPBf5TBxsugWo9supump"
}

Similar queries