Add dynamic agent registry and options mandate

Introduces a dashboard-managed agent registry (`state/agents.json`) used by nightly research and market-open execution, including support for custom/disabled agents and per-agent time budgets. Expands personas to four agents (adds Maverick), shifts pick targets to include mandatory options, and updates prompts/finalization nudges to enforce option research without hard-failing runs.

Strengthens execution safety by adding option-specific guardrails (conviction floor, premium cap, reserved option slot through trade/day/buying-power caps), validates OCC option symbols in schemas, and normalizes invalid option direction cases. The dashboard was refactored into modular views, adds an Agents admin tab, and improves live portfolio visibility with Alpaca-first data and snapshot fallback.
This commit is contained in:
Aryan Singh committed 2026-07-07 22:00:20 -05:00
1 parent b3821abd69
commit e1ac514f30
36 files changed
+1476 -294

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
"""Orders tab: order history with agent / status / date filters."""
from __future__ import annotations
import streamlit as st
from web.views.common import describe_symbol, query_df
def render() -> None:
orders = query_df(
"SELECT trade_date, agent, ticker, side, qty, est_price, stop_price, take_price, "
"status, alpaca_order_id, submitted_at FROM orders ORDER BY submitted_at DESC LIMIT 500"
)
if orders.empty:
st.info("No orders placed yet.")
return
c1, c2, c3 = st.columns(3)
agents = ["all", *sorted(orders["agent"].dropna().unique())]
dates = ["all", *sorted(orders["trade_date"].dropna().unique(), reverse=True)]
agent = c1.selectbox("Agent", agents)
date = c2.selectbox("Date", dates)
status = c3.selectbox("Status", ["all", "ok", "errors"])
view = orders
if agent != "all":
view = view[view["agent"] == agent]
if date != "all":
view = view[view["trade_date"] == date]
if status == "errors":
view = view[view["status"].astype(str).str.startswith("error")]
elif status == "ok":
view = view[~view["status"].astype(str).str.startswith("error")]
view = view.copy()
view.insert(3, "instrument", view["ticker"].map(describe_symbol))
st.caption(f"{len(view)} orders")
st.dataframe(view, use_container_width=True, hide_index=True)