Query editor
--Error: Query is too long for wand tools.--Try shortening query to try again./* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. *//* Error: Query is too long for wand tools. *//* Try shortening query to try again. */SELECTt.*,AVG(profit_usd / TRY_CAST(cost_usd AS DOUBLE)) OVER (ORDER BY time rows BETWEEN 24 preceding AND CURRENT ROW) AS profit_margin_smooth_24,AVG(profit_usd / TRY_CAST(cost_usd AS DOUBLE)) OVER (ORDER BY time rows BETWEEN 72 preceding AND CURRENT ROW) AS profit_margin_smooth_72,AVG(profit_usd / TRY_CAST((cost_usd * 0.1) AS DOUBLE)) OVER (ORDER BY time rows BETWEEN 24 preceding AND CURRENT ROW) AS profit_margin_L2_smooth_24,AVG(profit_usd / TRY_CAST((cost_usd * 0.1) AS DOUBLE)) OVER (ORDER BY time rows BETWEEN 72 preceding AND CURRENT ROW) AS profit_margin_L2_smooth_72,SUM(profit_usd) OVER (ORDER BY time) AS culm_profit,SUM(cost_usd) OVER (ORDER BY time) AS culm_cost,SUM(revenue_usd) OVER (ORDER BY time) AS culm_revenueFROM (SELECT DISTINCTadd."call_block_time" AS time,tx_add."from",tx_add."to",add.call_block_number AS block_number,add."call_tx_hash" AS add_hash,remove."call_tx_hash" AS remove_hash,add_liq."amount0" AS add_amount0,add_liq."amount1" AS add_amount1,add_liq."amount0" / TRY_CAST(POWER(10, p0.decimals) AS DOUBLE) * p0.median_price AS add_amount0_usd,add_liq."amount1" / TRY_CAST(POWER(10, p1.decimals) AS DOUBLE) * p1.median_price AS add_amount1_usd,token0."contract_address" AS token0_address,