Query editor
WITHdeposits AS (SELECTblock_time,block_number,tx_hash,'deposit' AS event_type,topic1 AS user_address,CAST(bytearray_to_uint256(bytearray_substring(data, 1, 32)) AS double) / 1e18 AS delta_x,CAST(bytearray_to_uint256(bytearray_substring(data, 33, 32)) AS double) / 1e6 AS delta_y,bytearray_to_uint256(bytearray_substring(data, 65, 32)) AS sharesFROM monad.logsWHEREcontract_address = 0x29CA72a4df8165206012c05F773dd367BfD9CDA2AND topic0 = 0x91ede45f04a37a7c170f5c1207df3b6bc748dc1e04ad5e917a241d0f52feada3),withdrawals_executed AS (SELECTblock_time,block_number,tx_hash,'withdrawal' AS event_type,bytearray_to_uint256(topic1) AS round,-CAST(bytearray_to_uint256(bytearray_substring(data, 33, 32)) AS double) / 1e18 AS delta_x,-CAST(bytearray_to_uint256(bytearray_substring(data, 65, 32)) AS double) / 1e6 AS delta_y,bytearray_to_uint256(bytearray_substring(data, 1, 32)) AS total_queued_sharesFROM monad.logsWHEREcontract_address = 0x29CA72a4df8165206012c05F773dd367BfD9CDA2AND topic0 = 0x27cf0c9d33856fac5d46a73a8569c7ebf6470ffc7631d277fb593e62bafe3baf),swaps AS (SELECTblock_time,block_number,tx_hash,'swap' AS event_type,bytearray_to_uint256(topic3) = 1 AS swap_x_to_y,bytearray_to_uint256(bytearray_substring(data, 1, 32)) AS amount_in_raw,bytearray_to_uint256(bytearray_substring(data, 33, 32)) AS amount_out_raw,bytearray_to_uint256(bytearray_substring(data, 65, 32)) AS fee_in_rawFROM monad.logsWHEREcontract_address = 0x440CcEac3f5A1b066aF16e4c437427e098DC179cAND topic0 = 0x8dd26a4822a76e398401aa447b8af55ff4361937425b6ea283078db878846cc7),swap_deltas AS (SELECTblock_time,block_number,tx_hash,event_type,CASEWHEN swap_x_to_y THEN CAST(amount_in_raw - fee_in_raw AS double) / 1e18ELSE -CAST(amount_out_raw AS double) / 1e18END AS delta_x,CASEWHEN swap_x_to_y THEN -CAST(amount_out_raw AS double) / 1e6