Restructure Plan UI for semi-auto tabs and T-quote ladder.

Hide amplitude card when filter off; compact semi form with rules; monitor tab keeps positions and market.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-08 14:01:12 +08:00
parent 457838ef64
commit d98bf46549
4 changed files with 632 additions and 189 deletions
+14 -1
View File
@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import Annotated
from fastapi import APIRouter, Depends, HTTPException
from fastapi import APIRouter, Depends, HTTPException, Query
from ..market import get_gateway
from .auth import require_user
@@ -18,6 +18,19 @@ async def market_snapshot(_user: Annotated[str, Depends(require_user)]) -> dict:
return snap
@router.get("/option-ladder")
async def market_option_ladder(
_user: Annotated[str, Depends(require_user)],
wings: int = Query(default=4, ge=1, le=12),
) -> dict:
"""半自动页 T 型报价:ATM 上下各 wings 档。"""
gw = get_gateway()
ladder = getattr(gw, "option_ladder", None)
if not callable(ladder):
raise HTTPException(status_code=501, detail="当前会话不支持 option-ladder")
return ladder(wings=wings)
@router.post("/realign")
async def market_realign(_user: Annotated[str, Depends(require_user)]) -> dict:
"""手动重对齐次日到期 ATM 合约(运维/调试用)。"""