MostafaPrograms Paid Most Fees for Failed Transactions on Past Month
    Updated 2022-07-13
    select
    instructions[0]:programId as program_ID,
    case
    when program_ID = 'DtmE9D2CSB4L5D6A15mraeEjrGMm6auWVzgaD8hK2tZM' then 'Switchboard Oracle'
    when program_ID = 'FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH' then 'Pyth Oracle'
    when program_ID = 'GDDMwNyyx8uB6zrqwBFHjLLG3TBYk2F8Az4yrQC5RzMp' then 'SequenceEnforcer'
    when program_id ='9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin' then 'Serum Dex v3'
    when program_ID = 'mv3ekLzLbnVPNxjSKvqBpU3ZeZXPQdEC3bp5MDEBG68' then 'Mango Markets'
    when program_ID = 'cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ' then 'Chainlink Data Feeds Store Program'
    when program_ID = 'JUP2jxvXaqu7NQY1GmNF4m1vodw12LVXYxbFL2uJvfo' then 'Jupiter Aggregator v2'
    when program_ID = 'Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo' then 'Memo Program'
    when program_ID = 'ComputeBudget111111111111111111111111111111' then 'Compute Budget Program'
    when program_ID = 'SW1TCH7qEPTdLsDHRgPuMQjbQxKdH2aBStViMFnt64f' then 'SwitchBoardV2'
    else program_ID end as programs,
    sum(fee/1e9) as Paid_Fee
    from solana.core.fact_transactions
    where block_timestamp::Date >= CURRENT_DATE-INTERVAL '1 MONTH'
    and SUCCEEDED ='FALSE'
    group by 1,2
    order by 3 desc
    limit 10
    Run a query to Download Data