Query editor
/* WETHAddress: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 *//* BotDeployerAddress: 0x707d9F893EC2799ddEF1524DB15EBa99D67fC431 *//* BotDeployerFirstTransactionBlockNumber: 18341760 *//* BotDeployerFirstTransactionTimestamp: '2023-10-13 00:00:00.000 UTC' */WITHbotTradesWithFees AS (SELECTblock_time,blockchain,date_trunc('day', block_time) AS block_date,amount_usd,bribe_token_amount,type,project_contract_address,user AS userAddress,tx_hashFROM/* Maestro Trades */query_3128836WHEREisLastTradeInTransaction = true -- This prevents over counting for multi-hop trades and excludes tax distributions),leaderboard AS (SELECTRANK() OVER (ORDER BYSUM(amount_usd) DESC) AS userRank,blockchain,SUM(amount_usd) AS totalVolumeUSD,SUM(IF("type" = 'Buy', amount_usd, 0)) AS buyVolumeUSD,SUM(IF("type" = 'Sell', amount_usd, 0)) AS sellVolumeUSD,COUNT(DISTINCT (tx_hash)) AS numberOfTrades,COUNT(DISTINCT (project_contract_address)) AS numberOfPairs,COUNT(DISTINCT (block_date)) AS numberOfActiveDays,SUM(bribe_token_amount) AS bribesPaidETH,MIN(block_time) AS firstTradeDate,MAX(block_time) AS lastTradeDate,userAddressFROMbotTradesWithFeesWHEREblockchain in ('ethereum')GROUP BYuserAddress,blockchain)SELECTuserRank,IF(name IS NULL, CAST(userAddress AS VARCHAR), name) AS user,CONCAT('<a href="https://debank.com/profile/',CAST(userAddress AS VARCHAR),'?t=1688543440463&r=65920" target=_blank">',IF(name IS NULL, CAST(userAddress AS VARCHAR), name),'</a>') AS user_url,blockchain,totalVolumeUSD,buyVolumeUSD,