Updated 2022-08-08
    select t1.block_timestamp::date as date, sum(t2.asset_amount_usd) as Total_Revenue_From_Affiliate_Fee, avg(t2.asset_amount_usd) as Average_Affiliate_Fee_Per_transactions,
    sum (Total_Revenue_From_Affiliate_Fee) over (order by date) as Cumulative_Fee from flipside_prod_db.thorchain.liquidity_actions t1 join flipside_prod_db.thorchain.liquidity_actions t2 on t1.tx_id = t2.tx_id and t1.asset_amount_usd > t2.asset_amount_usd
    where t2.from_address ='thor1a427q3v96psuj4fnughdw8glt5r7j38lj7rkp8' and t1.asset_tx_id is not NULL and t2.tx_id not in (select tx_id from flipside_prod_db.thorchain.refund_events)
    group by 1
    order by 1
    Run a query to Download Data