maybeyonasthorchain_lp_start_daily
    Updated 2021-12-18
    with current_providers as (
    select * from (
    select
    from_address as user,
    pool_name,
    -- lp_action,
    sum(
    case
    when lp_action = 'add_liquidity'
    then stake_units
    when lp_action = 'remove_liquidity'
    then -stake_units
    end
    ) as net_stake_units
    from thorchain.liquidity_actions
    -- where lp_action = 'add_liquidity'
    group by 1,2
    )
    where
    net_stake_units > 0
    and user is not null
    ),
    first_lping as (
    select
    from_address as user,
    pool_name,
    min(block_timestamp) as first_lp
    from thorchain.liquidity_actions
    where lp_action = 'add_liquidity'
    group by 1,2
    ),
    first_of_current as (
    select
    c.user,
    c.pool_name,
    first_lp
    Run a query to Download Data