amirozaliquidity affiliate fee per day
    Updated 2022-08-02
    with liq_affiliates as (select TX_ID,count(*) tx_count
    from flipside_prod_db.thorchain.liquidity_actions
    where 1=1 and LP_ACTION='add_liquidity' and block_timestamp::date>='2022-01-01'
    group by 1
    having count(*)>1
    ),liq as (select TX_ID,block_timestamp,FROM_ADDRESS,RUNE_AMOUNT,RUNE_AMOUNT_USD,row_number()over(partition by tx_id order by RUNE_AMOUNT_USD ) row1
    from flipside_prod_db.thorchain.liquidity_actions
    where tx_id in ( select tx_id from liq_affiliates))
    select block_timestamp::date date,sum(RUNE_AMOUNT) affiliate_RUNE_AMOUNT ,sum(RUNE_AMOUNT_USD) affiliate_RUNE_AMOUNT_USD
    from liq
    where row1=1
    group by 1
    Run a query to Download Data