Query editor
with registry as (select output_0 as token_addressfrom robinhood_robinhood.stockfactory_call_deploywhere call_success = true),stock_trades as (select at_timezone(block_time, 'America/New_York') as ny_time, amount_usdfrom dex.tradeswhere blockchain = 'robinhood'and (token_bought_address in (select token_address from registry)or token_sold_address in (select token_address from registry))),flagged as (selectamount_usd,(day_of_week(ny_time) <= 5and (hour(ny_time) * 60 + minute(ny_time)) between 570 and 959) as is_nyse_hoursfrom stock_trades)selectsum(case when is_nyse_hours then amount_usd else 0 end) as nyse_hours_usd,sum(case when not is_nyse_hours then amount_usd else 0 end) as off_hours_usd,round(100.0 * sum(case when not is_nyse_hours then amount_usd else 0 end)/ nullif(sum(amount_usd), 0), 1) as off_hours_share_pctfrom flagged