Pmisha-bmlMdxavalanche
    Updated 2022-04-03
    with t1 as(select
    date_trunc('day',block_timestamp) as dt1,
    count (distinct sender) as unquser,
    sum(DEPOSIT_AMOUNT) as total_deposit_terra
    from anchor.deposits
    where block_timestamp>='2022-03-16'
    group by 1),

    t2 as (select
    date_trunc('day',block_timestamp) as dt2,
    sum(EVENT_ATTRIBUTES:deposit_amount/1e6) as deposit_avalanche,
    count(distinct EVENT_ATTRIBUTES:depositor::string) as no_depositor_avalan
    from terra.msg_events
    where block_timestamp>='2022-03-16'
    and event_type ='wasm'
    and event_attributes:"1_action"='deposit_stable'
    and EVENT_ATTRIBUTES:recipient='terra1pw4qm09m256m3wz25n4whnuqck7rcn6wvvjzyj'
    and TX_STATUS='SUCCEEDED' group by 1)

    select t1.dt1 as dt,
    unquser as terra_user,
    total_deposit_terra,
    deposit_avalanche,
    no_depositor_avalan as Avalanche_user
    from t1 full outer join t2 on t1.dt1=t2.dt2
    Run a query to Download Data