Query editor
with raw_data as(SELECTfunction_name,block_date,count(*) as cnt_tx_by_type,arbitrary(tx_hash) as sample_txFROM base.traces_decoded tdWHERE 1=1and trace_address = ARRAY[]and block_date > now() - interval '30' daygroup by 1,2),advanced_data as(SelectCASE WHEN cnt_tx_by_type > 3e3 then function_name else 'other' end as function_name,block_date,sum(cnt_tx_by_type) as cnt_tx_by_type,get_href(get_chain_explorer_tx_hash('base', arbitrary(sample_tx)), 'sample tx') as sample_txfrom raw_datagroup by 1,2)SelectCASE WHEN function_name in ('sellShares', 'buyShares') then 'friendtech'WHEN function_name in ( 'removeLiquidityETHWithPermit', 'removeLiquidity', 'transformERC20', 'simpleSwap', 'swapSimpleMode', 'swapExactTokensForETH', 'addLiquidity', 'addLiquidityETH', 'swapExactTokensForETHSupportingFeeOnTransferTokens', 'swapExactTokensForTokens', 'swapTokensForExactTokens', 'exactInputSingle', 'swapExactETHForTokensSupportingFeeOnTransferTokens', 'swapExactETHForTokens', 'swapETH', 'swapCompact', 'processRoute', 'swap') or function_name like ('%swap%') then 'trading'when function_name in ( 'mint', 'mintWithRewards', 'adminMint') then 'minting'when function_name like ('%bonk%') then 'frenpetonbase'else function_nameEND as function_name_cat,cast(block_date as timestamp) as block_date,sum(cnt_tx_by_type) as cnt_tx_typefrom advanced_datawhere block_date is not nulland cnt_tx_by_type is not nullgroup by 1,2order by 2 desc, 3 desc