Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/test_engine_strategies.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for quoting-engine-powered strategies."""
import os
import sys
from pathlib import Path

import pytest

Expand All @@ -13,6 +14,16 @@
from sdk.strategy_sdk.base import StrategyContext


_QE_ROOT = Path.home() / "Tee-work-" / "quoting_engine"
requires_quoting_engine = pytest.mark.skipif(
not _QE_ROOT.is_dir(),
reason=(
f"quoting_engine not available at {_QE_ROOT}; "
"skip tests that require private quoting_engine module"
),
)


def _snap(mid=2500.0, bid=2499.0, ask=2501.0, funding=0.0001, oi=1e6, ts=1000):
spread_bps = round((ask - bid) / mid * 10000, 2) if mid > 0 else 0.0
return MarketSnapshot(
Expand All @@ -30,6 +41,7 @@ def _ctx(qty=0.0, dd=0.0, reduce_only=False):
# EngineMMStrategy
# ---------------------------------------------------------------------------

@requires_quoting_engine
class TestEngineMM:
def test_produces_orders(self):
from strategies.engine_mm import EngineMMStrategy
Expand Down Expand Up @@ -104,6 +116,7 @@ def test_meta_contains_engine_fields(self):
# FundingArbStrategy
# ---------------------------------------------------------------------------

@requires_quoting_engine
class TestFundingArb:
def test_produces_orders(self):
from strategies.funding_arb import FundingArbStrategy
Expand Down Expand Up @@ -152,6 +165,7 @@ def test_no_orders_on_zero_mid(self):
# RegimeMMStrategy
# ---------------------------------------------------------------------------

@requires_quoting_engine
class TestRegimeMM:
def test_produces_orders(self):
from strategies.regime_mm import RegimeMMStrategy
Expand Down Expand Up @@ -196,6 +210,7 @@ def test_no_orders_on_zero_mid(self):
# LiquidationMMStrategy
# ---------------------------------------------------------------------------

@requires_quoting_engine
class TestLiquidationMM:
def test_produces_orders(self):
from strategies.liquidation_mm import LiquidationMMStrategy
Expand Down