mz0111Untitled Query
    Updated 2023-03-09
    select
    date_trunc('DAY',block_timestamp) as date,
    symbol,
    count(DISTINCT tx_hash) as tx_count,
    count(DISTINCT case when to_address like lower('0x1619de6b6b20ed217a58d00f37b9d47c7663feca') then origin_from_address else to_address end) as users_count,
    sum(raw_amount/power(10,decimals)) as volume
    from arbitrum.core.fact_token_transfers left outer join arbitrum.core.dim_contracts on address like contract_address
    where to_address like lower('0x1619de6b6b20ed217a58d00f37b9d47c7663feca')
    --and not tx_hash in (select tx_hash from arbitrum.core.fact_event_logs where contract_address like lower('0x126bE6a9ec71A1FeA19D2288Ba2Ce4cDC0faCB68'))
    --and symbol in ('BICO','USDC','USDT','ETH')
    group by 1,2
    union
    select
    date_trunc('DAY',block_timestamp) as date,
    'WETH' as symbol,
    count(DISTINCT tx_hash) as tx_count,
    count(DISTINCT CASE WHEN eth_to_address like lower('0x1619de6b6b20ed217a58d00f37b9d47c7663feca') then origin_from_address else eth_to_address end) as users_count,
    sum(AMOUNT_USD) as volume
    from arbitrum.core.ez_eth_transfers
    where eth_to_address like lower('0x1619de6b6b20ed217a58d00f37b9d47c7663feca')
    --and not tx_hash in (select tx_hash from optimism.core.fact_event_logs where contract_address like lower('0x126bE6a9ec71A1FeA19D2288Ba2Ce4cDC0faCB68'))
    --and symbol in ('BICO','USDC','USDT','ETH')
    group by 1,2
    Run a query to Download Data