Query editor
WITHBonding_curve_buy as (SELECT-- emit Bought(tokenAddress, amountIn, amount0Out, price);date(block_time) as trade_date,varbinary_to_uint256 (varbinary_substring (data, 1, 32)) / 1000000000000000000 as trade_amount,dataFROMbase.logsWHEREcontract_address = 0x9e5795fE35a3F5C25Ff3dAe5dde036829113c431AND topic0 = 0xedba86fd2b22962d534e70ad9b0ff8730de46f636146f2bab6a72cbb1ebbcc53UNIONSELECT-- emit Bought(address indexed token, uint256 amountIn, uint256 amountOut, uint256 price, address indexed buyer, address indexed to, address feeToken, uint256 txFee);date(block_time) as trade_date,varbinary_to_uint256 (varbinary_substring (data, 1, 32)) / 1000000000000000000 as trade_amount,dataFROMbase.logsWHEREcontract_address = 0x9e5795fE35a3F5C25Ff3dAe5dde036829113c431AND topic0 = 0xa2a19599dca3b78c9715cdeee67e05fe989477551b1a5dd9282427c0e349a3c8),Bonding_curve_sell as (SELECT--event Sold(address indexed token, uint256 amountIn, uint256 amountOut, uint256 price);date(block_time) as trade_date,varbinary_to_uint256 (varbinary_substring (data, 1 + 32, 32)) / 1000000000000000000 as trade_amount,dataFROMbase.logsWHEREcontract_address = 0x9e5795fE35a3F5C25Ff3dAe5dde036829113c431AND topic0 = 0xe029f26dbcf8c42dd2f352c10214a7fc26773dc62482c6241334a0402ac09a80UNIONSELECT--event Sold(address indexed token, uint256 amountIn, uint256 amountOut, uint256 price, address indexed seller, address indexed to, address feeToken, uint256 txFee);date(block_time) as trade_date,varbinary_to_uint256 (varbinary_substring (data, 1 + 32, 32)) / 1000000000000000000 as trade_amount,dataFROMbase.logsWHEREcontract_address = 0x9e5795fE35a3F5C25Ff3dAe5dde036829113c431AND topic0 = 0x054d6a19a77df90fc67a9117a75860d6d25029ad6eb3f3890cf0c96b24675fbf),Total_trade_amount as (select*fromBonding_curve_buyUNIONselect*fromBonding_curve_sell