Query editor
-- Query to get friend.tech TVLWITHeth_price AS (SELECTdate_trunc('hour', minute) AS time,AVG(price) AS eth_priceFROMprices.usdWHEREblockchain = 'ethereum'AND contract_address = 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2AND minute >= date('2023-08-10')GROUP BY1)SELECTtime,ft.eth_tvl,ft.eth_tvl * p.eth_price AS usd_tvlFROM(SELECTdate_trunc('hour', ft.evt_block_time) AS time,SUM(COALESCE(SUM(CAST(ft.ethAmount AS double) / 1e18) FILTER(WHEREft.isBuy),0) - COALESCE(SUM(CAST(ft.ethAmount AS double) / 1e18) FILTER(WHERENOT ft.isBuy),0)) OVER (ORDER BYdate_trunc('hour', ft.evt_block_time) ROWS BETWEEN UNBOUNDED PRECEDINGAND CURRENT ROW) AS eth_tvlFROMfriendtech_base.FriendtechSharesV1_evt_Trade ftGROUP BY1) ftINNER JOIN eth_price p USING (time)