count(distinctLIQUIDITY_PROVIDER)as"Withdrawers"fromtb1whereACTION='DECREASE_LIQUIDITY'groupby1), tb3as(selecttb2.day, --, tb3 as (select tb2.day,
caseWHENtb2.day>='2022-09-01'andtb2.day<'2022-09-15'THEN'Two weeks before the merge'WHENtb2.day<'2022-09-01'THEN'Before merge'ELSE'After merge'endasPeriod,
tb2."eth amount"AS"Deposit eth amount", W."eth amount"AS"Withdraw eth amount", tb2."eth amount"-W."eth amount"as"Net eth amount", casewhen"Net eth amount"<0then'-'else'+'endas"Net Amount status",
W."w txCount"AS"Withdraw TX number", tb2."d txCount"AS"Deposit TX number", W."Withdrawers", tb2."Depositors"fromtb2joinWontb2.day=W.dayorderby1asc)--= W.day order by 1 asc )
select* ,sum("Deposit eth amount")over(orderbydayasc)as"Deposit eth amount commulative" ,sum("Net eth amount")over(orderbydayasc)as"Net eth commulative"
,sum("Withdraw eth amount")over(orderbydayasc)as"Withdraw eth amount commulative" ,(selectsum("Withdraw eth amount")fromtb3wherePeriod='Two weeks before the merge')as"Withdraw eth amount TWoweeks"
,(selectsum("Deposit eth amount")fromtb3wherePeriod='Two weeks before the merge')as"Deposit eth amount TWoweeks"--as "Deposit eth amount TWoweeks"
,((selectsum("Withdraw eth amount")fromtb3wherePeriod='Two weeks before the merge')/(selectsum("Deposit eth amount")fromtb3wherePeriod='Two weeks before the merge'))as"w/d"