Query editor
with deposits_raw as (selectblock_time,varbinary_to_uint256(from_hex(SUBSTRING(cast(data as varchar), 3, 64)))/1e18 assets,varbinary_to_uint256(from_hex(SUBSTRING(cast(data as varchar), 67, 64)))/1e18 shares,varbinary_to_uint256(from_hex(SUBSTRING(cast(data as varchar), 3, 64)))/2.5/varbinary_to_uint256(from_hex(SUBSTRING(cast(data as varchar), 67, 64)))*2.5 share_pricefromethereum.logswhere topic0 = 0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7and contract_address = 0x06b964d96f5dcf7eae9d7c559b09edce244d4b8e),withdraws_raw as (selectblock_time,varbinary_to_uint256(from_hex(SUBSTRING(cast(data as varchar), 3, 64)))/1e18 assets,varbinary_to_uint256(from_hex(SUBSTRING(cast(data as varchar), 67, 64)))/1e18 shares,varbinary_to_uint256(from_hex(SUBSTRING(cast(data as varchar), 3, 64)))/0.9/varbinary_to_uint256(from_hex(SUBSTRING(cast(data as varchar), 67, 64))) share_pricefromethereum.logswhere topic0 = 0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8dband contract_address = 0x06b964d96f5dcf7eae9d7c559b09edce244d4b8e),price_hourly as (selectdate_trunc('hour', block_time) hour,approx_percentile(share_price, 0.5) AS median_share_pricefrom (select block_time, share_price from deposits_rawunion allselect block_time, share_price from withdraws_raw)group by 1),deposits_hourly as (selectdate_trunc('hour', block_time) hour,sum(assets) assets,sum(shares) sharesfromdeposits_rawgroup by 1),withdraws_hourly as (selectdate_trunc('hour', block_time) hour,sum(assets) assets,sum(shares) sharesfromwithdraws_rawgroup by 1),-- net_mints as (-- select-- hour,-- sum(shares) net_mint,-- sum(burnt) burnt-- from (-- select hour, shares, 0 burnt from deposits-- union all-- select hour, -shares, 0.1 * assets/0.9 from withdraws