binhachonUntitled Query
    Updated 2021-12-13
    -- select round(amount,-2) as rounded_amount, sum(amount) as volume, sum(amount*slippage) / volume * 100 as slippage from (
    -- select msg_value:coins[0]:amount::float/1e6 as amount, msg_value:coins[0]:denom::string as denom,
    -- msg_value:execute_msg:swap:max_spread::float as slippage
    -- from terra.msgs
    -- where msg_value:contract::string ='terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p'
    -- and msg_value:execute_msg:swap is not null
    -- and block_timestamp > getdate() - interval'90 days'
    -- )
    -- where denom = 'uluna'
    -- group by rounded_amount
    -- order by rounded_amount desc


    select *
    from terra.msgs
    where msg_value:contract::string ='terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p'
    and msg_value:execute_msg:swap is not null
    and msg_value:execute_msg:swap:max_spread is null
    and block_timestamp > getdate() - interval'90 days'
    limit 100
    Run a query to Download Data