Query editor
withbase as (WITH eth_in as (SELECTdate_trunc(day, block_time) as day,SUM(tr.value/1e18) as eth_fundedFROM ethereum.traces trWHERE tr.success=trueAND tr.to = '0x6D538Bab6E961dD9719Bd6f9676293989CA8D714'AND "from" = '0x0cc1cF477D41D864854074C2BDE160dc88d17160'AND tr."type"='call'AND (tr."call_type" NOT IN ('delegatecall', 'callcode', 'staticcall') OR tr."call_type" IS null)GROUP BY 1),eth_out as (SELECTdate_trunc('day', block_time) as day,SUM(tr."value"/1e18) as eth_spentFROM ethereum.traces trWHERE tr."success"=trueAND "from" = '\x6D538Bab6E961dD9719Bd6f9676293989CA8D714' --https://etherscan.io/tokenholdings?a=0xd5f279ff9EB21c6D40C8f345a66f2751C4eeA1fBAND tr."type"='call'AND (tr."call_type" NOT IN ('delegatecall', 'callcode', 'staticcall') OR tr."call_type" IS null)GROUP BY 1)SELECTCOALESCE(ei.day, eo.day) as day, COALESCE(eth_funded, 0) as eth_funded, COALESCE(eth_spent, 0) as eth_spent, COALESCE(eth_funded,0) - COALESCE(eth_spent, 0) as eth_diffFROM eth_in eiFULL OUTER JOIN eth_out eo ON ei.day = eo.day),days AS(SELECT generate_series(date_trunc('day',(SELECT min(day) FROM base)), date_trunc('day', NOW()), '1 day') AS day)SELECTt.day,-1*b.eth_spent as "ETH Spent",b.eth_funded as "ETH Earned",b.eth_diff as "ETH Difference",SUM(b.eth_funded) OVER (ORDER BY t.day asc) as "ETH Earned From auctions (On Date)"FROM days tLEFT JOIN base b ON b.day = t.day