Query editor
withparams as (selectfrom_hex('{{account}}') as account,0x4f9Fbb3f1E99B56e0Fe2892e623Ed36A76Fc605d as lqty_staking),lqty_sales as (selectevt_block_time as time,evt_tx_hash as tx,cast(value as double) / 1e18 as lqty_sold,null as lusd_boughtfromparams,liquity_ethereum.LQTYToken_evt_Transferwhere"from" = accountand to != lqty_stakingunion allselectevt_block_time,evt_tx_hash,null,cast(value as double) / 1e18 as lusd_boughtfromparams,liquity_ethereum.LUSD_evt_Transferwhere"from" != lqty_stakingand to = account),lqty_sales_grouping as (selecttime,tx,sum(lqty_sold) as lqty_sold,sum(lusd_bought) as lusd_boughtfromlqty_salesgroup by1,2)select*fromlqty_sales_groupingwherelqty_sold is not nullorder bytime