Vertex Macro | Financial Cloud Cloud · Challenge
Weekend Productivity Challenge: Quant P&L Commander — An AI-Powered Trading Productivity Portal on AWS
Deployed App: https://vertexmacro.com/cloud_club/demo/dashboard/aws_quant_pnl_leaderboard_v3_english.html
GitHub Repository: https://github.com/dchan-dev/quant_pnl_leaderboard/tree/main
Project Type: Front-end productivity application with a React/TypeScript production path. The original HTML is the front-end prototype; main.tsx is the React logic layer for the production version.
Primary AWS Services: Kiro, Amazon S3, Amazon CloudFront, Amazon Route 53, AWS Certificate Manager, AWS WAF, Amazon MSK, AWS Lambda, Amazon S3 Versioning, Amazon CloudWatch, AWS IAM, AWS KMS, and Amazon Bedrock.
1. Vision & What the App Does
Quant P&L Commander is a personal AI-powered productivity tool for traders, portfolio managers, quant researchers, and risk managers who need to convert noisy trading performance data into clear daily action. In a trading firm, productivity is not just about finishing tasks faster; it is about making better decisions under time pressure. A trader has to know which strategy is making money, which strategy is hiding risk, which model is deteriorating, which position requires attention, and which capital allocation decision should be escalated before a small loss becomes a portfolio problem.
The application solves that workflow problem by turning trader-level CSV data into a single operational cockpit. From a user perspective, the portal provides a dark-mode institutional-style leaderboard that ranks strategies by NAV, daily return, Sharpe Ratio, Profit Factor, Win Rate, and Max Drawdown. It also provides expandable analysis panels with equity curves, drawdown waterlines, daily return bars, and risk-quality metrics such as Window Return, Realized Volatility, Calmar, VaR 95, Best Day, Worst Day, Win Rate, and Max Drawdown.
The productivity goal is simple: reduce the time between data arrival and decision. Instead of manually opening multiple CSV files, calculating risk metrics in spreadsheets, asking traders for screenshots, and manually writing end-of-day notes, the user opens one portal and can immediately answer:
● Which trader is leading by absolute return?
● Which strategy is best on a risk-adjusted basis?
● Which strategy has the worst drawdown pressure?
● Which strategy is making or losing money today?
● Is performance broad-based or dependent on one lucky day?
● Is a high Win Rate strategy hiding negative skew?
● Which strategy should be scaled, monitored, hedged, paused, or escalated?
The current deployed application demonstrates the front-end functionality through a live leaderboard view, search, sorting, market cards, SVG sparkline charts, expandable advanced analysis panels, and live-style updates. The production-ready design extends that front end with an AWS-native data architecture where each trader uploads or produces CSV files into Amazon S3, S3 Object Versioning preserves every historical revision, Amazon MSK streams file events and metric updates, AWS Lambda massages and normalizes the data, and the React app reads clean CSV-derived datasets from S3 through CloudFront.
The AI dimension is focused on professional productivity rather than entertainment. Amazon Bedrock is used in the production architecture to generate trader briefing summaries, anomaly explanations, drawdown narratives, and SOP-guided decision prompts. Kiro is used as the AI development environment to convert product intent into specs, implementation tasks, acceptance criteria, React components, Lambda handlers, data contracts, test cases, and operational runbooks.
2. Why This Is a Productivity App
The challenge asks for a personal AI-powered productivity tool. Quant P&L Commander qualifies because it improves a knowledge worker's daily operational productivity. The target knowledge worker is a trader or portfolio manager. Their productivity problem is decision friction: too much data, too many metrics, too many strategies, and too little time.
The application improves productivity in five concrete ways:
- Prioritization: The leaderboard tells the user which trader, strategy, or risk item deserves attention first.
- Summarization: The analytics panel compresses raw time-series CSV data into actionable risk and performance metrics.
- Decision support: AI-generated briefing text explains why a trader is up or down, what risk dimensions changed, and what the next action should be.
- Repeatable SOP execution: The portal maps directly to a trading SOP: pre-market review, intraday monitoring, end-of-day attribution, and escalation.
- Reduced manual work: Lambda transforms raw CSV data into normalized front-end datasets, avoiding manual spreadsheet calculations and manual copy/paste reporting.
In productivity terms, this is similar to a sophisticated meeting-prep tool or task prioritizer, except the domain is financial trading operations. It helps the user prepare for morning risk meetings, prioritize intraday problems, and generate end-of-day explanations.
3. User Experience Walkthrough
A typical user journey looks like this:
- The trader opens the CloudFront-hosted React application through the Route 53 domain.
- The top bar shows the workspace name, asset workflow labels, and a live timestamp.
- The summary strip shows Participants, Best Sharpe, Average Win Rate, Best NAV, and RFQ status.
- Market cards provide a quick cross-asset context view for ES, CL, GC, and BTC.
- The user sorts the leaderboard by
DAILYto identify intraday outliers. - The user searches for
Crypto,Macro,Rates, or a trader name to narrow investigation. - The user clicks
ANALYSISto inspect a trader's equity curve, risk metrics, drawdown, and return distribution. - The AI assistant panel, powered by Amazon Bedrock in the production plan, summarizes the strategy status:
● “Lucia Fernandez has the highest Sharpe Ratio, but drawdown should be checked before capital increase.”
● “Carmen Lopez shows positive NAV but negative daily return; review volatility carry exposure and worst-day risk.”
● “Laura Navarro has lower NAV and negative skew; keep under watch until Profit Factor improves.”
- The user exports or copies an EOD review note generated from the same metrics.
The key point is that the application is not only a dashboard. It is a productivity layer on top of trading data. It supports repeatable decisions.
4. Core Portal Elements and Trading Productivity Value
The portal UI is intentionally designed around a professional trading workflow.
4.1 Top Bar and Live Clock
The top bar confirms the user is in the correct workspace: CME DIRECT STYLE QUANT BOARD, with FUTURES / OPTIONS / BLOCKS / RFQ / P&L ANALYTICS. The live timestamp matters because trading data expires quickly. If the timestamp is stale, the trader should not rely on rankings for capital allocation or risk reduction.
4.2 Hero Section
The hero banner explains the mission: AWS Quant Trading Masters P&L Leaderboard. The keywords FUTURES, OPTIONS, BLOCKS, RFQ, and LIVE NAV indicate that the application is built for institutional workflow thinking. The productivity benefit is context: users know this portal is not a generic leaderboard; it is a trading operations cockpit.
4.3 Summary Stats
The summary stats strip gives immediate desk-level health:
● Participants: confirms how many strategies are in the comparison set.
● Best Sharpe: identifies the strongest risk-adjusted strategy.
● Average Win Rate: indicates whether the overall environment is favorable.
● Best NAV: shows absolute return leadership.
● Workspace RFQ ON: reminds users that larger trades require execution discipline.
4.4 Market Snapshot Cards
ES, CL, GC, and BTC provide cross-asset context. A crypto strategy making money while BTC rallies may be beta, not alpha. A macro strategy performing well during equity weakness and gold strength may be correctly positioned defensively. The market cards help the user avoid false conclusions.
4.5 Search and Sorting
The search box allows quick investigation by trader name or strategy type. Sorting by NAV, Daily, SR, PF, WR, and Max DD converts the same dataset into multiple operational views:
● NAV: absolute performance.
● DAILY: intraday triage.
● SR: risk-adjusted quality.
● PF: payoff efficiency.
● WR: signal hit rate.
● MAX DD: capital preservation and risk pressure.
4.6 Advanced Analysis
The advanced panel is where the productivity value becomes strongest. It explains the why behind the ranking. The equity curve shows compounding quality. The drawdown waterline shows capital pain. The return bars show whether P&L is consistent or dominated by outliers. The metric grid summarizes quality, tail loss, and volatility.
5. SOP Embedded in the Product
The trading SOP behind the application is a major part of the value. The portal is used as a professional P&L control tower. The leaderboard identifies where attention should go; the advanced analytics explain why performance happened; the SOP converts observations into disciplined actions.
5.1 Pre-Market SOP
Before trading begins, the user should:
- Verify the portal timestamp.
- Review Participants, Best Sharpe, Average Win Rate, Best NAV, and RFQ status.
- Review market cards for ES, CL, GC, and BTC.
- Sort by Max DD to identify vulnerable strategies.
- Sort by Sharpe Ratio to identify high-quality strategies.
- Sort by NAV to identify top contributors.
- Open Analysis for strategies with large drawdown, large daily moves, strong NAV with weak risk metrics, or weak NAV with improving quality.
- Set the day’s posture: normal risk, reduced risk, hedge required, strategy paused, or manual approval required.
5.2 Intraday SOP
During the trading day, the user should:
- Sort by Daily.
- Review top positive and negative movers.
- Compare P&L with market cards.
- Open Analysis for outliers.
- Determine whether losses are due to market move, factor shock, liquidity, model failure, or execution issue.
- Decide: continue, monitor, reduce size, hedge, stop new orders, flatten, or escalate.
5.3 End-of-Day SOP
At the end of day, the user should:
- Confirm final timestamp.
- Sort by NAV, Daily, SR, PF, WR, and Max DD.
- Open Analysis for top contributor, worst detractor, drawdown warnings, and capital-increase candidates.
- Generate EOD attribution.
- Record next-day watch list.
5.4 Detailed SOP: Operating the Portal as a Daily Productivity System
The application is most valuable when it is used with a consistent operating rhythm. In production, Quant P&L Commander is not intended to be opened only when something goes wrong. It is intended to become the first screen a trader, portfolio manager, or risk manager checks when starting the day, reviewing intraday performance, preparing for a risk meeting, or writing an end-of-day note.
The SOP has three layers:
- Observation layer: read the portal without taking action. Confirm data freshness, market context, and ranking changes.
- Diagnosis layer: open the relevant Analysis panel and interpret NAV, Daily P&L, Sharpe Ratio, Profit Factor, Win Rate, Max Drawdown, Calmar, VaR, equity curve, drawdown waterline, and return bars.
- Action layer: decide whether the correct next step is continue, monitor, reduce size, hedge, pause, escalate, or request a model/execution review.
This is why the portal improves productivity. It turns ad hoc trading desk conversations into a repeatable workflow with consistent inputs, consistent diagnostic rules, and consistent outputs.
5.5 SOP: Data Freshness and Trust Check
Before using any number on the portal, the user performs a trust check:
1. Confirm the LIVE timestamp is current.
2. Confirm the expected trader count appears in Participants.
3. Confirm the processed dataset has today's asOf time.
4. Confirm no trader CSV upload failed schema validation.
5. Confirm CloudWatch has no active data freshness alarm.
6. Confirm S3 data object version is the latest approved version.
7. If the portal data is stale, do not use it for risk decisions.
In the AWS production architecture, this check is supported by S3 object version metadata, Lambda validation output, MSK processing events, CloudWatch alarms, and the front-end as-of timestamp. If any component indicates stale or invalid data, the AI assistant is required to say: Data is incomplete or stale. Human review required.
5.6 SOP: Reading the Leaderboard Correctly
The leaderboard must never be interpreted as a simple scoreboard. Each sort control answers a different operational question:
● NAV: Who contributed the most absolute return?
● DAILY: Who needs intraday attention right now?
● SR: Who is producing the best volatility-adjusted return?
● PF: Who has the best gross profit versus gross loss profile?
● WR: Who has the highest hit rate?
● MAX DD: Who is consuming the most drawdown budget?
The professional workflow is to rotate through multiple rankings before making a decision:
Step 1: Sort by DAILY to identify immediate outliers.
Step 2: Sort by MAX DD to find risk pressure.
Step 3: Sort by SR to identify high-quality performers.
Step 4: Sort by PF to check payoff efficiency.
Step 5: Sort by WR to check hit-rate consistency.
Step 6: Sort by NAV only after risk quality has been reviewed.
This prevents a common mistake: rewarding the highest NAV strategy even when that P&L was purchased with excessive leverage, tail risk, or poor liquidity.
5.7 SOP: Advanced Analysis Panel Review
Every capital allocation decision must open the ANALYSIS panel first. The panel review sequence is:
1. Read the strategy name and confirm the expected payoff profile.
2. Review Equity Curve / NAV Path.
3. Review Risk & Quality Metrics.
4. Review Drawdown Waterline.
5. Review Daily P&L Distribution.
6. Compare the result with market cards.
7. Choose a next action.
The interpretation rules are:
● Smooth equity curve + low drawdown + stable Sharpe: potential capital increase candidate.
● High NAV + high Max DD + weak Calmar: do not increase capital; investigate risk sizing.
● High Win Rate + low Profit Factor: hidden tail risk; review stop-loss and downside skew.
● Low Win Rate + high Profit Factor: possible convex strategy; tolerate lower hit rate if drawdown is controlled.
● Large Worst Day + worsening VaR: review leverage, liquidity, and hedge needs.
● Flat NAV + low volatility: potentially under-allocated or low-opportunity regime.
● Falling NAV + rising drawdown: reduce risk or pause pending review.
5.8 SOP: Problem-Solving Playbooks
The portal directly supports problem solving. The AI assistant uses the same playbooks to generate structured recommendations.
Playbook 1: A Strategy Is Losing Money Today
Trigger:
Daily P&L is negative beyond the expected range or the row flashes red repeatedly.
Portal steps:
1. Sort by DAILY.
2. Identify the largest negative movers.
3. Open ANALYSIS for the affected strategy.
4. Check whether the equity curve shows normal pullback or structural break.
5. Check whether drawdown is near prior maximum.
6. Check daily return bars for an outlier loss.
7. Compare the strategy against ES, CL, GC, and BTC market cards.
8. Classify the issue: market regime, signal, execution, sizing, liquidity, or data.
Action:
- If within expected range: monitor.
- If abnormal but explainable: reduce size or hedge.
- If unexplained: stop new risk and investigate data/execution.
- If hard limit is breached: escalate to PM/risk.
Playbook 2: Top NAV Looks Too Good
Trigger:
A strategy ranks first by NAV but has suspicious risk metrics.
Portal steps:
1. Sort by NAV.
2. Open ANALYSIS for the top strategy.
3. Compare Window Return with Best Day.
4. Check Max DD, VaR 95, Worst Day, and Calmar.
5. Review whether the equity curve depends on one large jump.
6. Check skew and return-bar distribution.
Action:
- Strong NAV plus strong Calmar: eligible for gradual capital increase.
- Strong NAV plus severe drawdown: freeze scaling and review leverage.
- Strong NAV from one outlier day: require more observation.
- Strong NAV with negative skew: require hedge or lower risk budget.
Playbook 3: Multiple Strategies Draw Down Together
Trigger:
Several strategies show drawdown pressure at the same time.
Portal steps:
1. Sort by MAX DD.
2. Open ANALYSIS for all high-drawdown strategies.
3. Compare strategy types.
4. Compare each strategy against market cards.
5. Identify common factor exposure: equity beta, crypto beta, rates duration, USD exposure, commodity trend, volatility short exposure.
6. Check whether drawdown is isolated or systemic.
Action:
- If systemic: reduce gross exposure or add portfolio hedge.
- If isolated: review the specific strategy owner and model.
- If caused by data issue: freeze decisions until data is corrected.
Playbook 4: High Win Rate but Weak P&L
Trigger:
A strategy ranks high by WR but low by NAV or PF.
Portal steps:
1. Sort by WR.
2. Identify high hit-rate strategies with low NAV or poor PF.
3. Open ANALYSIS.
4. Check Worst Day, drawdown, and return bars.
5. Determine whether many small wins are being offset by rare large losses.
Action:
- Improve stop logic.
- Reduce position size when volatility rises.
- Add regime filters.
- Review whether strategy is short volatility or short liquidity.
Playbook 5: Good Sharpe but Low NAV
Trigger:
A strategy ranks high by SR but low by NAV.
Portal steps:
1. Sort by SR.
2. Identify high-quality but low-return strategies.
3. Open ANALYSIS.
4. Check volatility, drawdown, and consistency.
5. Confirm execution capacity and market depth.
Action:
- If scalable: consider gradual capital increase.
- If not scalable: preserve allocation but do not force size.
- Monitor whether Sharpe decays after any size increase.
5.9 SOP: P&L Improvement Framework
The portal improves P&L by helping the user classify what kind of problem exists. The classification rules are:
NAV down + SR down + PF down
= strategy quality deterioration. Review model assumptions.
NAV down + SR stable
= possible temporary adverse regime. Monitor before changing model.
NAV up + Max DD up
= returns may be driven by excess leverage or concentration.
WR high + PF low
= loss size problem. Improve exits, stops, or sizing.
PF high + WR low
= convex profile. Check patience, liquidity, and drawdown tolerance.
Calmar down + Realized Vol up
= drawdown efficiency deterioration. Rebalance risk.
VaR worse + Worst Day worse
= tail risk increasing. Reduce leverage or add hedge.
This framework gives the AI assistant a deterministic logic base. The AI does not have to invent advice. It maps measured conditions to SOP-defined actions.
5.10 SOP: Capital Allocation Decision Record
Any change to capital allocation should produce a decision record. In production, this can be generated by Lambda and Amazon Bedrock, then stored as an S3 object under the AI briefing folder with S3 Versioning enabled.
Capital Allocation Decision Record
Date:
Dataset asOf:
S3 source version:
Trader:
Strategy:
Current NAV:
Daily P&L:
Sharpe Ratio:
Profit Factor:
Win Rate:
Max Drawdown:
Calmar:
VaR 95:
Decision: increase / maintain / reduce / hedge / pause / escalate
Reason:
Risk flags:
Required approval:
Next review time:
Human owner:
This record is important because trading productivity is not just decision speed. It is also decision auditability.
5.11 SOP: Role-Based Daily Use
The same portal supports multiple user roles.
Trader
● Starts the day by checking own strategy row.
● Explains daily P&L movements using market cards and analysis panel.
● Uses drawdown and return bars to decide whether to continue, reduce, or pause new entries.
● Escalates unexplained losses immediately.
Portfolio Manager
● Reviews the whole leaderboard by NAV, SR, PF, and Max DD.
● Compares risk-adjusted contribution across strategies.
● Decides capital increase, reduction, hedge, or pause.
● Uses AI-generated summaries to prepare PM meeting notes.
Risk Manager
● Sorts by Max DD first.
● Reviews VaR 95, Worst Day, Realized Vol, and Calmar.
● Checks whether drawdown is isolated or correlated across strategies.
● Enforces stop-trading or escalation thresholds.
Quant Researcher
● Reviews falling Sharpe, falling PF, or worsening skew.
● Uses return bars to detect model decay or regime mismatch.
● Converts repeated loss patterns into model improvement tasks.
● Uses Kiro to transform findings into engineering specs and tests.
Execution Trader
● Uses market cards and RFQ labels to evaluate whether order size fits market depth.
● Investigates slippage when P&L differs from expected signal performance.
● Recommends screen execution, block execution, RFQ workflow, or reduced participation rate.
5.12 SOP: AI Assistant Output Rules
The AI assistant is guided by strict output rules:
1. Use only portal metrics and approved CSV-derived data.
2. Do not invent trades, prices, counterparties, or exposures.
3. Do not recommend direct trade execution.
4. Provide operational options only: continue, monitor, reduce, hedge, pause, escalate, investigate.
5. Always include confidence level.
6. Always flag stale or incomplete data.
7. Always identify whether the issue appears to be signal, execution, sizing, market regime, or data quality.
8. Always require human review for capital changes.
Example AI output:
{
"status": "review_required",
"summary": "The strategy has positive total NAV but today's P&L is negative and Max DD is elevated. Review whether the loss is consistent with the current market regime before adding capital.",
"diagnosis": ["daily_loss", "drawdown_pressure", "capital_increase_not_approved"],
"suggested_actions": ["open_analysis", "compare_market_cards", "review_worst_day", "monitor_or_reduce_size"],
"human_review_required": true
}
5.13 SOP: Production Control Loop on AWS
The SOP is implemented as a production control loop across AWS services:
1. Trader CSV arrives in Amazon S3.
2. S3 ObjectCreated event starts Lambda validation.
3. Lambda validates schema and records object version.
4. Lambda publishes processing event to Amazon MSK.
5. Metric Lambda calculates NAV, Daily, SR, PF, WR, Max DD, Calmar, VaR, and drawdown series.
6. Processed data is written back to S3.
7. Bedrock receives structured metrics and SOP context.
8. Bedrock returns AI briefing JSON.
9. React portal reads processed data through CloudFront.
10. User makes a documented decision.
11. Decision record is stored back to S3 for audit.
This loop connects productivity, AI, and AWS operations into one system. The portal is not merely a visualization layer; it is the user interface for a governed AWS event-processing pipeline.
6. How I Built It
6.1 Development Method with Kiro
I used Kiro as the AI development partner for spec-driven development. My Kiro workflow was:
- Define product intent: Build an AI-powered productivity portal for trader P&L prioritization.
- Create feature specs: leaderboard, search, sorting, metric grid, SVG charts, data contracts, Lambda processing, and S3 delivery.
- Generate implementation tasks: HTML prototype first, then React
main.tsxlogic, then AWS deployment architecture. - Use acceptance criteria: no Chinese text, responsive layout, every metric visible, advanced panel expandable, AWS deployment path documented.
- Refactor toward production: separate UI state, data model, chart functions, metric calculations, and service integration boundaries.
- Create SOP feedback loop: make sure the UI reflects the actual trader operating procedure.
Kiro was especially useful for converting vague product requirements into concrete engineering artifacts. For example, “improve P&L” became measurable UI behaviors: sort by Max DD, identify falling Profit Factor, check Calmar, compare NAV with drawdown, and generate AI commentary.
6.2 Front-End Build
The first version is a single-page HTML application to make the challenge submission easy to access. The production path is React with TypeScript, where main.tsx owns the application logic:
● state for trader data,
● state for sort key,
● state for search query,
● state for expanded analysis rows,
● metric calculation helpers,
● chart rendering helpers,
● data loading from S3-hosted CSV/JSON files,
● AI summary rendering,
● error/loading states.
The current HTML prototype includes in-browser metric calculations and SVG chart generation. In production, the heavier normalization work is moved out of the browser into AWS Lambda so the front end remains fast, predictable, and easy to cache through CloudFront.
6.3 Key Design Decisions
Decision 1: Static front end, dynamic data.
The React application is deployed as static assets to Amazon S3 and distributed through CloudFront. Data remains dynamic because CSV files are updated in S3 and transformed by Lambda.
Decision 2: CSV-first data contract.
CSV is intentionally used because trading teams frequently exchange P&L data through CSV exports. A production-grade system should not force users to abandon existing operational workflows on day one.
Decision 3: S3 Object Versioning for auditability.
Each trader’s CSV files are stored with versioning enabled. If a trader uploads a corrected file, the prior version remains available for audit, replay, and incident review.
Decision 4: MSK for streaming events.
Amazon MSK is used for event streaming so the application can handle a production path where new P&L records, file-arrival events, metric recalculation events, anomaly events, and AI-summary events are processed asynchronously.
Decision 5: Lambda for data massage.
AWS Lambda normalizes CSV files, validates schemas, calculates derived metrics, and publishes clean front-end datasets back to S3.
Decision 6: AI explanations are generated after metrics are calculated.
The model should not invent metrics. Lambda calculates deterministic values first. Amazon Bedrock receives structured metric context and generates explanations, priority notes, and SOP-aligned operational suggestions.
7. AWS Services Used / Architecture Overview
7.1 Amazon S3
Amazon S3 is used in three ways:
- React static hosting origin: stores compiled React assets from Vite or another front-end build process.
- Trader CSV landing zone: stores raw CSV files for each trader or strategy.
- Processed data zone: stores normalized CSV/JSON files consumed by the front end.
Recommended bucket layout:
s3://qplc-frontend-prod/
index.html
assets/
manifest.json
s3://qplc-data-prod/
raw/trader_id=sofia-garcia/nav_2026-07-13.csv
raw/trader_id=lucia-fernandez/nav_2026-07-13.csv
processed/leaderboard/current/leaderboard.csv
processed/leaderboard/current/leaderboard.json
processed/trader/sofia-garcia/metrics.json
processed/trader/lucia-fernandez/metrics.json
ai/briefings/daily/2026-07-13.json
S3 Object Versioning is enabled on the data bucket. This is critical for professional trading operations because P&L numbers may be corrected after settlement, corporate actions, late fills, fee adjustments, or model reconciliation. Versioning allows replay and audit.
7.2 Amazon CloudFront
CloudFront distributes the React application globally with low latency. It also provides cache behavior control:
● long TTL for hashed JavaScript/CSS assets,
● short TTL or no-cache policy for leaderboard.json,
● custom error handling to serve index.html for client-side routing,
● origin access control so users cannot bypass CloudFront and directly hit the S3 origin.
7.3 Amazon Route 53
Route 53 manages the custom domain. The project link is served under a clean domain path. In production, Route 53 points to the CloudFront distribution using an alias record.
7.4 AWS Certificate Manager
AWS Certificate Manager provides TLS certificates for the CloudFront distribution. This ensures the application is served over HTTPS.
7.5 AWS WAF
AWS WAF protects the CloudFront distribution. Recommended rules include:
● AWS Managed Rules Common Rule Set,
● rate-based rules,
● IP reputation list,
● bot control or challenge rules if abuse appears,
● geo restrictions if the portal is internal to certain regions.
7.6 Amazon MSK
Amazon MSK is the streaming backbone. It decouples producers and consumers:
● S3 file-arrival events become csv_file_received messages.
● Lambda data-massage completion becomes metrics_calculated messages.
● AI summary completion becomes briefing_generated messages.
● Front-end manifest updates become frontend_dataset_ready messages.
Example topic design:
qplc.csv.received.v1
qplc.csv.validation_failed.v1
qplc.metrics.calculated.v1
qplc.ai.briefing_requested.v1
qplc.ai.briefing_generated.v1
qplc.frontend.dataset_ready.v1
MSK is useful because production trading data rarely moves as a single synchronous request. Files arrive at different times, traders may revise files, and risk systems may need to replay events. Kafka-style topics make the solution resilient and extensible.
7.7 AWS Lambda
Lambda is responsible for data massage and event processing. It handles:
● CSV parsing,
● schema validation,
● column normalization,
● date parsing,
● NAV calculation,
● daily return calculation,
● Sharpe Ratio calculation,
● Profit Factor calculation,
● Win Rate calculation,
● Max Drawdown calculation,
● Realized Volatility calculation,
● VaR 95 calculation,
● Calmar calculation,
● anomaly flag generation,
● processed dataset writing,
● AI summary prompt construction.
A simplified Lambda pipeline:
Raw CSV in S3
-> S3 event notification
-> Lambda CSV intake
-> publish event to MSK
-> Lambda metric processor
-> write processed JSON/CSV to S3
-> Lambda AI briefing request
-> Amazon Bedrock summary
-> write AI briefing JSON to S3
-> front end reads latest dataset through CloudFront
7.8 Amazon Bedrock
Amazon Bedrock is used for AI productivity features. The model receives structured JSON, not raw uncontrolled data. The prompt includes:
● current strategy metrics,
● previous strategy metrics,
● recent drawdown behavior,
● daily return distribution,
● SOP rules,
● user role context,
● allowed output format.
AI outputs include:
● morning desk briefing,
● intraday anomaly explanation,
● end-of-day attribution draft,
● capital allocation watchlist,
● risk escalation summary,
● trader-specific productivity recommendations.
7.9 CloudWatch
CloudWatch collects Lambda logs, error rates, duration, throttles, and custom metrics. Example custom metrics:
● number of CSV files processed,
● number of validation failures,
● number of trader datasets updated,
● metric calculation latency,
● AI briefing generation latency,
● stale data age,
● front-end dataset version.
7.10 IAM and KMS
IAM is used to enforce least privilege across Lambda, S3, MSK, and Bedrock. KMS encrypts S3 objects, Lambda environment variables, and MSK data as appropriate.
8. Architecture Diagram
The system starts with a Trader / CSV Producer who uploads a trader CSV file into an Amazon S3 Raw CSV Bucket.
The Amazon S3 Raw CSV Bucket triggers an ObjectCreated event to AWS Lambda CSV Intake.
AWS Lambda CSV Intake validates the uploaded file. It checks the filename, CSV schema, and trader ID.
After validation, AWS Lambda CSV Intake publishes a csv_file_received event to Amazon MSK Topics.
Amazon MSK Topics send the event to AWS Lambda Metric Processor.
AWS Lambda Metric Processor reads the versioned CSV object from the Amazon S3 Raw CSV Bucket.
AWS Lambda Metric Processor normalizes the CSV data and calculates NAV and risk metrics.
The calculated metrics include leaderboard data, trader metrics, NAV, P&L, and risk analytics.
AWS Lambda Metric Processor sends the structured metrics to Amazon Bedrock.
Amazon Bedrock generates an SOP-based AI briefing.
Amazon Bedrock returns a summary and action recommendations back to AWS Lambda Metric Processor.
AWS Lambda Metric Processor writes the processed output files into an Amazon S3 Processed Dataset Bucket.
The processed output files are:
● leaderboard.json
● metrics.json
● ai_briefing.json
The React P&L Portal requests the frontend application and current datasets through Amazon CloudFront.
Amazon CloudFront serves the React application to the React P&L Portal.
When cached data expires, Amazon CloudFront fetches the latest processed data from the Amazon S3 Processed Dataset Bucket.
Amazon CloudFront returns cached React assets and processed data back to the React P&L Portal.
The React P&L Portal displays the P&L leaderboard, trader analytics, risk metrics, and AI briefing to the user.
9. Data Model and CSV Processing
A production CSV format should be strict enough to validate but simple enough for traders to produce.
9.1 Example Raw Trader CSV
trade_date,trader_id,strategy,nav,daily_pnl,gross_profit,gross_loss,market_value,exposure,notes
2026-07-13,sofia-garcia,Cross-Asset Convex Macro Alpha,118.40,0.42,15400,-7200,250000,0.82,normal session
2026-07-13,lucia-fernandez,Crypto Momentum Rotation,116.90,0.88,18100,-9100,210000,1.05,btc momentum
9.2 Lambda Normalization Rules
Lambda applies these rules:
● required columns must exist,
● trade_date must parse to ISO date,
● trader_id must match approved trader registry,
● numeric fields must be parseable,
● nav must be positive,
● duplicate date/trader rows are rejected or versioned,
● missing optional fields are defaulted,
● raw object version ID is recorded,
● processed dataset includes lineage metadata.
9.3 Output JSON for React
{
"asOf": "2026-07-13T09:30:00+08:00",
"sourceVersion": "3LgH4...",
"participants": 8,
"rows": [
{
"name": "Sofia Garcia",
"strategy": "Cross-Asset Convex Macro Alpha",
"nav": 18.4,
"daily": 0.42,
"sr": 0.73,
"pf": 1.8,
"wr": 58,
"skew": 0.44,
"dd": 18,
"series": [100, 101, 100.7, 102.2, 104, 103.2, 105.7, 106.1, 108, 109.8, 111, 112.4, 114.9, 116.2, 118.4]
}
]
}
10. AI Development Details
The AI layer is intentionally designed as an assistant, not as an autonomous trader. It improves human productivity by explaining metrics, prioritizing review items, and drafting structured summaries.
10.1 AI Use Cases
- Morning Briefing Generator
Produces a concise pre-market note: top NAV, best Sharpe, worst drawdown, strategies to watch, and missing data. - Intraday Anomaly Explainer
Explains why a strategy with large negative daily P&L should be reviewed. The model receives market context, strategy type, and metric changes. - End-of-Day Attribution Draft
Drafts a structured EOD note summarizing contributors, detractors, risk changes, and next-day watchlist. - SOP-Guided Decision Prompt
Converts portal metrics into actions such as monitor, reduce, hedge, pause, or escalate. - Developer Productivity with Kiro
Kiro helps generate specs, tasks, unit test cases, React components, Lambda handlers, code review checklists, and deployment runbooks.
10.2 Prompt Contract
The model prompt should be deterministic and bounded:
You are a trading productivity assistant. Use only the structured metrics provided.
Do not invent trades, prices, or exposures.
Return JSON with: summary, risk_flags, possible_causes, suggested_actions, confidence, required_human_review.
If data is stale or incomplete, say so.
Never recommend direct trade execution.
10.3 Bedrock Output Example
{
"summary": "Lucia Fernandez leads on Sharpe Ratio and daily return, but crypto beta should be separated from true alpha before increasing capital.",
"risk_flags": ["High crypto sensitivity", "Drawdown check required"],
"possible_causes": ["BTC momentum tailwind", "Momentum strategy aligned with current regime"],
"suggested_actions": ["Open advanced analysis", "Compare NAV gain against BTC market card", "Check Max DD before capital increase"],
"confidence": "medium",
"required_human_review": true
}
10.4 AI Safety and Governance
Because this is a trading productivity tool, AI output must be controlled:
● AI does not place trades.
● AI does not create unauthorized investment advice.
● AI only summarizes provided metrics.
● AI output includes confidence and human-review flags.
● AI prompt and response are logged for audit.
● Bedrock calls are wrapped by Lambda guardrails.
● IAM restricts who can request AI summaries.
● Sensitive data can be redacted before model invocation.
11. Security and Production Readiness
A production-ready trading application needs more than a nice UI.
11.1 Network and Edge Security
● CloudFront is the only public entry point.
● S3 origins are private through Origin Access Control.
● AWS WAF protects the edge.
● ACM enforces HTTPS.
● Route 53 controls DNS.
11.2 Data Security
● S3 buckets use server-side encryption with AWS KMS.
● S3 Object Versioning preserves audit history.
● S3 Block Public Access is enabled except where public website hosting is explicitly required; production should prefer private S3 behind CloudFront.
● IAM policies are least privilege.
● Lambda roles can read only required prefixes.
11.3 Operational Reliability
● Lambda writes idempotent processed outputs.
● Processed dataset includes asOf and sourceVersion.
● CloudFront cache policies prevent stale critical data.
● CloudWatch alarms monitor data freshness and Lambda failures.
● Dead-letter queues can be added for failed event processing.
● MSK topics allow replay of processing events.
11.4 Auditability
For trading environments, auditability is a requirement:
● raw CSV version ID,
● processed dataset version,
● metric calculation timestamp,
● Lambda request ID,
● AI prompt version,
● AI model response ID,
● user-facing dataset version.
This makes it possible to answer: “Which exact file version generated the P&L number shown on the portal?”
12. Challenges Encountered and How I Overcame Them
Challenge 1: Making a Trading Dashboard Fit a Productivity Challenge
The challenge prompt emphasizes productivity tools. A P&L leaderboard could look like a finance dashboard unless the workflow is clear. I solved this by making the portal SOP-driven. Every UI feature maps to a productivity action: prioritize, summarize, investigate, document, or escalate.
Challenge 2: Keeping the Front End Simple
The original app is a single HTML file. That makes it easy to deploy and review, but production applications need maintainable logic. I separated the future production direction into React main.tsx logic, reusable metric functions, and AWS-hosted datasets.
Challenge 3: Handling CSV Without Making the Browser Heavy
CSV parsing and metric calculation can be done in the browser for a demo, but production should not depend on every user recalculating metrics locally. The solution is Lambda data massage. The browser reads already-normalized JSON or CSV from S3.
Challenge 4: AI Must Be Useful but Controlled
AI can generate helpful summaries, but in a trading context it must not hallucinate trades or give unauthorized instructions. The production design uses structured prompts, deterministic metric input, guardrails, audit logging, and human-review flags.
Challenge 5: Stale Data Risk
A beautiful dashboard is dangerous if data is stale. The production architecture includes asOf timestamps, processed dataset versioning, CloudWatch freshness alarms, and front-end stale-data warnings.
13. What I Learned
AI productivity is strongest when it is attached to a real workflow. A generic chatbot is less valuable than an assistant that understands the user’s SOP, data structure, and decision process.
Static front ends on AWS can still support serious production workflows. Amazon S3 and CloudFront are excellent for a React application, while Lambda, MSK, and S3 data buckets provide dynamic behavior behind the scenes.
CSV remains important. Many production teams still exchange operational data through CSV files. Building around CSV does not mean the architecture is immature; with S3 Versioning, Lambda validation, and MSK eventing, CSV can become a governed data input.
Kiro helps turn product ambiguity into engineering structure. It is especially useful when the project requires both product thinking and implementation detail: UI, data model, AWS architecture, AI prompts, security, and operational SOP.
AI in financial productivity tools needs strong boundaries. The correct role for the AI assistant is to summarize, prioritize, explain, and recommend review actions. It should not replace risk approval, portfolio mandate, or execution control.