tiloyeTokens Bought by High Fee Payers
    Updated 2023-06-13
    with top_spenders as (
    select
    from_address as address,
    sum(tx_fee) as total_fees
    from ethereum.core.fact_transactions
    where to_address = '0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b'
    and block_timestamp >= block_timestamp::date - interval '7 days'
    group by from_address
    qualify row_number() over (order by total_fees desc) <=10
    )

    select
    contract_address as token_address,
    symbol,
    count(*) as sale_count,
    sum(amount_usd) as sale_volume_usd
    from ethereum.core.ez_token_transfers
    where to_address in (select address from top_spenders)
    and origin_to_address = '0xef1c6e67703c7bd7107eed8303fbe6ec2554bf6b'
    and block_timestamp >= current_date - 7
    group by token_address, symbol
    order by sale_count desc
    limit 10
    Run a query to Download Data