mboveiriHFT Sell
    Updated 2023-04-13
    with users as
    (select
    --block_timestamp::date as date,
    a.origin_from_address as users,
    round(a.raw_amount/1e18) as amount_claimed,
    round(b.raw_amount/1e18) as amount_transfered,
    datediff(hour, a.block_timestamp, b.block_timestamp) as sell_after,
    case
    when sell_after = 0 then 'Sell Immediately'
    when sell_after < 24 then CONCAT(sell_after, ' Hour')
    when sell_after between 24 and 167 then CONCAT(round(sell_after / 24), ' Day')
    when sell_after between 168 and 729 then CONCAT(round(sell_after / 168), ' Week')
    when sell_after >= 730 then CONCAT(round(sell_after / 730), ' Month')
    end as sell_after_,
    row_number() over (partition by users order by users) row_num
    from ethereum.core.ez_token_transfers a left join ethereum.core.ez_token_transfers b on a.origin_from_address = b.from_address and a.block_timestamp < b.block_timestamp and b.raw_amount/1e18 >= a.raw_amount/1e18
    where a.origin_to_address = lower('0x1a9a4d919943340b7e855e310489e16155f4ed29')
    and a.contract_address = lower('0xb3999f658c0391d94a37f7ff328f3fec942bcadc')
    and b.contract_address = lower('0xb3999f658c0391d94a37f7ff328f3fec942bcadc')
    and a.origin_function_signature = '0xeb4d6138'
    qualify row_num = 1
    )

    select
    count(*) as count,
    sell_after_ as sell_period
    from users
    group by sell_after_

    Run a query to Download Data