Artifex/control_plane/trading_studio/profiles.py
2026-08-17 13:48:50 +07:00

54 lines
1.5 KiB
Python

from __future__ import annotations
import hashlib
from pathlib import Path
from typing import Protocol
class TradingProjectProfile(Protocol):
name: str
def archaeology(self, repository_path: str) -> dict: ...
class CryptoTradingProfile:
name = "crypto"
def archaeology(self, repository_path: str) -> dict:
root = Path(repository_path)
return {
"profile": self.name,
"repository": str(root),
"status": "UNKNOWN" if not root.exists() else "CONFIRMED",
"datasets": [],
"findings": [],
}
class HyperliquidProfile(CryptoTradingProfile):
name = "crypto_hyperliquid"
class ExistingSystemProfile(Protocol):
name: str
def feature_inventory(self, repository_path: str) -> list[dict]: ...
class HyperScalperProfile:
name = "hyperscalper"
def feature_inventory(self, repository_path: str) -> list[dict]:
root = Path(repository_path)
candidates = [
root / "src" / "hyperscalper" / "fast_engine.py",
root / "src" / "hyperscalper" / "indicators_depth_nb.py",
root / "src" / "hyperscalper" / "indicator_library.py",
]
rows = []
for path in candidates:
if not path.exists():
continue
digest = hashlib.sha256(path.read_bytes()).hexdigest()
rows.append({"name": path.stem, "family": "HYPERSCALPER_IMPORT", "implementation_reference": str(path), "code_hash": digest})
return rows