#!/usr/bin/env python3 """Offline, hypothetical price/supply decomposition; no market or account access.""" import argparse,json from decimal import Decimal from pathlib import Path def calculate(): rows=[] for label,p1,s1 in [('가격 하락·공급 증가','900','12000000'),('가격 유지·공급 증가','1000','12000000'),('가격 상승·공급 유지','1100','10000000')]: p0,s0=Decimal('1000'),Decimal('10000000');p1,s1=Decimal(p1),Decimal(s1) cap0,cap1=p0*s0,p1*s1 price_change=(p1/p0-1)*100;supply_change=(s1/s0-1)*100 cap_change=(cap1/cap0-1)*100 assert cap_change==price_change+supply_change+price_change*supply_change/100 rows.append({'case':label,'price0_won':str(p0),'supply0':str(s0),'cap0_won':str(cap0),'price1_won':str(p1),'supply1':str(s1),'cap1_won':str(cap1),'price_change_percent':str(price_change),'supply_change_percent':str(supply_change),'cap_change_percent':str(cap_change),'interaction_percentage_points':str(price_change*supply_change/100)}) return {'kind':'hypothetical arithmetic, not market observations','calculated_at':'2026-10-22','units':'KRW and token units','limits':'No trades, fees, price discovery, supply-data revision attribution or investment returns are measured. Same asset, currency and definition assumed.','rows':rows} if __name__=='__main__': p=argparse.ArgumentParser();p.add_argument('--output',type=Path);a=p.parse_args();r=calculate() if a.output: with a.output.open('x') as f:json.dump(r,f,ensure_ascii=False,indent=2);f.write('\n') else:print(json.dumps(r,ensure_ascii=False,indent=2))