Query editor
withCalculationHelper as (selectupdated_time,phala_total_value,khala_total_value,(COALESCE(phala_total_value, 0) + COALESCE(khala_total_value, 0)) as total_value,ethereum_circulation,base_circulation,phala_circulation,khala_circulation,(ethereum_circulation + COALESCE(base_circulation, 0) + COALESCE(phala_circulation, 0) + COALESCE(khala_circulation, 0)) as total_circulation,phala_idle_worker_count,khala_idle_worker_count,phala_delegator_count,khala_delegator_count,phala_average_apr,khala_average_apr,phala_budget_per_share,khala_budget_per_share,phala_cumulative_rewards,khala_cumulative_rewardsfromdune.phala_network.dataset_phala_computation_snapshots)selectupdated_time,phala_total_value,khala_total_value,total_value,phala_idle_worker_count,khala_idle_worker_count,(COALESCE(phala_idle_worker_count, 0) + COALESCE(khala_idle_worker_count, 0)) as idle_worker_count,phala_delegator_count,khala_delegator_count,(COALESCE(phala_delegator_count, 0) + COALESCE(khala_delegator_count, 0)) as delegator_count,phala_average_apr,khala_average_apr,(COALESCE(phala_total_value, 0) * COALESCE(phala_average_apr, 0) + COALESCE(khala_total_value, 0) * COALESCE(khala_average_apr, 0)) / total_value as average_apr,ethereum_circulation,base_circulation,phala_circulation,khala_circulation,total_circulation,(phala_total_value / total_circulation) as phala_stake_ratio,(khala_total_value / total_circulation) as khala_stake_ratio,(total_value / total_circulation) as stake_ratio,phala_budget_per_share,khala_budget_per_share,(