-- Explicit sample-data refresh requested on 2026-09-08.
-- Random changes are drawn once and stored, not generated on each page load.
-- Touches only the five existing demo projects; current prices/returns stay unchanged.
-- Replace these illustrative quotes and icon images through the admin when real data is ready.
begin;
with samples(slug,icon,ratios) as (values
('solar-power-revenue','/images/solar.jpg',array[0.987459267,0.989209677,0.990183335,0.988737687,0.986320758,0.994563293,0.996668162,0.995649757,0.983332401,0.991597528,0.984243911,1.001430174,0.996053611,0.985411416,1.000883248,1.003683351,1.004078849,0.992640017,1.006417395,0.986536038,0.997844827,1.002481323,0.986436863,0.993399091,0.993614752,0.996886099,0.992081062,1.000767913,1.001192733,1.001722843,1.000612603,1]::numeric[]),
('izadshahr-cultural-complex','/images/izadshahr-cultural.png',array[1.058649164,1.056447566,1.056641403,1.050092925,1.046758769,1.046431316,1.041607155,1.036947342,1.034533102,1.047595171,1.032712539,1.046189912,1.048963717,1.035382243,1.037356967,1.038338115,1.038498231,1.027776087,1.031766293,1.014001966,1.015512016,1.008864973,1.014480924,1.006435057,1.005410618,1.018679974,1.005758584,1.005756332,1.002262325,1.002477272,1.001899394,1]::numeric[]),
('digital-oil','/images/digital-oil.png',array[1.033378113,1.03218417,1.032137315,1.031122133,1.024395506,1.021725976,1.032084647,1.029982917,1.019507603,1.034246299,1.028305906,1.02046383,1.019530024,1.014440907,1.006498242,1.005784851,1.026477327,1.001813049,1.011620463,1.004642652,1.00956474,1.004201047,1.000859807,1.007800189,1.007460789,1.002522961,0.999080781,1.007559846,1.007267012,1.002332572,1.001162586,1]::numeric[]),
('decentralized-app-store','/images/decentralized-app-store.png',array[0.955018623,0.956180168,0.958127069,0.95556159,0.96016413,0.964191789,0.967336754,0.967698687,0.961556031,0.96173938,0.974839406,0.965307172,0.982984632,0.983354334,0.980408365,0.977481965,0.965537187,0.978724581,0.969945373,0.983282656,0.995855094,0.994080771,0.993805211,0.989910935,0.992471523,0.989959311,0.994720068,0.999341305,0.994238574,0.999605554,0.997150023,1]::numeric[]),
('nft-marketplace','/images/nft-marketplace.png',array[0.971345313,0.971297853,0.974662177,0.975788358,0.972704586,0.980865232,0.97398935,0.97075364,0.987745231,0.979619035,0.988598121,0.972887035,0.980039217,0.989842736,0.983223222,0.972826847,0.982681072,0.979836617,0.989173321,0.991843978,0.984474953,0.985788434,0.985723921,0.985417377,0.991495697,0.999464479,0.998855412,0.994247477,0.997629341,0.995546123,0.999209922,1]::numeric[])
)
update public.projects p set
 token_icon_url=s.icon,
 price_24h_ago_rial=round(p.unit_price_rial*s.ratios[1]),
 price_history_24h=(select jsonb_agg(round(p.unit_price_rial*r) order by ord) from unnest(s.ratios) with ordinality as points(r,ord)),
 market_updated_at=now()
from samples s where p.slug=s.slug and p.is_demo=true;
commit;
