mariyaInteraction with DeFi protocol
    Updated 2022-04-18
    WITH wallets as (
    SELECT
    DISTINCT instruction:parsed:info:stakeAuthority::string as staker
    from solana.events
    where
    succeeded='TRUE'
    and
    (instruction:programId='Stake11111111111111111111111111111111111111'
    or event_type='delegate'
    or event_type='deactivate')
    ),
    platform_wallet as (
    select lb.label as platform,
    tx_id,
    date(block_timestamp) as date
    from solana.events ev
    join solana.labels lb on lb.address = ev.instruction:programId
    where (
    inner_instruction:instructions[0]:parsed:info:authority in (SELECT * from wallets)
    or inner_instruction:instructions[1]:parsed:info:authority in (SELECT * from wallets)
    )
    and date(block_timestamp) BETWEEN '2022-03-01'
    and CURRENT_DATE - 2
    )

    SELECT date, platform, COUNT(DISTINCT tx_id) as tx_count
    from platform_wallet
    GROUP by date, platform
    Run a query to Download Data