01 / Context
From Slithery Trades to SideChart.
What happens when quantitative market analysis meets agentic AI, but the authority to act remains with a human?
The idea began with two books by Michael Lewis: Flash Boys and Going Infinite. Their accounts of technology, trading, and financial markets sparked my curiosity about the systems behind market decisions and the role algorithms play in them. That curiosity led to Slithery Trades, an earlier project exploring algorithmic trading through data science and quantitative analysis.
As generative AI evolved into agentic workflows, I began to reconsider the problem. Rather than building another system that simply generates trading signals, I wanted to explore how specialized agents could gather information, interpret quantitative signals, and produce recommendations that a human could evaluate before taking action.
SideChart is the result of that evolution. The architectural challenge was to connect market data, agent-assisted research, portfolio context, human review, and broker integration without giving a probabilistic model unrestricted authority over execution. The objective was not to build a high-frequency trading engine or promise investment returns, but to design a controlled research and paper-trading workflow.
02 / Constraints
Intelligence without unchecked autonomy.
Trading creates a useful design constraint for agentic systems: a recommendation and an authorized action are not the same thing. Model-generated output can be uncertain, external data can change, and an execution request can fail or arrive more than once.
- Human authority. The approved-order path requires a persisted review in an approved or modified state. A supervisor proposal is not itself an order.
- Traceable state. Research signals, reviews, orders, fills, portfolio snapshots, connector events, and model usage need durable records.
- Broker isolation. Interactive Brokers Gateway remains local. AWS must not initiate inbound connections to the workstation or require its broker ports to be exposed publicly.
- Failure-aware execution. Duplicate deliveries, expired commands, and uncertain broker responses require explicit handling rather than blind retries.
- Controlled operating scope. The project is intended for research and paper trading. Live execution, public application access, and production readiness require additional controls and validation.
The agent can recommend an action. A persisted human decision authorizes it. Deterministic application logic controls how it is executed.
03 / Decisions
Separate reasoning, state, and execution.
The system uses a statically exported Next.js dashboard served by CloudFront from a private S3 origin. API traffic is split between the researcher Lambda Function URL and dedicated HTTP API Gateway routes for supervisor proposals and approved orders. This separates longer-running research from narrower action-oriented endpoints; the tradeoff is additional routing and access-control complexity.
Agent-assisted research
Containerized Lambda services use Amazon Bedrock through the Agents SDK and LiteLLM integration. The interactive researcher combines web research through Playwright MCP with quantitative market-data contracts, while the supervisor produces a reviewable rebalance proposal. A separate asynchronous planner architecture includes classifier, reporter, and charter specialists. The reporter uses retrieval through S3 Vectors and a serverless SageMaker embedding endpoint; the ingestion Lambda embeds documents for the research index. The planner queue currently has a consumer but is not connected to a browser producer, so the interactive and legacy asynchronous paths should not be treated as one fully integrated workflow.
Durable review and execution
Aurora PostgreSQL Serverless v2, accessed through the RDS Data API, serves as the system of record. Ordered SQL migrations establish the relationships between research signals, reviews, orders, executions, and supporting audit data. Relational state makes it possible to validate an approval against the original signal and distinguish a recommendation from an execution event.
The approved-order Lambda accepts a review identifier instead of trusting order parameters submitted by the browser. It locks and validates the stored review, creates an order record with idempotent handling, and publishes a command to an SQS FIFO queue. The local connector polls outbound over HTTPS, communicates with IB Gateway, and returns broker events through a separate FIFO queue. An event-processing Lambda persists order and execution updates to Aurora.
Key architectural decisions
Bounded agent autonomy
Use model-driven research and proposals rather than direct model-to-broker execution. Human review reduces unchecked action risk, at the cost of a slower workflow and a required approval interface.
Relational source of truth
Use Aurora to preserve review and execution state instead of relying on transient agent context. This improves traceability and integrity but introduces schema, migration, and database-operating responsibilities.
Outbound broker integration
Use command and event FIFO queues rather than exposing the local gateway to inbound cloud traffic. A SQLite journal, durable event outbox, and local limits help manage retries; asynchronous execution adds reconciliation and connector availability concerns.
Serverless, modular delivery
Use Lambda containers, managed AI services, and Terraform stacks rather than maintaining an always-on application server. CloudWatch logs and optional Langfuse tracing support inspection. Invocation, model-token, embedding, and database costs still require measurement.
Infrastructure and operations
Terraform organizes the infrastructure into database, SageMaker, ingestion, agent, researcher, and frontend stacks. The repository includes dependency-aware deployment and teardown scripts, database migration and verification tooling, and focused tests for the order API, connector, and event processor. Database credentials are held in Secrets Manager; the connector's IAM policy is scoped to its queues. Always-on connector credentials still require IAM Roles Anywhere configuration.
Explore the system, agent, and data-flow architecture diagrams or review the relational data model.
04 / Outcome
From an idea to an inspectable system.
SideChart brings together an AWS-hosted research application, quantitative analysis, agent services, a durable approval and order model, and a queue-based broker connector. The repository documents the infrastructure, agent responsibilities, data relationships, deployment process, and execution safeguards. It provides an implementation that can be inspected and extended rather than a standalone model or architecture diagram.
The core implementation establishes a review-to-order contract and a separate paper-execution path. The current frontend, however, does not yet automatically persist complete review records or connect its legacy buy/sell controls to the approved-order API. Broker status and holdings also require integration with the persisted connector state. These are important boundaries of the delivered implementation, not claims of a fully validated end-to-end production trading service.
No trading-return, latency, availability, or operating-cost benchmark is claimed here. SideChart is a research and paper-trading project, not investment advice or a guarantee of performance.
In a system where AI-generated recommendations can lead to consequential actions, the architecture must make the authorization boundary as deliberate as the reasoning itself.
05 / Reflection
Design the boundaries before the autonomy.
SideChart reinforced a principle that extends beyond financial markets: agentic AI should not be evaluated solely by its ability to reason or invoke tools. The surrounding system must define what the agent is allowed to do, how a human exercises authority, how decisions are recorded, and how failures are contained.
The next phase is to close the remaining integration boundaries: implement application authentication and authorization, wire the review and order interfaces to Aurora, surface connector health and holdings from durable state, configure temporary connector credentials, and align the asynchronous agent workflow with the current schema. Paper-trading validation should cover restarts, duplicate delivery, partial fills, and event replay before any consideration of live execution.
I would also establish a repeatable evaluation suite for research quality, proposal consistency, execution-path reliability, latency, and cost per workflow. Those measures would help determine which architecture changes are justified rather than adding complexity for its own sake.
What began with an interest in algorithmic trading has become a practical exploration of a broader AI/ML architecture question: how to connect intelligent systems to real workflows while preserving human control, operational visibility, and accountable state.