Query editor
-- Cumulative net liquidity contribution on the primary CASHCAT/WETH pool.-- Adds mints, subtracts burns, cumulates over time. NOT the same as spot-- TVL (which also depends on tick range activation and swap flows) but-- exposes whether LPs are net adding or net removing.WITH mints AS (SELECTdate_trunc('day', evt_block_time) AS day,CAST(CASE WHEN {{cashcat_is_token0}} THEN amount0 ELSE amount1 END AS DECIMAL(38,0)) AS cashcat_raw,CAST(CASE WHEN {{cashcat_is_token0}} THEN amount1 ELSE amount0 END AS DECIMAL(38,0)) AS paired_rawFROM uniswap_v3_robinhood.uniswapv3pool_evt_mintWHERE contract_address = {{pool_address}}),burns AS (SELECTdate_trunc('day', evt_block_time) AS day,CAST(CASE WHEN {{cashcat_is_token0}} THEN amount0 ELSE amount1 END AS DECIMAL(38,0)) AS cashcat_raw,CAST(CASE WHEN {{cashcat_is_token0}} THEN amount1 ELSE amount0 END AS DECIMAL(38,0)) AS paired_rawFROM uniswap_v3_robinhood.uniswapv3pool_evt_burnWHERE contract_address = {{pool_address}}),daily_delta AS (SELECT day,SUM(cashcat_raw)/1e18 AS d_cashcat,SUM(paired_raw)/1e18 AS d_wethFROM mints GROUP BY dayUNION ALLSELECT day,-SUM(cashcat_raw)/1e18 AS d_cashcat,-SUM(paired_raw)/1e18 AS d_wethFROM burns GROUP BY day),daily_net AS (SELECT day,SUM(d_cashcat) AS net_cashcat,SUM(d_weth) AS net_wethFROM daily_deltaGROUP BY day)SELECTday,net_cashcat AS net_cashcat_added,net_weth AS net_weth_added,SUM(net_cashcat) OVER (ORDER BY day) AS cum_cashcat_contributed,SUM(net_weth) OVER (ORDER BY day) AS cum_weth_contributedFROM daily_netORDER BY day;