freemartianSwaps After Minting frETH
    Updated 2023-04-13
    with mint_fr as (
    select
    distinct origin_from_address as ETH_Lockers, block_timestamp
    from ethereum.core.fact_event_logs
    where origin_to_address = '0xa4b41efc1b6f73355c90119aeefddb1ffcf907b0'
    and contract_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    and event_name = 'Transfer'
    group by 1, 2),

    next_transactions as (
    select from_address, tx_hash, row_number() over (partition by from_address order by ft.block_timestamp) as rank
    from ethereum.core.fact_transactions ft
    inner join mint_fr m on m.ETH_Lockers = ft.from_address
    where from_address in (select ETH_Lockers from mint_fr)
    and ft.block_timestamp > m.block_timestamp
    qualify rank < 4)

    select sum(amount_in_usd + amount_out_usd) as volume_usd, platform, pool_name from ethereum.core.ez_dex_swaps
    where tx_hash in (select tx_hash from next_transactions)
    group by 2, 3
    Run a query to Download Data