Query editor
SELECTfrom_unixtime(timestamp_ms/1000) as ts,date_trunc('day', from_unixtime(timestamp_ms/1000)) AS event_day,json_extract_scalar(event_json, '$.position.user') AS user,json_extract_scalar(event_json, '$.position.perpID') AS perpID,CAST(json_extract_scalar(event_json, '$.position.oiOpen') AS DOUBLE) / 1e9 AS oi_open,CAST(json_extract_scalar(event_json, '$.position.margin') AS DOUBLE) / 1e9 AS margin,json_extract_scalar(event_json, '$.tx_index') AS tx_indexFROM sui.eventsWHERE event_type = '0xcb4e1ee2a3d6323c70e7b06a8638de6736982cbdc08317d33e6f098747e2b438::position::AccountPositionUpdateEventV2'AND timestamp_ms >= 1690848000000 -- 2023-08-01 filter for partition pruningAND date_trunc('day', from_unixtime(timestamp_ms/1000)) <= CURRENT_DATE