Query editor
withparams as (selectfrom_hex('{{account}}') as account),lusd_sales as (selectevt_block_time as time,evt_tx_hash as tx,cast(value as double) / 1e18 as lusd_sold,null as dai_boughtfromparams,liquity_ethereum.LUSD_evt_Transferwhere"from" = accountunion allselectevt_block_time,evt_tx_hash,null,cast(wad as double) / 1e18 as dai_boughtfromparams,maker_ethereum.dai_evt_Transferwheredst = account),lusd_sales_grouping as (selecttime,tx,sum(lusd_sold) as lusd_sold,sum(dai_bought) as dai_boughtfromlusd_salesgroup by1,2)select*fromlusd_sales_groupingwherelusd_sold is not nulland dai_bought is not nullorder bytime