Query editor
select 'legacy_ca_eth' source, 'ethereum' blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_ca_balances_usd_mainnet group by 1,2union allselect 'legacy_ca_op' source, 'optimism' blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_ca_balances_usd_optimism group by 1,2union allselect 'legacy_ca_arb' source, 'arbitrum' blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_ca_balances_usd_arbitrum group by 1,2union allselect 'legacy_pools_eth' source, 'ethereum' blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_gearbox_v_3_pools_state_daily_mainnet group by 1,2union allselect 'legacy_pools_op' source, 'optimism' blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_gearbox_v_3_pools_state_optimism group by 1,2union allselect 'legacy_pools_arb' source, 'arbitrum' blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_gearbox_v_3_pools_state_arbitrum group by 1,2union allselect 'rmi_quota_events' source, blockchain blockchain, count(*) row_count, cast(min(block_time) as timestamp) first_observation, cast(max(block_time) as timestamp) last_observation, date_diff('day',cast(max(block_time) as date),current_date) days_behind from dune.desnakeee.result_pool_quota_keeper_quota_change_multichain group by 1,2union allselect 'rmi_ca_opens' source, blockchain blockchain, count(*) row_count, cast(min(open_time) as timestamp) first_observation, cast(max(open_time) as timestamp) last_observation, date_diff('day',cast(max(open_time) as date),current_date) days_behind from dune.desnakeee.result_all_gearbox_v_3_c_as_with_owners_multichain group by 1,2union allselect 'rmi_diesel_flows' source, blockchain blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_pools_diesel_balances_multichain group by 1,2union allselect 'rmi_ca_balances' source, blockchain blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_ca_token_balances_by_pool_multichain group by 1,2union allselect 'rmi_pool_flows' source, blockchain blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_daily_pool_inflows_multichain group by 1,2union allselect 'rmi_lp_prices' source, blockchain blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.gearbox_fi.result_gearbox_lp_token_value_multichain group by 1,2union allselect 'treasury_eth' source, 'ethereum' blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.mely3ka.result_gearbox_total_treasury_mainnet group by 1,2union allselect 'treasury_op' source, 'optimism' blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.mely3ka.result_gearbox_total_treasury_optimism group by 1,2union allselect 'treasury_arb' source, 'arbitrum' blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.mely3ka.result_gearbox_total_treasury_arbitrum group by 1,2union allselect 'legacy_user_interactions' source, chain blockchain, count(*) row_count, cast(min(day) as timestamp) first_observation, cast(max(day) as timestamp) last_observation, date_diff('day',cast(max(day) as date),current_date) days_behind from dune.desnakeee.result_gearbox_unique_user_interactions_raw group by 1,2order by source, blockchain