Query editor
--Error: Unable to fully debug querySELECT*FROM(SELECTtx_from as address,MIN((CASEWHEN token_bought_symbol IN ('WETH', 'USDC', 'USDT', 'ETH', 'DAI')THEN token_sold_symbolWHEN token_bought_symbol IS NULLOR token_bought_symbol = ''OR LENGTH(token_bought_symbol) = 0THEN TRY_CAST(token_bought_address AS VARCHAR)ELSE token_bought_symbolEND)) AS shitcoin,project_contract_address,COUNT(DISTINCT tx_hash) AS txs,SUM(amount_usd) AS vol,SUM(CASEWHEN token_sold_symbol IN ('WETH', 'USDC', 'USDT', 'ETH', 'DAI')THEN 1ELSE 0END * amount_usd) AS cost,SUM((CASEWHEN token_bought_symbol IN ('WETH', 'USDC', 'USDT', 'ETH', 'DAI')THEN 1ELSE -1END) * amount_usd) AS profitFROM dex.tradesWHERE1 = 1AND YEAR(block_date) >= 2022AND blockchain = 'ethereum'AND amount_usd > 0AND (token_bought_amount > 0 OR token_sold_amount > 0)AND tx_from in (0x228e12b68a152da284920eb42da6b892ea8d54a7,0x85207850a88a7ae01be6a721f1e7367646a27831,0xb6d7f0ae29dddd834b535ac118d4671468efad8a,0x13b3a50f3947476eda74fe191344524e2d2d28e5,0x30615450f0de4188f9635dd3cf1f5648edf638b8)GROUP BYtx_from,project_contract_address) tmp