Query editor
with u as (selectevt_block_time, evt_block_number, evt_index, evt_tx_hash,_borrower, _coll, _debt,_operation = CAST(3 AS INT) as redemption,CAST(null AS DOUBLE) as pricefrom liquity_ethereum.TroveManager_evt_TroveUpdatedunion allselectevt_block_time, evt_block_number, evt_index, evt_tx_hash,_borrower, _coll, _debt,false as redemption,CAST(null AS DOUBLE) as pricefrom liquity_ethereum.BorrowerOperations_evt_TroveUpdatedunion allselectblock_time as evt_block_time,block_number as evt_block_number,index as evt_index,tx_hash as evt_tx_hash,null as _borrower,null as _coll,null as _debt,false as redemption,CAST(bytearray_to_uint256(data) AS DOUBLE) as pricefrom ethereum.logswhere contract_address = 0x4c517d4e2c851ca76d7ec94b805269df0f2201de andtopic0 = 0x4d29de21de555af78a62fc82dd4bc05e9ae5b0660a37f04729527e0f22780cd3),nn as (select*,ROW_NUMBER() over (partition by _borrowerorder by evt_block_number, evt_index) as troveUpdate,COUNT(price) over (order by evt_block_number, evt_index) as priceUpdatefrom u),n as (selectevt_block_time, evt_block_number, evt_index, evt_tx_hash,_borrower, _coll, _debt, redemption, troveUpdate,MIN(price) over (partition by priceUpdateorder by evt_block_number, evt_index) as pricefrom nn