dex trades

Returns the latest 50 DEX trades by token on Solana, where account owner is DTa29X…XfoP and block time after 2024-10-16: block time, transaction signature, protocol family, account owner, side type, side account address, side account owner and 11 more fields.

By Lochana Perera · saved 17 October 2024 · Bitquery API v2

What it returns

Filters

The query

query LatestTrades($trader: String!, $time_ago: DateTime) {
  Solana {
    DEXTradeByTokens(
      orderBy: {descending: Block_Time}
      limit: {count: 50}
      where: {Trade: {Account: {Owner: {is: $trader}}}, Block: {Time: {after: $time_ago}}, any: [{Trade: {Side: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}}}, {Trade: {Currency: {MintAddress: {not: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}, {Trade: {Currency: {MintAddress: {notIn: ["So11111111111111111111111111111111111111112", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]}}, Side: {Currency: {MintAddress: {notIn: ["So11111111111111111111111111111111111111112", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]}}}}}]}
    ) {
      Block {
        Time
      }
      Transaction {
        Signature
      }
      Trade {
        Dex {
          ProtocolFamily
        }
        Account {
          Owner
        }
        Side {
          Type
          Account {
            Address
            Owner
          }
        }
        AmountInUSD
        PriceInUSD
        Amount
        Side {
          Currency {
            Symbol
            MintAddress
            Name
          }
          AmountInUSD
          Amount
        }
        Currency {
          Symbol
          MintAddress
          Name
        }
      }
    }
  }
}

Variables

{
  "trader": "DTa29XgjVyxioKFHeFcFMHzx5vwDQrtKjT83cA4SXfoP",
  "time_ago": "2024-10-16T18:20:58Z"
}

Similar queries