Query editor
/* WETHAddress: 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 *//* BotDeployerAddress: 0xf414d478934c29d9a80244a3626c681a71e53bb2 *//* BotDeployerFirstTransactionBlockNumber: 17345515 *//* BotDeployerFirstTransactionTimestamp: '2023-05-26 00:00:00.000 UTC' */WITHtx AS (select distinct from_hex(tx_hash) fromdune.bonkbot.result_dex_trading_bot_tradeswhere bot ='Banana Gun' and blockchain='ethereum'), base_fee as (select "number" as block_number,base_fee_per_gas as base_fee,minerfrom ethereum.blockswhere 1=1and "date" >= CAST('2023-05-26 00:00:00.000 UTC' AS TIMESTAMP)-- and "date" < date('2024-04-01')), gas_fee as (selectblock_time,t.hash as tx_hash,((gas_used / 1e18) * priority_fee_per_gas) as priority_fees -- (gas_price - base_fee)from ethereum.transactions twhere hash in (select * from tx)and block_date >= CAST('2023-05-26 00:00:00.000 UTC' AS TIMESTAMP)-- and block_date < date('2024-04-01')-- and block_date >= date('2023-01-01')), coinbase as (selectt.tx_hash,(value/1e18) as cb_transferfrom ethereum.traces tjoin ethereum.blocks b on t.block_number = b.numberjoin gas_fee on gas_fee.tx_hash = t.tx_hashwhere1=1 and success = trueand to = b.minerand block_date >= CAST('2023-05-26 00:00:00.000 UTC' AS TIMESTAMP)-- -- and block_date < date('2024-04-01')and "date" >= CAST('2023-05-26 00:00:00.000 UTC' AS TIMESTAMP)-- -- and "date" < date('2024-04-01')-- and block_date < date('2024-04-01')-- and block_date >= date('2023-01-01')-- and "date" < date('2024-04-01')-- and "date" >= date('2023-01-01')), price as (select minute, AVG(price) as ethpricefrom prices.usdwhere blockchain='ethereum'and symbol = 'WETH'and date(minute) >= date('2023-05-26')group by 1)