Add option close liquidity gate with 30% bid/mark cap.

Block new opens while flat legs wait; emergency close bypasses the check.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-25 09:05:04 +08:00
parent 8c14759e78
commit 9fd2a842af
11 changed files with 136 additions and 28 deletions
+2
View File
@@ -37,6 +37,8 @@ async def sim_open_group(
_user: Annotated[str, Depends(require_user)],
body: ManualOpenBody | None = None,
) -> dict:
if Matcher().has_open_position():
raise HTTPException(status_code=409, detail="有未平仓,禁止开下一组")
gw = get_gateway()
pick = await gw.pick_for_open_async()
if pick is None: