Remove mispricing price cap from market alerts

This commit is contained in:
2569718930@qq.com
2026-04-01 18:46:46 +08:00
parent b1b8d3439c
commit 384fd7d1e4
3 changed files with 0 additions and 25 deletions
-1
View File
@@ -78,7 +78,6 @@ TELEGRAM_ALERT_MIN_TRIGGER_COUNT=2
TELEGRAM_ALERT_MIN_SEVERITY=medium
TELEGRAM_ALERT_MISPRICING_ONLY=true
TELEGRAM_ALERT_MISPRICING_INTERVAL_SEC=7200
TELEGRAM_ALERT_MISPRICING_MAX_YES_BUY=0.10
TELEGRAM_MARKET_FOCUS_DIGEST_ENABLED=true
TELEGRAM_MARKET_FOCUS_DIGEST_HOURS=11,18
TELEGRAM_MARKET_FOCUS_DIGEST_TOP_N=5
-3
View File
@@ -125,7 +125,6 @@ PolyWeather 的环境变量很多,但不是所有变量都属于同一层级
- `TELEGRAM_ALERT_MIN_SEVERITY`
- `TELEGRAM_ALERT_MISPRICING_ONLY`
- `TELEGRAM_ALERT_MISPRICING_INTERVAL_SEC`
- `TELEGRAM_ALERT_MISPRICING_MAX_YES_BUY`
- `TELEGRAM_MARKET_FOCUS_DIGEST_HOURS`
- `TELEGRAM_MARKET_FOCUS_DIGEST_TOP_N`
- `TELEGRAM_MARKET_FOCUS_DIGEST_GRACE_MINUTES`
@@ -232,7 +231,6 @@ TELEGRAM_ALERT_MIN_TRIGGER_COUNT=2
TELEGRAM_ALERT_MIN_SEVERITY=medium
TELEGRAM_ALERT_MISPRICING_ONLY=true
TELEGRAM_ALERT_MISPRICING_INTERVAL_SEC=7200
TELEGRAM_ALERT_MISPRICING_MAX_YES_BUY=0.10
TELEGRAM_MARKET_FOCUS_DIGEST_ENABLED=true
TELEGRAM_MARKET_FOCUS_DIGEST_HOURS=11,18
TELEGRAM_MARKET_FOCUS_DIGEST_TOP_N=5
@@ -269,7 +267,6 @@ TELEGRAM_ALERT_MIN_TRIGGER_COUNT=2
TELEGRAM_ALERT_MIN_SEVERITY=medium
TELEGRAM_ALERT_MISPRICING_ONLY=true
TELEGRAM_ALERT_MISPRICING_INTERVAL_SEC=7200
TELEGRAM_ALERT_MISPRICING_MAX_YES_BUY=0.10
TELEGRAM_MARKET_FOCUS_DIGEST_ENABLED=true
TELEGRAM_MARKET_FOCUS_DIGEST_HOURS=11,18
TELEGRAM_MARKET_FOCUS_DIGEST_TOP_N=5
-21
View File
@@ -616,12 +616,8 @@ def _severity_ok(alert_payload: Dict[str, Any], min_severity: str, min_trigger_c
def _market_price_cap_ok(
alert_payload: Dict[str, Any],
max_yes_buy: float,
require_actionable_quote: bool = False,
) -> bool:
if max_yes_buy >= 1.0:
return True
market = alert_payload.get("market_snapshot") or {}
if not isinstance(market, dict) or not market.get("available"):
if require_actionable_quote:
@@ -730,18 +726,6 @@ def _market_price_cap_ok(
)
return False
if yes_buy >= max_yes_buy:
logger.info(
"trade alert skipped by mispricing cap city={} bucket={} anchor_model={} anchor_settle={} yes_buy={} cap={}".format(
alert_payload.get("city"),
bucket_label or "--",
anchor_model,
settle_ref,
round(yes_buy, 4),
round(max_yes_buy, 4),
)
)
return False
return True
@@ -903,13 +887,8 @@ def _maybe_send_alert(
last_by_city = state.setdefault("last_by_city", {})
last_city = last_by_city.get(city) or {}
is_active = _severity_ok(alert_payload, min_severity, min_trigger_count)
max_yes_buy = max(
0.0,
min(1.0, _env_float("TELEGRAM_ALERT_MISPRICING_MAX_YES_BUY", 0.10)),
)
if not _market_price_cap_ok(
alert_payload,
max_yes_buy,
require_actionable_quote=mispricing_only,
):
is_active = False