Query editor
WITH deposit_events AS (SELECTevt_block_time AS "timestamp",146 AS chain_id,evt_block_number AS block_number,evt_index AS log_index,evt_tx_hash AS transaction_hash,"user" AS user_address,"user" AS taker_address,amount,pid,'deposit' AS event_typeFROM snakefinance_sonic.gsnakerewardpoolv3_evt_depositWHERE evt_tx_to = 0xe6e0a10eb298f0ac4170f2502cf7b201375bbc85),withdraw_events AS (SELECTevt_block_time AS "timestamp",146 AS chain_id,evt_block_number AS block_number,evt_index AS log_index,evt_tx_hash AS transaction_hash,"user" AS user_address,"user" AS taker_address,amount,pid,'withdraw' AS event_typeFROM snakefinance_sonic.gsnakerewardpoolv3_evt_withdrawWHERE evt_tx_to = 0xe6e0a10eb298f0ac4170f2502cf7b201375bbc85),events AS (SELECT * FROM deposit_eventsUNION ALLSELECT * FROM withdraw_events),pairs AS (SELECT*FROM dune.pinacu.result_pairs_reserves),event_data AS (SELECTe."timestamp",e.chain_id,e.block_number,e.log_index,e.transaction_hash,e.user_address,e.taker_address,p.contract_address AS pool_address,p.token0 AS underlying_token0_address,p.token1 AS underlying_token1_address,e.amount * 1.0 / 1e18 AS amount,p.total_supply,p.reserve0,p.reserve1,p.token1_value,e.event_typeFROM events eLEFT JOIN pairs p