iboo-jbj2MVBuckets_wormhole
    Updated 2022-01-12
    with sending_asset as(
    select
    block_timestamp,
    tx_id,
    msg_value : sender :: string as address,
    case when msg_value : execute_msg : initiate_transfer : asset : info : native_token : denom :: string is not null then msg_value : execute_msg : initiate_transfer : asset : info : native_token : denom :: string when msg_value : execute_msg : initiate_transfer : asset : info : token : contract_addr :: string is not null then msg_value : execute_msg : initiate_transfer : asset : info : token : contract_addr :: string end as symbol,
    msg_value : execute_msg : initiate_transfer : recipient_chain :: float as chainID,
    case when chainID = 1 then 'Solana' when chainID = 2 then 'Ethereum' when chainID = 4 then 'BSC' when chainID = 5 then 'Polygon' end as chain_name,
    msg_value : execute_msg : initiate_transfer : asset : amount :: float / 1e6 as amount,
    msg_value
    from
    terra.msgs
    where
    msg_value : contract :: string = 'terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf'
    and tx_status = 'SUCCEEDED'
    and msg_value : execute_msg : initiate_transfer : recipient_chain is not null
    )
    select
    chain_name,
    sum(amount) as amount_send,
    count(tx_id) as size_transaction,
    CASE
    when amount < 20000 then 'small'
    when amount < 900000 and amount > 20000 then 'medium'
    when amount > 900000 then 'large'
    end
    from
    sending_asset
    where
    symbol = 'uusd'
    group by
    chain_name ,amount
    order by
    amount_send desc
    Run a query to Download Data