Query editor
WITH arpu AS (SELECTSUM(total_fee_usd) AS total_app_revenue,COUNT(user) AS users,COUNT(maker) AS paying_users,(SELECTCOUNT(DISTINCT DATE_TRUNC('month', block_time)) AS monthsFROM polymarket_polygon.market_trades) AS months_since_launch,SUM(total_fee_usd)/ COUNT(user)/ ( SELECTCOUNT(DISTINCT DATE_TRUNC('month', block_time)) AS monthsFROM polymarket_polygon.market_trades) AS arpu_dapp,SUM(total_fee_usd)/ ( SELECT COUNT(user) FROM query_4681579WHERE NOT maker IS NULL OR NOT creator IS NULL)/ ( SELECTCOUNT(DISTINCT DATE_TRUNC('month', block_time)) AS monthsFROM polymarket_polygon.market_trades) AS arppu_dapp,AVG(months_active) AS avg_user_lifespan,(select AVG(months_active) FROM query_4681579 where total_fee_usd > 0) as avg_paying_user_lifespanFROM query_4681579)SELECTtotal_app_revenue,users,paying_users,months_since_launch,arpu_dapp,avg_user_lifespan,arpu_dapp * avg_user_lifespan AS ltv_dapp,arppu_dapp,avg_paying_user_lifespan,arppu_dapp * avg_paying_user_lifespan AS ltv_dapp_payingFROM arpu