62 lines
3.9 KiB
Python
62 lines
3.9 KiB
Python
#!/usr/bin/env python3
|
|
from pathlib import Path
|
|
import json, time
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
REPORTS = ROOT / "reports" / "extraction"
|
|
DOCS = ROOT / "docs" / "03-deployment"
|
|
CONFIG = ROOT / "config" / "extraction"
|
|
|
|
def load(p): return json.loads(p.read_text())
|
|
def write(p, data): p.parent.mkdir(parents=True, exist_ok=True); p.write_text(json.dumps(data, indent=2)+"\n")
|
|
def write_text(p, text): p.parent.mkdir(parents=True, exist_ok=True); p.write_text(text.rstrip()+"\n")
|
|
def now(): return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
|
|
review = load(REPORTS / 'immediate-and-same-day-corridor-assets-latest.json')
|
|
plan = load(REPORTS / 'source-to-cex-execution-plan-latest.json')
|
|
ready = load(REPORTS / 'source-to-cex-production-readiness-latest.json')
|
|
validation_path = REPORTS / 'source-to-cex-offchain-sink-validation-latest.json'
|
|
validation = load(validation_path) if validation_path.exists() else None
|
|
inv = load(CONFIG / 'additional-wallet-inventory.json')
|
|
summary = {
|
|
'generated_at': now(),
|
|
'wallet': '0x4A666F96fC8764181194447A7dFdb7d471b301C8',
|
|
'mainnet_funding_posture': plan.get('mainnet_funding_posture'),
|
|
'scope': {
|
|
'included_wallets': ['0x4A666F96fC8764181194447A7dFdb7d471b301C8'],
|
|
'additional_wallet_inventory': 'config/extraction/additional-wallet-inventory.json',
|
|
'additional_wallet_inventory_mode': 'user-supplied',
|
|
'source_to_cex_policy': 'config/extraction/source-to-cex-production-policy.json',
|
|
'source_to_cex_production_enabled': False
|
|
},
|
|
'net_worth_views_usd': {
|
|
'near_immediate_mainnet_cw_exit': review['bucket_subtotals_usd']['immediate'],
|
|
'same_day_corridor_total': review['bucket_subtotals_usd']['same_day_corridor']
|
|
},
|
|
'additional_inventory': {
|
|
'inventory_mode': 'user-supplied',
|
|
'production_sinks': inv.get('offchain_accounts', []),
|
|
'offchain_count': len(inv.get('offchain_accounts', [])),
|
|
'offchain_sink_validation': validation
|
|
},
|
|
'source_artifacts': {
|
|
'immediate_and_same_day_corridor_assets': 'reports/extraction/immediate-and-same-day-corridor-assets-latest.json',
|
|
'source_to_cex_execution_plan': 'reports/extraction/source-to-cex-execution-plan-latest.json',
|
|
'source_to_cex_production_readiness': 'reports/extraction/source-to-cex-production-readiness-latest.json',
|
|
'source_to_cex_offchain_sink_validation': 'reports/extraction/source-to-cex-offchain-sink-validation-latest.json',
|
|
'source_to_cex_production_policy': 'config/extraction/source-to-cex-production-policy.json',
|
|
'additional_wallet_inventory': 'config/extraction/additional-wallet-inventory.json'
|
|
}
|
|
}
|
|
write(REPORTS / 'comprehensive-capital-baseline-latest.json', summary)
|
|
lines = ['# Comprehensive Capital Baseline','',f"- Generated: `{summary['generated_at']}`",f"- Additional inventory: `{summary['scope']['additional_wallet_inventory']}`",f"- Source-to-CEX policy: `{summary['scope']['source_to_cex_policy']}`",f"- Production enabled: `{summary['scope']['source_to_cex_production_enabled']}`"]
|
|
if summary.get('mainnet_funding_posture'):
|
|
lines.append(f"- Mainnet funding posture: `{summary['mainnet_funding_posture']['mode']}` via `{', '.join(summary['mainnet_funding_posture']['required_deployer_assets'])}`")
|
|
lines += ['', '## Snapshot','',f"- Immediate bucket USD: `{summary['net_worth_views_usd']['near_immediate_mainnet_cw_exit']}`",f"- Same-day corridor USD: `{summary['net_worth_views_usd']['same_day_corridor_total']}`"]
|
|
if validation:
|
|
lines += ['', '## Off-Chain Sink Validation', '', f"- Validation ready: `{validation['ready']}`", f"- Included sink count: `{validation['included_sink_count']}`"]
|
|
for warning in (validation or {}).get('warnings', []):
|
|
lines.append(f"- Warning: {warning}")
|
|
lines += ['', '## Source Artifacts', '']
|
|
for k,v in summary['source_artifacts'].items(): lines.append(f'- `{k}`: `{v}`')
|
|
write_text(DOCS / 'COMPREHENSIVE_CAPITAL_BASELINE.md', '\n'.join(lines))
|
|
print(REPORTS / 'comprehensive-capital-baseline-latest.json')
|