AephiaRQ - Fees all scanning fleets
    Updated 2024-12-21
    WITH scanning_fleets AS (
    SELECT
    player_profile
    ,scanning_fleets as scanning_fleet

    from SOLANA.SA.SCANNING_FLEETS


    )



    /*
    scanning_fleets AS (
    SELECT
    instruction:accounts[1] as player_profile
    ,instruction:accounts[3] as scanning_fleet

    from solana.core.fact_events fe, lateral flatten(input => inner_instruction:instructions)
    WHERE program_id IN ('SAGE2HAwep459SNq61LHvjxPk4pLPEJLoMETef7f7EE')
    AND value:parsed:info:authority = 'C2478tbSLC1gfcDuCyr4pv66QQiybn77EiR1a4k7htT5'
    AND instruction:accounts[18] = 'DataJpxFgHhzwu4zYJeHCnAv21YqWtanEBphNxXBHdEY'
    AND succeeded = 'true'
    AND block_timestamp > current_date-35 AND block_timestamp < current_date

    GROUP BY 1,2
    )
    */

    ,fees AS (
    SELECT
    date_trunc('day', block_timestamp::date) as date
    ,instruction:accounts[1] as player_profile
    ,instruction:accounts[3] as scanning_fleet
    ---
    ,round(sum(ft.fee) / 1000000000,4) as sol_payed
    QueryRunArchived: QueryRun has been archived