Open
Add Order History: expose all-orders endpoint and tabbed dashboard view#63
Conversation
Add shared models, trading engine, dataops, infrastructure, tests, CI/CD workflows, and documentation for the AGI Trading Platform. ## Shared Layer - Pydantic v2 models: Order, Position, Portfolio, OHLCV, OrderBook, Ticker, Trade, MarketSnapshot, TradingSignal, RiskAssessment, AGIDecision - Configuration via pydantic-settings with TRADING_ env var prefix - Structured logging via loguru with file rotation - Domain exceptions hierarchy rooted at TradingPlatformError - Utility helpers: Decimal rounding, async retry decorator, Timer ## Trading Engine - BaseConnector ABC with uniform interface for all exchanges - AlpacaConnector (paper trading default) via alpaca-py - BinanceConnector (testnet default) via python-binance - OrderManager: async order registry with exchange sync and state transitions - RiskEngine: pre-trade checks (order size, position size, drawdown, daily loss) - PortfolioManager: asyncio.Lock-protected P&L tracking with mark-to-market ## DataOps - MarketDataCollector: WebSocket feed with Redis pub/sub fan-out and exponential-backoff reconnect - TimeSeriesDB: asyncpg + TimescaleDB wrapper for OHLCV and trade storage - StreamProcessor: aiokafka producer/consumer with per-topic handler dispatch ## Infrastructure - docker-compose.yml: full stack (trading-engine, TimescaleDB, Redis, Kafka/ZooKeeper, Prometheus, Grafana) - docker/Dockerfile.trading-engine: Python 3.12-slim non-root image - Kubernetes Deployment + Service + ServiceAccount for trading-engine - Kubernetes StatefulSet + headless Service for PostgreSQL - Prometheus scrape config for all services ## Tests (26 passing) - Unit tests: OrderManager, RiskEngine, PortfolioManager - Integration tests: full trade lifecycle, risk blocking, multi-order tracking - Shared conftest with reusable Order/Position/Portfolio fixtures ## CI/CD - ci.yml: lint (ruff + mypy), test (pytest --cov), Docker build - cd.yml: staging deploy on main push, production deploy on version tag Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- portfolio_manager: fix commission handling on sell fills (subtract, not add) - risk_engine: warn when market order price cannot be estimated - time_series_db: add UNIQUE(time,symbol,interval) constraint; use explicit ON CONFLICT columns - stream_processor/market_data_collector: use Task[None] generic annotation - order_manager: document GIL-safety of order_count() - docker-compose: add comment explaining ZooKeeper vs KRaft trade-off - ci.yml / cd.yml: add explicit permissions: contents: read on all jobs to satisfy least-privilege GITHUB_TOKEN requirements Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ntation Co-authored-by: Stacey77 <54900383+Stacey77@users.noreply.github.com>
Co-authored-by: Stacey77 <54900383+Stacey77@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add missing critical components to AGI Trading Platform
Complete AGI Trading Platform: trading engine, DataOps, infrastructure, tests, CI/CD, docs
Feb 20, 2026
Stacey77
reviewed
Feb 21, 2026
Owner
|
OK |
Stacey77
marked this pull request as ready for review
February 21, 2026 01:34
Owner
|
DONE |
…space and per-env ConfigMaps Co-authored-by: Stacey77 <54900383+Stacey77@users.noreply.github.com>
Copilot
AI
changed the title
Complete AGI Trading Platform: trading engine, DataOps, infrastructure, tests, CI/CD, docs
Fix CD pipeline: production deployment was permanently blocked
Mar 4, 2026
Co-authored-by: Stacey77 <54900383+Stacey77@users.noreply.github.com>
Co-authored-by: Stacey77 <54900383+Stacey77@users.noreply.github.com>
Copilot
AI
changed the title
Fix CD pipeline: production deployment was permanently blocked
Wire trading service layer into FastAPI; add REST trading endpoints and paper connector
Mar 4, 2026
Co-authored-by: Stacey77 <54900383+Stacey77@users.noreply.github.com>
Copilot
AI
changed the title
Wire trading service layer into FastAPI; add REST trading endpoints and paper connector
Add HTML trading dashboard served at /
Mar 4, 2026
Co-authored-by: Stacey77 <54900383+Stacey77@users.noreply.github.com>
Copilot
AI
changed the title
Add HTML trading dashboard served at /
Add Order History: expose all-orders endpoint and tabbed dashboard view
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paper MARKET orders fill instantly and disappear from the Open Orders view — there was no way to see order history.
OrderManager.get_all_orders()existed but was never wired up.Backend
GET /api/v1/orders/all— returns all orders regardless of status, sorted byupdated_atdescGET /api/v1/meta— exposes the canonicalOPEN_STATUSESfrozenset (derived fromOrderStatusenum) so the frontend never hard-codes status stringsDashboard
Orders panel gains Open / History tabs. History tab adds an Avg Fill column and replaces the Cancel button with
—for terminal orders. Open-status set is hydrated from/api/v1/metaon init.Tests
7 new tests across
TestMetaandTestListAllOrders(50 total).Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.