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 block_date >= current_date - interval '7' dayand block_date != current_dateand tx_to = 'xtoken.rhealab.near'and execution_status like 'SUCCESS%'and action_function_call_call_method_name = 'callback_post_unstake')selectcasewhen amount < 1 then '< 1 $RHEA'when amount >= 1 and amount < 10 then '1 - 10 $RHEA'when amount >= 10 and amount < 100 then '10 - 100 $RHEA'when amount >= 100 and amount < 1000 then '100 - 1000 $RHEA'else '>= 1000 $RHEA'end as amount_range,count(distinct tx_hash) as tx_count,count(distinct user) as unique_users,sum(amount) as total_amountfrommainwhereevent_name = 'Stake'group by 1order by 1