Query editor
-- Forked to show 10k invest all into holding one token i.e. 100% ETH holding portfolio-- Parameters-- {{token_a}} - either token-- {{start}} - date as of which the analysis should run-- limit the relevant date rangewith date_series as (select t.dayfromunnest(sequence(date(timestamp '{{start}}'),date(now()))) t (day) --noqa: AL01),prices AS(SELECT"timestamp" AS "day",contract_address,blockchain,APPROX_PERCENTILE(price,0.5) AS priceFROM prices."day"WHERE contract_address = ({{token_a}})AND blockchain = '{{blockchain}}'GROUP BY 1, 2, 3),starting_balance as (select10000 / price as token_a_start--,5000 / p2.price as token_b_startfrom priceswhere day = date(timestamp '{{start}}'))selectds.day,token_a_start * p1.price as current_value_of_investmentfrom starting_balancecross join date_series as dsinner join prices as p1onds.day = p1.dayand p1.contract_address = {{token_a}}order by 1 desc