build(agent): new-agents-2#7e3bbc iteration
This commit is contained in:
parent
6994b86f6e
commit
ae14be2889
|
|
@ -11,6 +11,7 @@ from .coordinator import admm_lite_step # noqa: F401
|
||||||
from .ir import map_to_ir # noqa: F401
|
from .ir import map_to_ir # noqa: F401
|
||||||
from .go_registry import GoCRegistry # noqa: F401
|
from .go_registry import GoCRegistry # noqa: F401
|
||||||
from .two_venue_demo import run_demo # noqa: F401
|
from .two_venue_demo import run_demo # noqa: F401
|
||||||
|
from .energi_bridge import EnergiBridge # noqa: F401
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"LocalArbProblem",
|
"LocalArbProblem",
|
||||||
|
|
@ -18,6 +19,7 @@ __all__ = [
|
||||||
"DualVariables",
|
"DualVariables",
|
||||||
"AuditLog",
|
"AuditLog",
|
||||||
"PrivacyBudget",
|
"PrivacyBudget",
|
||||||
|
"EnergiBridge",
|
||||||
"admm_lite_step",
|
"admm_lite_step",
|
||||||
"map_to_ir",
|
"map_to_ir",
|
||||||
"GoCRegistry",
|
"GoCRegistry",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
from typing import Dict, Any
|
||||||
|
|
||||||
|
from .primitives import LocalArbProblem, SharedSignals
|
||||||
|
from .coordinator import PlanDelta
|
||||||
|
|
||||||
|
|
||||||
|
class EnergiBridge:
|
||||||
|
"""Canonical bridge for ArbSphere primitives to a vendor-agnostic IR.
|
||||||
|
|
||||||
|
This is a lightweight, production-friendly scaffold intended to enable
|
||||||
|
adapters to plug into a common IR without leaking internal Python types.
|
||||||
|
The implementations here are intentionally minimal and deterministic to
|
||||||
|
support reproducible backtests and audits.
|
||||||
|
"""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def map_local_arb_to_ir(lp: LocalArbProblem) -> Dict[str, Any]:
|
||||||
|
return {
|
||||||
|
"type": "LocalArbProblem",
|
||||||
|
"asset_pair": [lp.asset_pair[0], lp.asset_pair[1]],
|
||||||
|
"target_mispricing": lp.target_mispricing,
|
||||||
|
"liquidity_budget": lp.liquidity_budget,
|
||||||
|
"latency_budget": lp.latency_budget,
|
||||||
|
}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def map_shared_signals_to_ir(signals: SharedSignals) -> Dict[str, Any]:
|
||||||
|
return {
|
||||||
|
"type": "SharedSignals",
|
||||||
|
"deltas": list(getattr(signals, "deltas", [])),
|
||||||
|
"cross_venue_corr": signals.cross_venue_corr,
|
||||||
|
"liquidity_availability": dict(signals.liquidity_availability),
|
||||||
|
"latency_proxy": signals.latency_proxy,
|
||||||
|
}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def map_plan_delta_to_ir(delta: PlanDelta) -> Dict[str, Any]:
|
||||||
|
return {
|
||||||
|
"type": "PlanDelta",
|
||||||
|
"legs": list(delta.legs),
|
||||||
|
"total_size": float(delta.total_size),
|
||||||
|
"delta_id": delta.delta_id,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ["EnergiBridge"]
|
||||||
Loading…
Reference in New Issue