Query editor
With steth_price as (select minute,price from prices.usdwhere blockchain = 'ethereum'and symbol = 'stETH'),withdraw as (select evt_tx_hash, evt_index, date_trunc('day',evt_block_time) as day_ts, 'withdraw' as action_str,onBehalfOf as user_str,amount * price as amount_usdfrom lybra_finance_ethereum.Lybra_depositor_evt_WithdrawEther withdrawleft join steth_price on steth_price.minute = date_trunc('day',evt_block_time)),deposit as (select evt_tx_hash, evt_index, date_trunc('day',evt_block_time) as day_ts,'deposit' as action_str,onBehalfOf as user_str,cast(amount * price as double) as amount_usdfrom lybra_finance_ethereum.Lybra_depositor_evt_DepositEther depositleft join steth_price on steth_price.minute = date_trunc('day',evt_block_time)),mint as (select evt_tx_hash, evt_index, date_trunc('day',evt_block_time) as day_ts,'mint' as action_str,onBehalfOf as user_str,cast(amount as double) as amount_usdfrom lybra_finance_ethereum.Lybra_depositor_evt_Mint),burn as (select evt_tx_hash, evt_index, date_trunc('day',evt_block_time) as day_ts,'burn' as action_str,onBehalfOf as user_str,cast(amount as double) as amount_usdfrom lybra_finance_ethereum.Lybra_depositor_evt_Burn),liquidated_steth as (select evt_tx_hash, evt_index, date_trunc('day',evt_block_time) as day_ts, 'liquidation' as action_str, onBehalfOf as user_str,cast(LiquidateEtherAmount * price as double) as amount_usdfrom lybra_finance_ethereum.Lybra_depositor_evt_LiquidationRecord liquidationleft join steth_price on steth_price.minute = date_trunc('day',evt_block_time))-- ,liquidated_repay_eusd as (-- select evt_tx_hash, evt_index, date_trunc('day',evt_block_time) as day_ts, eusdamount as amount from Lybra_depositor_evt_LiquidationRecord-- ),redemption_steth as (select evt_tx_hash, evt_index, date_trunc('day',evt_block_time) as day_ts, 'rigid_redemption' as action_str, caller as user_str,cast(etherAmount * price as double) as amount_usdfrom lybra_finance_ethereum.Lybra_depositor_evt_RigidRedemption redemptionleft join steth_price on steth_price.minute = date_trunc('day',evt_block_time)),compiled as (select * from depositUNION ALLselect * from withdrawUNION ALLselect * from mintUNION ALLselect * from burnUNION ALLselect * from liquidated_stethUNION ALLselect * from redemption_steth