token-tx-history 2 - 4 wallet

Returns the latest 10 DEX trades by token on Solana, where side currency mint address is So1111…1112, side type is sell and side type is buy: block time, transaction signature, side type, side account address, currency symbol, currency mint address, decimals and 5 more fields.

By Maximiliano Malvido · saved 20 November 2024 · run 7 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery(
  $accounts: [String!]
  $limit: Int!
  $offset: Int!
  $since: DateTime!
  $till: DateTime!
) {
  Solana {
    buyside: DEXTradeByTokens(
      limit: { count: $limit, offset: $offset }
      orderBy: { descending: Block_Time }
      where: {
        Block: { Time: { since: $since, till: $till } }
        Transaction: {
            Result: { Success: true }
        }
        Trade: {
          Side: {
            Type: {is: sell}
            Account: { Owner: { in: $accounts }}
            Currency: { MintAddress: {is: "So11111111111111111111111111111111111111112"}}
          }
        }
      }
    ) {
      Block {
        Time
      }
      Transaction {
        Signature
      }
      Trade {
        Side {
          Type
          Account {
            Address
          }
        }
        Currency {
          Symbol
          MintAddress
          Decimals
          Name
        }
        Dex {
          ProtocolName
        }
        Amount
        AmountInUSD
        PriceInUSD
      }
    },
    sellside: DEXTradeByTokens(
      limit: { count: $limit, offset: $offset }
      orderBy: { descending: Block_Time }
      where: {
        Block: { Time: { since: $since, till: $till } }
        Transaction: {
            Result: { Success: true }
        }
        Trade: {
          Side: {
            Type: {is: buy}
            Account: { Owner: { in: $accounts }}
            Currency: { MintAddress: {is: "So11111111111111111111111111111111111111112"}}
          }
        }
      }
    ) {
      Block {
        Time
      }
      Transaction {
        Signature
      }
      Trade {
        Side {
          Type
          Account {
            Address
          }
        }
        Currency {
          Symbol
          MintAddress
          Decimals
          Name
        }
        Dex {
          ProtocolName
        }
        Amount
        AmountInUSD
        PriceInUSD
      }
    }
  }
}

Variables

{
  "accounts": [""],
  "limit": 10,
  "offset": 0,
  "since": "2024-10-20T11:41:42.282Z",
  "till": "2024-11-20T11:41:42.282Z"
}

Similar queries