A multi-module Maven project (Java + Spring Boot) demonstrating an FX order-execution stack with FIX I/O, real-time price streaming, order management, and an AI-powered trading assistant.
- fix-server – FIX protocol server that listens for incoming FIX messages.
- price-streaming – Publishes real-time price updates.
- order-management – Manages and processes orders (also serves the UI for orders).
- ai-assistant (NEW) – An AI trading assistant (Spring AI + OpenAI) that lets you query the system in natural language.
fx-order-execution/
├── pom.xml # Parent POM
├── order-management/ # Order Management Module
│ ├── pom.xml
│ └── src/main/java/com/example/fx/order/management/...
├── price-streaming/ # Price Streaming Module
│ ├── pom.xml
│ └── src/main/java/com/example/fx/price_streaming/...
├── fix-server/ # FIX Server Module
│ ├── pom.xml
│ └── src/main/java/com/example/fx/fix/server/...
└── ai-assistant/ # AI Assistant Module (NEW)
├── pom.xml
└── src/main/java/com/example/fx/assistant/
├── TradingAssistantApplication.java
├── config/AIConfiguration.java
├── controller/TradingAssistantController.java
├── functions/TradingFunctions.java
├── model/Order.java
└── service/OrderService.java
- Java 17 or higher
- Maven 3.6+
- OpenAI API Key (for AI Assistant module)
To build the project, navigate to the root directory and run:
mvn clean installThis will compile and package all modules.
The modules must be started in the following order:
Navigate to the fix-server module and start the application:
cd fix-server
mvn spring-boot:run
# listens on port 9878The FIX server will start listening on port 9878.
Navigate to the price-streaming module and start the application:
cd ../price-streaming
mvn spring-boot:runThe price streaming service will start.
Navigate to the order-management module and start the application:
cd ../order-management
mvn spring-boot:runThe order management service will start. The UI will be served at the order management port.
Navigate to the ai-assistant module and start the application:
cd ../ai-assistant
mvn spring-boot:runThe AI assistant service will start.
The application will be available at http://localhost:8080.
Use the chat interface to interact with the AI trading assistant.
You can use the provided APIs to place orders and stream prices.
Stop each module in reverse order when done.
Here are some basic APIs you can use to interact with the system:
POST /orders/place
Request Body:
{
"orderId": "ORD123",
"symbol": "EUR/USD",
"quantity": 100,
"price": 1.1234,
"side": "BUY"
}Response:
{
"status": "SUCCESS",
"message": "Order placed successfully"
}GET /streaming-price/prices
Response:
{
"data":"1.121400184622543"
}The ai-assistant module adds a natural-language layer over your trading system using Spring AI function calling.
- Natural Language Interface – "What orders do I have?"
- Order Management – "Buy 100 EUR/USD"
- Position Analysis – "What's my exposure to EUR/USD?"
- Real-time Price – "What's the current price of EUR/USD?"
- Trade Suggestions – "Recommend a trade for EUR/USD today"
Chat with your trading system using natural language.
Traditional order management interface.
Connection refused / timeouts
- Ensure all four services are running and ports match config.
AI not responding
- Check
OPENAI_API_KEY, model name, and API quota. Look at theai-assistantlogs for details.
- Ensure all modules are running in the correct sequence to avoid errors.
- The FIX server handles incoming FIX messages and sends execution reports.
- The price streaming service publishes real-time price updates.

