AWS re:Invent Recap

Trading Innovation: Jefferies' AI Assistant on Amazon Bedrock (IND3315)

Recap Series

Session Notes

Trading innovation: Jefferies' AI assistant on Amazon Bedrock

Introduction

  • Building a Trade Assistant Agent on AWS to Solve Front Office Data Challenges
  • Aimed at solving the problem of accessing and analyzing large data volumes for trading.
  • Jefferies and AWS Partnership
  • Jefferies: 60-year-old full-service investment bank with a "clients first always" motto.
  • Mission: Help clients achieve maximum potential in trading, investment banking, and analytics.
  • AWS partnership is crucial for driving continuous innovation.
  • Cloud-native solutions across Jefferies, including fixed income algorithmic trading platform and equity trading options.
  • Introduction of Jeff AI, an enterprise-grade AI platform for generative and agent AI.
  • Jeff AI supports smart retrieval, document summarization, and automated workflows.

Global Algorithmic Suite Jefferies

  • Electronic trading algorithms and services offered by the investment bank Jefferies to its institutional clients.
  • Automate trading strategies and help clients execute large orders efficiently while minimizing market impact.
  • Algorithms
  • VWAP (Volume-Weighted Average Price): A strategy to execute a trade in line with the average market price weighted by volume over a user-defined period.
  • VOLUME (Volume Participation): An algorithm designed to participate in the market in proportion to the real-time market volume.
  • STRIKE (Implementation Shortfall strategy): A strategy focused on minimizing the difference between the desired execution price (at order entry time) and the actual executed price.
  • SEEK (Smart-routing liquidity finder): A smart order router that searches for liquidity across both lit (displayed) and dark (non-displayed) trading venues.
  • MultiScale: Allows traders a high degree of control over executions and responsiveness to market volatility.
  • Trader: Provides enhanced control and the ability to switch strategies in response to market events and liquidity situations.
  • Panel: Another proprietary algorithm offered within the suite.
  • Blitz: An execution strategy, likely focused on speed.
  • DarkSeek: A specific version of the SEEK algorithm optimized for dark pools of liquidity.
  • Finale: Likely an end-of-day execution algorithm.
  • Opener: Likely a market-open execution algorithm.
  • Pairs: Algorithms for pairs trading strategies, with variations like "Net Returns," "Ratio," and "Risk Arb".
  • Patience: An algorithm likely designed for less aggressive execution, waiting for favorable market conditions.
  • Portfolio: Designed for executing larger, multi-stock orders efficiently.
  • Post: Likely an algorithm for trading after the main market closes.
  • TWAP (Time-Weighted Average Price): A strategy to execute orders evenly over a specified period to minimize market impact.

Smart Order Router (SOR)

  • Jefferies employs Smart Order Router (SOR) with Automated Order Processing (AOP) system
  • Analyzes real-time market data, liquidity, and prices for optimal execution
  • Slices large orders and routes them dynamically across lit and dark venues
  • Minimizes market impact and allows client control over preferred/excluded venues
  • Utilizes conditional order negotiation on Alternative Trading Systems (ATS) for better matches
  • Core strategy for achieving "best execution"
  • Key Functions of Jefferies' SOR
  • Accesses Liquidity: Connects to various exchanges and non-displayed (dark) venues to find the best available price and depth.
  • Dynamic Routing: Continuously monitors market conditions and adapts order routing in real-time.
  • Order Slicing: Breaks large orders into smaller pieces for execution across multiple venues to reduce market impact.
  • Client Control: Allows clients to specify preferred or excluded venues.
  • Conditional Negotiation: Can negotiate trades on ATS platforms using "conditional invitations" for potentially better single-price fills.
  • Integration with Algorithms: Works with Jefferies' own or client algorithms to manage parent orders and route child orders efficiently.
  • Jefferies' SOR documentation.
  • https://www.jefferies.com/wp-content/uploads/sites/4/2023/12/SMBC_SNET_SORDP_E N_v3.0.1_ncfd.pdf
  • How it Works for Clients
  • Order Entry: A client sends an order, which goes through AOP filters.
  • SOR Analysis: The SOR analyzes market depth, liquidity, price, and volatility.
  • Optimal Execution: It routes order segments to the best venues (lit/dark) for the best possible outcome, often slicing large orders.
  • Unified Report: Results are consolidated to show a single, unified execution to the client.
  • Transparency: Clients can see how their orders are handled and can opt-out of certain features like conditional negotiation.

Single-price fills

  • A specific type of trading mechanism known as the Single Price Method (or call auction) used by exchanges,
  • the result of an order type like a Fill or Kill (FOK) order, which demands complete execution at a specific price.
  • Single Price Method (Call Auction)
  • The Single Price Method is a trading mechanism used by some stock exchanges, often during the market opening or closing sessions, or for specific events like Initial Public Offerings (IPOs).
  • How it Works:
  • All buy and sell orders are collected over a set period. At a specified time, a single "clearing price" is determined that allows the maximum number of shares to be traded.
  • Purpose:
  • This method helps reduce price volatility and ensures that the maximum possible volume of orders is executed at a fair, uniform price, creating a level playing field for all participants regardless of order size.
  • Single Price Fills for Specific Order Types
  • A "single-price fill" is the outcome of certain order conditions designed to ensure that an entire order is executed at one specific price point.
  • Fill or Kill (FOK) Orders:
  • A Fill or Kill order specifies that the entire quantity of the order must be matched immediately and completely at the designated limit price or better; otherwise, the entire order is automatically canceled.
  • Advantage:
  • This ensures that a large block of shares is traded at a single, known price, minimizing market disruption and avoiding partial fills at potentially unfavorable prices in volatile markets.

Deploying GenAI for Business User Engagement

  • Use of chatbot to provide traders with AI-driven insights on trading patterns and market liquidity.
  • Aim to reduce analyst and developer workload.
  • AWS as a technology partner and innovation catalyst for Jefferies.
  • Trade Assistant System
  • Difficulties in accessing real-time insights due to vast and fragmented data.
  • Need for end-to-end visibility and coalescing data for insights.
  • Traders lack time and coding skills to generate and maintain necessary systems.
  • Solution: Trade Assistant to reduce barriers and provide real-time conversation analytics with GenAI.
  • Solution Capabilities and Architecture
  • Ease of use and quick access to insights as key design drivers.
  • Trader queries processed by LLM (Titan embeddings model) to generate SQL queries.
  • Data queried and answers provided in various formats (text, tables, charts).
  • Conversational analytics interface for exploring data insights.
  • Maintenance of conversational context for relevant insights and suggestions.
  • Use of Strands agents for building and running AI agents with minimal code.
  • Flexibility to choose different LLMs via Amazon Bedrock as the system evolves.
  • Advanced security guardrails and row-level data entitlements.
  • Intelligent access controls to prevent unauthorized access to sensitive data.
  • Logging of all conversations with audit trails for compliance.

Architecture Overview

Connection Establishment

  • The trade assistant connects to Jefferies' on-premises business intelligence platform, GFM, via AWS Direct Connect. This ensures a secure and high-speed connection.
  • User Authentication:
  • When a trader login to GFM, their credentials are verified to ensure they have the correct entitlements and can only access authorized data.
  • AWS EKS (Elastic Kubernetes Service) is used to build services for authenticating users and creating user sessions.
  • User Session and Query Agent Invocation:
  • Once authenticated, the request is routed to the bot services, which establish a user session and invoke the query agent.
  • The query agent is a Strands agent that interacts with multiple tools to determine the best data source to answer the trader's question.
  • Query Planning and Execution:
  • The Strands agent uses the advanced reasoning capabilities of the Titan embeddings model to plan and execute the query steps.
  • Amazon Bedrock knowledge base is used as a vector store.
  • SQL Query Generation and Execution:
  • "Gimme the sector breakdown for trading in the US today."
  • The query agent identifies the right data source and generates a SQL query.
  • The query executor service runs the SQL query against the relevant data sources, which are hosted on GridGain, an in-memory data grid for instant data retrieval.
  • Data Visualization:
  • The LLM (Large Language Model) chooses the appropriate visualization for the data.
  • A Python library converts the raw data into visual stories, charts, tables, and insights, which are then displayed on the screen using a markdown UI library.

Impact on Traders

  • Simplified Experience: The conversational analytics combined with rich visualizations has been well-received by traders.
  • Real-Time Data Access: Traders can quickly get sector breakdowns, trading data, and other insights in real-time.
  • Intuitive Interface: The UI widget allows traders to interact naturally with the trade assistant, typing questions in plain language.

Next Steps for Jefferies

  • Enhanced Functionality: Continue to improve the capabilities of the Strands agent and the underlying models to provide even more accurate and relevant insights.
  • Expanded Data Sources: Integrate additional data sources to provide a more comprehensive view of the trading landscape.
  • User Experience Improvements: Further refine the UI to make it even more intuitive and user-friendly.
  • Scalability: Ensure the platform can scale to accommodate growing numbers of users and increasing data volumes.

Benefits Observed in Beta Rollout

Time Savings

  • An 80% reduction in time spent on routine analytical tasks.
  • Increased revenue generation capacity due to time savings.
  • High Adoption Rate:
  • Indicates solution effectiveness and user satisfaction.
  • Reduced Tech Burden:
  • Decreased need for custom dashboards across multiple prototypes and trading desks.
  • Self-service capabilities reduce dependency on tech resources.
  • Democratized Data Access:
  • Business users can query millions of records of equity trading data using natural language.
  • Real-time discovery of trading patterns and market opportunities.
  • Future-Proof Architecture:
  • Self-learning and continuously improving.
  • Easily integrates with existing BI platforms and infrastructure.

Future Plans

Global Rollout Strategy

  • Multi-Product Expansion: Extend trade assistant beyond equities to support diverse prototypes and trading desks.
  • Global Deployment: Bring efficiency gains to international trading operations.
  • Enhanced Governance: Strengthen observability and audit trail capabilities to meet regulatory requirements.
  • Advanced Code Generation:
  • Transition from UI-based Java tools to sophisticated LLM-driven code generation for a better user experience.
  • Generic AI API:
  • Aim to turn the solution into a generic API that can be used firm-wide across other business areas.

Key Learnings

Avoid LLM for Visualizations

  • Don't rely on LLM to generate visualizations due to the risk of hallucinations.
  • Use a Python library (like markdown) to generate visualizations for better control and minimization of hallucinations.
  • Use Fast Data Stores:
  • Utilize an in-memory database to maximize the speed of result output.
  • Build LLM Interactions with Python:
  • Use Python for flexibility in building LLM interactions, while other components can be in Java to port existing code.

Conclusion

  • The trade assistant has shown significant benefits in its beta rollout, including time savings, high adoption rates, and reduced tech burden.
  • Key learnings emphasize the importance of avoiding LLM for visualizations, using fast data stores, and building LLM interactions with Python.