Query editor
WITH buy_txs AS (SELECTblock_time,value / 1e18 AS eth_value,hashFROM ethereum.transactionsWHERE "to" = 0x06a645079cd4f3bb38ffad47f92180b8041145e3AND substr("data",1,10) = 0xaa6efae6AND success = true),daily AS (SELECTdate_trunc('day', block_time) AS day,SUM(eth_value) AS eth_inflow,COUNT(*) AS buy_countFROM buy_txsGROUP BY 1),cum AS (SELECTday,eth_inflow,buy_count,SUM(eth_inflow) OVER (ORDER BY day) AS cumulative_ethFROM daily)SELECT*,cumulative_eth / 2300.0 AS progress_ratio,(2300 - cumulative_eth)/ NULLIF(AVG(eth_inflow)OVER (ORDER BY dayROWS BETWEEN 2 PRECEDING AND CURRENT ROW),0) AS estimated_days_leftFROM cumORDER BY day