copy trade query

Streams the latest 50 DEX trades and transfers on Solana as they happen: transaction signature, timestamp, buy amount, currency name, currency symbol, currency mint address, buy price and 8 more fields.

By Robert Dzaka · saved 24 January 2025 · Bitquery API v2

What it returns

The subscription

subscription ($walletAddress: String!) {
  solana {
    dexTrades(
      where: {
        _or: [
          { buy: { account: { is: $walletAddress } } }
          { sell: { account: { is: $walletAddress } } }
        ]
      }
      options: { desc: "block.timestamp.time", limit: 50 }
    ) {
      transaction {
        signature
        timestamp
      }
      buy {
        amount
        currency {
          name
          symbol
          mintAddress
        }
        price
      }
      sell {
        amount
        currency {
          name
          symbol
          mintAddress
        }
        price
      }
      dex {
        protocolName
        programAddress
        protocolFamily
      }
    }
    transfers(
      where: {
        _or: [
          { sender: { is: $walletAddress } }
          { receiver: { is: $walletAddress } }
        ]
      }
      options: { desc: "block.timestamp.time", limit: 50 }
    ) {
      transaction {
        signature
        timestamp
      }
      sender {
        address
      }
      receiver {
        address
      }
      amount
      currency {
        name
        symbol
        mintAddress
      }
    }
  }
}

Variables

{
  "walletAddress": "25deoSMCjd95dk6H4V6oj5mtAhxHDkDsA73xS35TcYYS"
}

Similar queries