- Technology Illumination
- Posts
- AI - Building a Real-Time FOREX Position Risk Manager with VLLM, AWS, and Bedrock
AI - Building a Real-Time FOREX Position Risk Manager with VLLM, AWS, and Bedrock
A behind-the-scenes look at how internal FOREX trading teams can use large language models (LLMs) to answer questions about customer onboarding, trades, and currency risk - served in real time using VLLM and AWS.
Introduction
A behind-the-scenes look at how internal FOREX trading teams can use large language models (LLMs) to answer questions about customer onboarding, trades, and currency risk — served in real time using VLLM and AWS.

What Kind of AI Agent Are We Building in This Post?
This blog post covers the foundation of a chat-based AI assistant for internal FOREX traders and operations teams.
Built to respond in real time to complex questions
Trained to understand user roles and limit access to only their assigned books and customers
Designed to extend easily into future voice input or document-based workflows
Operates within enterprise-grade security and latency requirements
This is not a general chatbot. It’s a task-specific, scoped, and high-performance agent for decision-makers in FOREX risk management.
Business Context
FOREX trading desks manage fast-moving, high-value currency trades across global markets. Each trader or operations user works on specific books and manages customers with different risk profiles, trade types, and compliance needs.
They need to:
Instantly access relevant data
Get summarized risk, exposure, and trade answers
Ask questions in natural language without learning a new interface
Only see the data they’re authorized for
Instead of clicking through dashboards or writing SQL queries, they simply ask:
“What’s my GBP/USD exposure today?”
“Did Cust104 complete onboarding for options?”
“Who added trades over $10M this morning?”
To enable this, we use LLMs deployed with VLLM for high-speed inference and AWS Bedrock for secure enterprise integrations.
Users
Trader
Responsible for managing positions, executing trades, and monitoring book-level performance.
Risk Analyst
Oversees overall exposure, compliance thresholds, market shifts, and forward-looking simulations.
Onboarding and Compliance Ops
Manages KYC, AML, and internal approval workflows for new or updated customers.
Their Needs
Trader Prompts (30+ Examples)
What’s my EUR/USD exposure today?
List customers trading USD/INR in the last 24 hours.
Show all spot trades over $10 million.
Did anyone open a GBP forward contract today?
Summarize book-level trade volume this week.
Which customers have unhedged positions?
What is my current margin requirement?
Show mark-to-market values by customer.
Who traded the most JPY options today?
Compare today’s exposure with yesterday’s.
Are all trades in the FX-G10 book within limits?
Show active positions set to expire this week.
Who has the largest risk in USD/CHF?
What is my unrealized gain or loss in FX-EM?
Which customers opened EUR/JPY trades?
Give me my top 5 risk contributors today.
Show new trades from Cust104.
List books where USD exposure increased.
Who placed the most leveraged trade today?
Did anyone trade during the Tokyo session?
What’s the average position size today?
Which book has the highest open interest?
Who added or closed positions today?
Compare FX-G10 and FX-EM performance.
What’s the total exposure to Latin American currencies?
Identify customers breaching internal risk policy.
Show my desk’s net exposure by currency.
Who canceled trades today?
Show open forward contracts by maturity.
List all options exercised today.
Risk Analyst Prompts (30+ Examples)
List customers over VAR threshold.
Show current exposure by trading desk.
Who’s carrying risk over the weekend?
Compare risk limits with actual exposure.
Who received a margin call today?
Summarize today’s risk alerts.
Show books with leverage > 5x.
Which currencies had the largest position delta?
Identify books impacted by USD volatility.
Show all positions tied to external events.
Which customers have highly correlated positions?
List trades triggering compliance warnings.
Who added high-risk exotic currency positions?
Show position decay trends over the last 7 days.
Which books would be affected by a Fed rate change?
What are the most volatile books right now?
Highlight trades not fully collateralized.
Identify risk clusters by customer type.
Show the delta of options by currency.
Forecast exposure in case of 100bps USD move.
Who is operating near their credit limit?
Are any VAR models out of tolerance?
Show drawdown trends by region.
Highlight suspicious trade patterns.
Show risk-weighted exposure by sector.
What would happen if EUR drops 2%?
Identify gaps in risk coverage.
Show customer concentration risk.
What’s the exposure to Chinese Yuan?
List traders with over-limit activity.
Onboarding and Compliance Ops Prompts (30+ Examples)
Who is pending onboarding?
Show onboarding timeline for Cust302.
Who passed AML but failed credit check?
List customers cleared for spot but not options.
Who has missing tax documentation?
Show onboarding SLAs per region.
List all KYC documents still pending.
Who was manually approved?
Which accounts are in review?
Show the average onboarding time.
List high-risk customers approved this week.
Identify duplicates in onboarding logs.
Who missed the onboarding deadline?
Which customers are waiting on legal review?
Show latest onboarding comments.
Who is cleared for forwards only?
Who failed sanction screening?
Show onboarding health by book.
List customers needing updated docs.
Show margin agreement status by customer.
Who is blocked from trading today?
Show onboarding dropouts.
List all customers in FX-G10 book with incomplete KYC.
Who had risk override approved manually?
Which customers were escalated to compliance?
Who is restricted to specific currency pairs?
Show approval workflow logs for Cust1005.
Identify customers without ID verification.
Show time to trade approval per customer.
List onboarding cases reopened after closure.
Tech Stack
Layer | Tools |
|---|---|
Auth & Roles | AWS Cognito |
API Gateway | Lambda + FastAPI |
LLM Inference | VLLM (on G5 spot) and AWS Bedrock |
Models | Claude, Titan, LLaMA, Mixtral, T5 |
Storage | S3 + Parquet + Athena |
Mapping | DynamoDB |
Caching | Redis (ElastiCache) |
Monitoring | CloudWatch + Prometheus |
Prompt Access Control
Each user’s JWT token includes:
{ "user_id": "trader_jane", "books": ["FOREX-G10", "FOREX-EM"], "customers":["Cust123", "Cust401"] }
The agent injects context automatically:
System prompt: You are assisting a FOREX trader responsible for FOREX-G10 and FOREX-EM books. Only use data for Cust123 and Cust401. User prompt: Show my currentEUR/CHF risk.
Cost Optimization Strategies
Component | Optimization |
|---|---|
GPU Hosting | G5 Spot with autoscaling |
Model Routing | Use Haiku/Titan for standard Q&A, Sonnet for heavy prompts |
RAG Indexing | Nightly refresh only |
Storage | S3 (Parquet) with Athena instead of Redshift |
Prompt Caching | Redis for high-frequency prompts |
Blog Post Value Proposition
This blog post helps you:
– Build a real-time chat-based assistant for FOREX trading desks
– Serve scoped LLM answers to hundreds of trader and ops queries
– Use VLLM and Bedrock to deliver fast, scalable responses
– Maintain strict access control at the prompt level
– Optimize cost using AWS-native strategies