Query editor
/* WSOLAddress: 'So11111111111111111111111111111111111111112' *//* BonkBot FeeWallet: 'ZG98FUCjb8mJ824Gbs6RsgVmr1FhXb2oNiJHa2dwmPd' *//* BonkBot ReferralWallet: '84DGj4Qpypcaa5uxdzphYzkutEUTvxLWSuWq3BoJLxkp' *//* Maestro Bot: 'MaestroUL88UBnZr3wfoN7hqmNWFi3ZYCGqZoJJHE36' *//* Bullx Bot: '9RYJ3qr5eU5xAooqVcbmdeusjcViL5Nkiq7Gske3tiKq', 'F4hJ3Ee3c5UuaorKAMfELBjYCjiiLH75haZTKqTywRP3' *//* Banana Gun Bot: '47hEzz83VFR23rLTEeVm9A7eFzjJwjvdupPPmX3cePqF' *//* Trojan Bot: '9yMwSPk9mrXSN7yDHUuZurAh1sjbJsfpUqjZ7SvVtdco' *//* SolTrading Bot: 'HEPL5rTb6n1Ax6jt9z2XMPFJcDe9bSWvWQpsK7AMcbZg' *//* Unibot: '8FEE2ghpWPoxsypBLW87yyqmChjUbcZz41V7bzfiJqGF' *//* FirstTradeTimestamp: TIMESTAMP '2023-08-17' */WITHbotTradesWithFees AS (SELECTblock_time,block_date,amount_usd,fee_usd,--type,project_contract_address,user AS userAddress,tx_idFROMbonkbot_solana.bot_tradesWHEREis_last_trade_in_transaction = true -- This prevents over counting for multi-hop trades and excludes tax distributions),bonkReferralPayments AS (SELECTcall_block_time AS block_time,amount / 1e5 AS amountBONK,account_destination AS destinationAccount,token_balance_owner AS destinationAccountOwner,call_tx_id AS tx_idFROMspl_token_solana.spl_token_call_transferCheckedLEFT JOIN solana_utils.token_accounts ON account_destination = addressWHEREaccount_mint = 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263' -- BONKAddressAND account_authority = '84DGj4Qpypcaa5uxdzphYzkutEUTvxLWSuWq3BoJLxkp'AND call_block_time >= TIMESTAMP '2023-08-17' -- FirstTradeTimestamp),fundsFromBotWallets AS (-- Check for any token transfers from all bot wallet addressesSELECTtoken_balance_owner AS recipientAddress,account_authority AS senderWallet,account_mint AS tokenMint,COUNT(*) AS transferCount,SUM(amount) AS totalAmountReceivedFROMspl_token_solana.spl_token_call_transferCheckedLEFT JOIN solana_utils.token_accounts ON account_destination = addressWHEREaccount_authority IN (-- BonkBot wallets'84DGj4Qpypcaa5uxdzphYzkutEUTvxLWSuWq3BoJLxkp','ZG98FUCjb8mJ824Gbs6RsgVmr1FhXb2oNiJHa2dwmPd',-- Maestro Bot'MaestroUL88UBnZr3wfoN7hqmNWFi3ZYCGqZoJJHE36',-- Bullx Bot