Query editor
WITH price_points AS (SELECTfrom_unixtime(varbinary_to_bigint(varbinary_ltrim(varbinary_substring(data, 161, 32)))) AS valuation_at,CAST(varbinary_to_uint256(varbinary_substring(data, 97, 32))AS DOUBLE) / 1e18 AS share_priceFROM arbitrum.logsWHERE contract_address = 0xae43f8fD755fEA350F85B336f657f5975b23Ab4EAND topic0 = 0xf94e53f8d9b2a3751616409b5de74a49f1b9b6430e3bae51fbfb0d1725e27196),latest AS (SELECT valuation_at, share_priceFROM price_pointsORDER BY valuation_at DESCLIMIT 1),price_7d_ago AS (SELECT p.valuation_at, p.share_priceFROM price_points pCROSS JOIN latest lWHERE p.valuation_at <= l.valuation_at - INTERVAL '7' DAYORDER BY p.valuation_at DESCLIMIT 1)SELECT100 * (l.share_price / w.share_price - 1) AS weekly_pct_change,l.share_price AS latest_share_price,w.share_price AS share_price_7d_ago,l.valuation_at AS latest_valuation_atFROM latest lCROSS JOIN price_7d_ago w;