binhachon48. DOGE-RUNE LP-ers - Withdrew liquidity or not?
    Updated 2022-01-29
    -- Find list of addresses that added liquidity to doge pool
    with address_list as (
    select
    distinct from_address as liquidity_provider
    from thorchain.liquidity_actions
    where pool_name = 'DOGE.DOGE'
    and lp_action = 'add_liquidity'
    ),
    -- Find the timestamp of the first transactions, since we only need to find whether these addresses have any transaction before 15th Jan, return only the address will be sufficient in this case.
    -- There is no need to find the first date
    first_transactions as (
    select
    distinct from_address
    from thorchain.swaps
    where from_address in (select liquidity_provider from address_list)
    and block_timestamp < '2022-01-15 00:00:00'
    union -- UNION combines with duplicate elimination.
    select
    distinct to_address
    from thorchain.swaps
    where to_address in (select liquidity_provider from address_list)
    and block_timestamp < '2022-01-15 00:00:00'
    union
    select
    distinct from_address
    from thorchain.transfers
    where from_address in (select liquidity_provider from address_list)
    and block_timestamp < '2022-01-15 00:00:00'

    union

    select
    Run a query to Download Data