0xaiman2023-05-22 10:56 AM
    Updated 2023-05-22
    --deposit
    with
    arb as (
    with
    a as (
    select
    tx_hash
    from
    arbitrum.core.fact_event_logs
    where -- tx_hash='0x4dcf1ce24a0ddef9cfa3ab5434de5af9e2e9ac8b10fb5bc34003ab918eb39037' and
    contract_address = '0xbe54bafc56b468d4d20d609f0cf17ffc56b99913'
    ),
    c as (
    select
    b.tx_hash
    from
    arbitrum.core.fact_event_logs b
    inner join a on a.tx_hash = b.tx_hash
    where --tx_hash='0x4dcf1ce24a0ddef9cfa3ab5434de5af9e2e9ac8b10fb5bc34003ab918eb39037' and
    contract_address = '0xe432150cce91c13a887f7d836923d5597add8e31'
    ),
    d as (
    select
    ft.block_timestamp as t,
    ft.tx_hash,
    ft.from_address,
    eth_value
    from
    arbitrum.core.fact_transactions ft
    inner join c on c.tx_hash = ft.tx_hash
    )
    select
    date(t) as d1, case when t is not null then 'Arbitrum',
    sum(eth_value) as eth_volumea
    from
    d
    Run a query to Download Data