Query editor
withmain as (selecttx_hash,block_time,cast(JSON_EXTRACT_SCALAR(action_function_call_args_parsed, '$.amount') as double) / 1e18 as amount,JSON_EXTRACT_SCALAR(action_function_call_args_parsed, '$.sender_id') as user,'Stake' as event_namefromnear.actionswhereblock_date >= date('2025-07-29')and block_date >= current_date - interval '30' dayand block_date != current_dateand tx_to = 'token.rhealab.near'and execution_status like 'SUCCESS%'and action_function_call_call_method_name = 'ft_on_transfer'and JSON_EXTRACT_SCALAR(action_function_call_args_parsed, '$.msg') like '%Stake%'union allselecttx_hash,block_time,cast(JSON_EXTRACT_SCALAR(action_function_call_args_parsed, '$.unlocked_amount') as double) / 1e18 as amount,JSON_EXTRACT_SCALAR(action_function_call_args_parsed, '$.account_id') as user,'Unstake' as event_namefromnear.actionswhereblock_date >= date('2025-07-29')and tx_to = 'xtoken.rhealab.near'and execution_status like 'SUCCESS%'and action_function_call_call_method_name = 'callback_post_unstake')selectevent_name,count(distinct tx_hash) as transactions,count(distinct user) as users,sum(amount) as volume,avg(amount) as average_amountfrommainwhere event_name = 'Stake'group by 1order by 1