Query editor
-- select * from dex_solana.trades where trader_id = '5Kbqncyvwfe7M1P6TFmMP2kgM88MrkeEpvKTDKC3PJ6e'-- select * from dex_solana.trades where tx_id = '4KSCRYsJd7174P1X8pRM3jAyyTpWJK3mEH2Ugq1jEkvtLTiso2EmHnYcFT2fEoYnYQAJnnEKpfcXBFsKP5BtGsYw'-- Complete Trader Analysis-- Shows all trading activity for: GuDmRMFdyp8SBxP6E72Lau9vXaUtZLqbGxLep3j7Xe2VWITH trader_transactions AS (-- Get all transaction IDs where this trader was involvedSELECT DISTINCT tx_idFROM dex_solana.tradesWHERE trader_id = 'xxxxxxxxxxx'),all_trades_from_transactions AS (-- Get ALL trades from those transactions (not just where trader_id matches)SELECTtrader_id,tx_id,outer_instruction_index,inner_instruction_index,block_time,trade_source,token_bought_symbol,token_sold_symbol,token_pair,token_bought_mint_address,token_sold_mint_address,token_bought_amount_raw,token_sold_amount_raw,amount_usd,-- Mark if this is our target traderCASEWHEN trader_id = 'GuDmRMFdyp8SBxP6E72Lau9vXaUtZLqbGxLep3j7Xe2V' THEN 'YES'ELSE 'NO'END as is_target_trader,-- Mark if this involves our target tokenCASEWHEN token_bought_mint_address = 'DFfPq2hHbJeunp1F6eNyuyvBHcPpnTqaawn2tAFUpump'OR token_sold_mint_address = 'DFfPq2hHbJeunp1F6eNyuyvBHcPpnTqaawn2tAFUpump' THEN 'YES'ELSE 'NO'END as involves_target_token,-- Determine trade type for target tokenCASEWHEN token_bought_mint_address = 'DFfPq2hHbJeunp1F6eNyuyvBHcPpnTqaawn2tAFUpump' THEN 'BUY'WHEN token_sold_mint_address = 'DFfPq2hHbJeunp1F6eNyuyvBHcPpnTqaawn2tAFUpump' THEN 'SELL'ELSE 'OTHER'END as target_token_trade_type,-- Get token amount for target tokenCASEWHEN token_bought_mint_address = 'DFfPq2hHbJeunp1F6eNyuyvBHcPpnTqaawn2tAFUpump' THEN token_bought_amount_rawWHEN token_sold_mint_address = 'DFfPq2hHbJeunp1F6eNyuyvBHcPpnTqaawn2tAFUpump' THEN token_sold_amount_rawELSE NULLEND as target_token_amountFROM dex_solana.tradesWHERE tx_id IN (SELECT tx_id FROM trader_transactions))-- Show complete analysis