Query editor
-- Calculate daily total transaction value for MOG token over the last 180 daysWITH daily_returns AS (SELECTDATE_TRUNC('day', evt_block_time) AS day,SUM(TRY_CAST(value AS DOUBLE)) AS daily_value -- Sum of transaction values per dayFROM erc20_ethereum.evt_TransferWHEREcontract_address = 0xaaeE1A9723aaDB7afA2810263653A34bA2C21C7a -- Filter only for the MOG token by its contract addressAND evt_block_time >= CURRENT_DATE - INTERVAL '180' DAY -- Only include data from the last 180 daysGROUP BYDATE_TRUNC('day', evt_block_time)),-- Prepare a dataset with current and previous day's total values to calculate daily returnsreturns AS (SELECTday,daily_value,LAG(daily_value) OVER (ORDER BY day) AS previous_daily_value -- Total transaction value for the previous dayFROM daily_returns)-- Calculate the standard deviation of daily returns over the periodSELECTROUND(STDDEV((daily_value / previous_daily_value) - 1), 3) AS stddev_daily_returns -- Compute daily return as percentage change from previous dayFROM returnsWHEREprevious_daily_value IS NOT NULL