maybeyonasop_distinct_wallets_daily
    Updated 2022-06-16
    with
    op_data as (
    select
    block_timestamp,
    tx_hash,
    from_address,
    to_address,
    origin_function_signature,
    case when to_address='0x99c9fc46f92e8a1c0dec1b1747d010903e884be1' then 'main bridge' else 'warp bridge' end as bridge,
    case
    when to_address='0x99c9fc46f92e8a1c0dec1b1747d010903e884be1' and origin_function_signature = '0xb1a1a882' then 'eth deposit'
    when to_address='0x99c9fc46f92e8a1c0dec1b1747d010903e884be1' and origin_function_signature = '0x9a2ac6d5' then 'eth deposit'
    when to_address = '0x52ec2f3d7c5977a8e558c8d9c6000b615098e8fc' then 'eth deposit'
    else 'erc20 deposit' end as action
    from ethereum.core.fact_transactions
    where to_address = '0x99c9fc46f92e8a1c0dec1b1747d010903e884be1' -- main bridge
    or to_address = '0x52ec2f3d7c5977a8e558c8d9c6000b615098e8fc' -- warp bridge
    )

    select
    date(block_timestamp) as date,
    bridge,
    action,
    count(tx_hash) as txs,
    count(distinct from_address) as users
    from op_data
    where block_timestamp > current_date - interval '60 days'
    group by 1,2,3
    Run a query to Download Data