Query editor
WITH new_orders AS (SELECTevt_block_time AS new_order_time,evt_tx_hash AS new_order_tx_hash,account,isLong,posId,positionType,refer,tokenId,element_at(triggerData, 3) / 1e30 AS sizeFROMunidex_v4_arbitrum.OrderVault_evt_NewOrder),finished_orders AS (SELECTevt_block_time AS finish_order_time,evt_tx_hash AS finish_order_tx_hash,posId,orderStatusFROMunidex_v4_arbitrum.OrderVault_evt_FinishOrderWHEREorderStatus = 2 -- Filter for filled orders)SELECTn.new_order_time,n.new_order_tx_hash,f.finish_order_time,f.finish_order_tx_hash,n.account,n.isLong,n.posId,n.positionType,n.refer,n.tokenId,n.size,f.orderStatusFROMnew_orders nJOINfinished_orders f ON n.posId = f.posIdORDER BYf.finish_order_time DESC