binhachonBehold The White Whale - Avg time by amount
    Updated 2022-05-09
    with withdraw_unbonded as (
    select
    block_timestamp as withdraw_time,
    recipient,
    amount as withdraw_amount
    from terra.transfer_events
    where initial_action = 'withdraw_unbonded'
    and sender = 'terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts'
    and currency = 'LUNA'
    ),
    unbonded_transactions as (
    select
    block_timestamp as start_time,
    tx_id,
    sender,
    amount as unbonded_amount
    from terra.transfer_events
    where initial_action = 'send'
    and recipient = 'terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts'
    and currency in ('bLUNA', 'terra1yg3j2s986nyp5z7r2lvt0hx3r0lnd7kwvwwtsc')
    ),
    final_table as (
    select
    start_time,
    tx_id,
    withdraw_time,
    sender,
    unbonded_amount,
    withdraw_amount
    from unbonded_transactions
    inner join withdraw_unbonded on (withdraw_time >= start_time + interval'21 days' and abs(withdraw_amount - unbonded_amount)/unbonded_amount <= 0.05 and sender = recipient)
    ),
    remove_duplicate as (
    select
    *,
    floor(withdraw_amount, -2) as rounded_amount
    Run a query to Download Data