Query editor
WITHSolana_raw_transaction as (SELECTblock_time as day,token_mint_address as token_address,CASEWHEN from_owner = check_address THEN from_ownerELSE to_ownerEND as our_address,CASEWHEN from_owner = check_address THEN to_ownerELSE from_ownerEND as Interaction_address,CASEWHEN from_owner = check_address THEN 'OUT'ELSE 'IN'END as tr_type,symbol,CASEWHEN from_owner = check_address THEN -COALESCE(amount,0)ELSE COALESCE(amount,0)END as amount,name as account_name,types as account_type,'SOLANA' as chain,tx_id as tx_hashFROM dune.cryptosymka.result_all_wallets_transactions),add_solana_price as (SELECTt.day,t.token_address,t.our_address,t.interaction_address,t.tr_type,COALESCE(t.symbol,p.p_symbol) as symbol,t.amount/POWER(10,COALESCE(dt.decimals,0)) as amount,COALESCE(p.avg_price,0) as avg_price,t.amount/POWER(10,COALESCE(dt.decimals,0)) *COALESCE(p.avg_price,0) as amount_usd,t.account_name,t.account_type,t.chain,t.tx_hashFROM Solana_raw_transaction tLEFT JOIN query_4371644 pON DATE_TRUNC('day',t.day) = p.day and t.token_address = p.token_addressLEFT JOIN tokens_solana.fungible dtON t.token_address = dt.token_mint_address)-- Add ETH, Ether_transaction as (SELECTt.tr_time as day,CAST(t.token_address AS VARCHAR) as token_address,CAST(t.our_address AS VARCHAR) as our_address,CAST(t.interaction_address AS VARCHAR) as interaction_address,t.tr_type,COALESCE(t.symbol,p.p_symbol) as symbol,t.amount,