query-with-timeout

Returns DEX trades and instructions on Solana, where program method is buy or sell, program name is pump and block slot is at least 334749660, sorted by block slot: external seq number, call path, internal seq number, instruction index, method, program name, buy amount and 34 more fields.

By Tomas Krason · saved 20 April 2025 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query SolanaStreamQuery($blockSlotMin: String!, $blockSlotMax: String!) {
    Solana {
        DEXTrades(
            where: {Instruction: {Program: {Method: {in: ["buy", "sell"]}, Name: {is: "pump"}}}, Transaction: {Result: {Success: true}}, Block: {Slot: {ge: $blockSlotMin, le: $blockSlotMax}}}
            orderBy: {ascending: Block_Slot}
        ) {
            Instruction {
                ExternalSeqNumber
                CallPath
                InternalSeqNumber
                Index
                Program {
                    Method
                    Name
                }
            }
            Trade {
                Buy {
                    Amount
                    Account {
                        Address
                        Owner
                    }
                    Currency {
                        Name
                        Symbol
                        MintAddress
                        Decimals
                        Fungible
                        Uri
                    }
                    PriceInUSD
                }
                Sell {
                    Amount
                    Account {
                        Owner
                    }
                    Currency {
                        Name
                        Symbol
                        MintAddress
                        Decimals
                        Fungible
                        Uri
                    }
                    PriceInUSD
                }
            }
            Transaction {
                Signature
                Index
            }
            Block {
                Slot
            }
        }
        Instructions(
            where: {
                Block: { Slot: { ge: $blockSlotMin, le: $blockSlotMax } }
                any: [
                    {
                        Instruction: {
                            Program: { Method: { is: "create" }, Name: { is: "pump" } }
                        }
                        Transaction: { Result: { Success: true } }
                    }
                    {
                        Instruction: {
                            Program: {
                                Method: { is: "create_pool" }
                                Name: { is: "pump_amm" }
                                Address: { is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" }
                            }
                            Accounts: {
                                includes: {
                                    Address: { endsWith: "pump" }
                                }
                            }
                        }
                        Transaction: { Result: { Success: true } }
                    }
                ]
            }
            orderBy: { ascending: Block_Slot }
        ) {
            Block {
                Slot
            }
            Instruction {
                Accounts {
                    Address
                    Token {
                        Mint
                        Owner
                        ProgramId
                    }
                }
                Program {
                    Arguments {
                        Name
                        Value {
                            ... on Solana_ABI_Json_Value_Arg {
                                json
                            }
                            ... on Solana_ABI_Float_Value_Arg {
                                float
                            }
                            ... on Solana_ABI_Boolean_Value_Arg {
                                bool
                            }
                            ... on Solana_ABI_Bytes_Value_Arg {
                                hex
                            }
                            ... on Solana_ABI_BigInt_Value_Arg {
                                bigInteger
                            }
                            ... on Solana_ABI_Address_Value_Arg {
                                address
                            }
                            ... on Solana_ABI_String_Value_Arg {
                                string
                            }
                            ... on Solana_ABI_Integer_Value_Arg {
                                integer
                            }
                        }
                    }
                    Method
                    Name
                }
            }
            Transaction {
                Signature
            }
        }
    }
}

Variables

{
  "blockSlotMin": "334749660",
  "blockSlotMax": "334750660"
}

Similar queries