maybeyonaswormhole_inflow
    Updated 2021-11-20
    with
    outflow as (
    select
    block_timestamp,
    tx_id,
    event_attributes:recipient::string as user,
    event_attributes:denom::string as token,
    event_attributes:amount::string/pow(10,6) as amount
    from terra.msg_events
    where
    tx_status = 'SUCCEEDED'
    and event_type='from_contract'
    and event_attributes:contract_address::string = 'terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf'
    and event_attributes:action = 'complete_transfer_terra_native'
    )

    select
    date(block_timestamp) as date,
    -- recipient_chain,
    token,
    count(tx_id) as txs,
    count(distinct user) as users,
    sum(amount) as tokens
    from outflow
    group by 1,2

    -- "contract_upgrade"
    -- "withdraw_tokens"
    -- "register_asset"
    -- "complete_transfer_terra_native"
    Run a query to Download Data