Query editor
withtrading_accounts as (select distinctdestination as traderfromton.messageswhereblock_date = cast('2025-01-11' as timestamp)and source = upper(ton_address_user_friendly_to_raw ('UQBIj6Uocn7p03Bm3hgGJ9PFG1GHNFNm5nktjN7IA3BoSx6C'))and trace_id = 'D5RMk67BjfciopJ82a9iuJUbo8eUfRIYwxqozvHDmaU='and direction = 'in')selectround(sum(casewhen token_bought_address = '0:0000000000000000000000000000000000000000000000000000000000000000' thenamount_bought_rawelse -1 * amount_sold_rawend) / 1e9) as total_pnl, count(1) as trades_countfromton.dex_trades tradesjoin trading_accounts a on trades.trader_address = a.traderwhereproject = 'ton.fun'and block_date >= cast('2025-01-11' as timestamp)and event_type = 'trade'limit10