select block_timestamp::date as date,
split(pool_name, '-')[0] as poolname,
lp_action,
count (distinct tx_id) as Transactions,
count (distinct from_address) as Users,
sum (coalesce (rune_amount_usd,asset_amount_usd)) as Volume,
avg (coalesce (rune_amount_usd,asset_amount_usd)) as Average_Volume,
sum (Transactions) over (partition by poolname order by date) as Cumulative_Transactions,
sum (Volume) over (partition by poolname order by date) as Cumulative_Volume
from thorchain.defi.fact_liquidity_actions
where poolname = '{{Specific_Pool}}'
--pool_name in ('AVAX.AVAX','AVAX/USDC-0XB97EF9EF8734C71904D8002F8B6BC66DD9C48A6E','AVAX.SOL-0XFE6B19286885A4F7F55ADAD09C3CD1F906D2478F','AVAX.USDT-0X9702230A8EA53601F5CD2DC00FDBC13D4DF4A8C7')
and block_timestamp >= '{{Start_Date}}' and block_timestamp <= '{{End_Date}}'
group by 1,2,3
order by 1 desc