adriaparcerisasHave staking rewards impacted the amount of $RUNE bonded or in LPs?
    Updated 2024-07-02
    WITH
    rune_in_pools as (
    select
    trunc(block_timestamp,'month') as date,
    --distinct from_address as users,
    sum(rune_amount_usd) as rune_deposited,
    sum(rune_deposited) over (order by date) as total_rune_deposited
    from thorchain.defi.fact_liquidity_actions
    where lp_action = 'add_liquidity'
    group by 1
    ),
    rune_out_pools as (
    select
    trunc(block_timestamp,'month') as date,
    --distinct from_address as users,
    sum(rune_amount_usd) as rune_removed,
    sum(rune_removed) over (order by date) as total_rune_removed
    from thorchain.defi.fact_liquidity_actions
    where lp_action = 'remove_liquidity'
    group by 1
    ),
    final_pools as (
    SELECT
    --x.users,
    x.date,
    total_rune_deposited-total_rune_removed as current_rune_lp
    from rune_in_pools x
    left join rune_out_pools y on x.date=y.date
    --where x.users in (select users_adding from users)
    --having current_lp_rune >0

    ),
    srewards as (
    SELECT
    trunc(block_timestamp,'month') as date,
    sum(liq_fee_rune_usd+liq_fee_asset_usd) as revenues,
    QueryRunArchived: QueryRun has been archived