mariyaWhat Are Whales Swapping For?
    Updated 2022-04-14
    with astroport as ( select address
    from terra.labels
    where label = 'astroport'
    ),
    lst_wallets_90 as (
    select tx_from[0] as wallet
    ,min(block_timestamp)::date as min_date
    from terra.transactions
    group by 1
    having min_date>=CURRENT_DATE-90
    )
    ,lst_tx_id as (
    select DISTINCT tx_id from terra.transactions
    where tx_from[0] in(select wallet from lst_wallets_90)
    and tx_to[0] in (select address from astroport )
    )
    select
    date(block_timestamp) as day
    ,count(DISTINCT tx_id) tx_count
    ,count(DISTINCT msg_value:sender) as address_count
    ,sum(msg_value:execute_msg:send:amount/1e6) as amount
    from terra.msgs
    where tx_status = 'SUCCEEDED'
    and msg_value:execute_msg:send:amount is not null
    and msg_value:execute_msg:send:amount/1e6>0
    and tx_id in(select tx_id from lst_tx_id)
    group by 1
    order by 1
    Run a query to Download Data