A sophisticated Bloomberg Terminal API simulator that leverages @ruvector/agentic-synth for AI-powered synthetic data generation. Features real-time market data streaming, AI-generated news, and self-learning pattern recognition.
- NPX-based architecture - No native dependencies to compile
- Multi-provider AI - Gemini, OpenAI, Claude, OpenRouter (50+ models)
- Smart cascade - AgenticSynth β Azure β Mock data fallback
- Type-safe wrapper - Full TypeScript API for programmatic control
- 10,000+ quotes/second throughput
- Sub-50ms latency for real-time feeds
- Memory efficient with intelligent LRU caching
- Parallel processing for maximum throughput
- Real-time quotes with bid/ask spreads
- Trade execution with block/odd lot detection
- AI-generated news with sentiment analysis
- Market depth (Level II order book)
- Technical indicators: RSI, MACD, Bollinger Bands
- Market conditions: Bullish, bearish, volatile scenarios
# Clone the repository
git clone https://github.com/teemulinna/bloomberg-api-simulator.git
cd bloomberg-api-simulator
# Install dependencies
npm install
# Build the project
npm run buildCreate a .env file from the template:
cp .env.example .envAdd your API keys (choose at least one):
# Primary: Azure OpenAI (Enterprise-grade)
AZURE_OPENAI_API_KEY=your_azure_key_here
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_DEPLOYMENT=gpt-4
# Secondary: Gemini (Free tier available)
GEMINI_API_KEY=your_gemini_api_key_here
# Tertiary: Anthropic Claude
ANTHROPIC_API_KEY=your_anthropic_api_key_here- Gemini (Free): https://makersuite.google.com/app/apikey
- OpenAI: https://platform.openai.com/api-keys
- Azure OpenAI: Azure Portal β OpenAI Service
# Interactive Bloomberg Terminal simulation
npm run demo:bloomberg# Generate 1000 market data records
node dist/cli.js generate --count 1000 --symbols AAPL,MSFT,GOOGL
# Stream real-time data
node dist/cli.js stream --symbols AAPL,MSFT --interval 100import { BloombergSimulator } from './BloombergSimulator';
// Initialize simulator (auto-detects agentic-synth)
const simulator = new BloombergSimulator({
symbols: ['AAPL', 'MSFT', 'GOOGL'],
includeNews: true,
interval: 100
});
// Listen for AI-generated news
simulator.on('news:flash', (news) => {
console.log(`[${news.sentiment}] ${news.headline}`);
console.log(`Source: ${news.source}`); // Shows which AI generated it
});
// Listen for quotes
simulator.on('quote:update', (quote) => {
console.log(`${quote.symbol}: $${quote.last} (${quote.changePercent}%)`);
});
// Start streaming
await simulator.startStreaming({ parallel: true });import { AgenticSynthWrapper } from './agenticSynthWrapper';
const synth = new AgenticSynthWrapper({
provider: 'gemini',
apiKey: process.env.GEMINI_API_KEY
});
// Generate financial news
const news = await synth.generateNews(['AAPL', 'MSFT'], 10);
// Generate time-series data
const timeSeries = await synth.generateTimeSeries({
symbols: ['AAPL'],
count: 1000,
interval: '1min'
});The simulator uses Azure OpenAI as the primary AI provider, with agentic-synth as fallback:
- Azure OpenAI (Primary) - Enterprise-grade, configured via Azure
- Gemini (Secondary) - Via @ruvector/agentic-synth NPX wrapper
- Anthropic Claude (Tertiary) - Via @ruvector/agentic-synth NPX wrapper
- Mock Data (Always available) - Deterministic fallback
ββββββββββββββββββββββββββββββββββββββββββββ
β Bloomberg Simulator β
ββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β PRIMARY: Azure OpenAI β
β - Direct integration β
β - Enterprise-grade β
βββββββββββββββββββββββββββββββ
β
(fallback)
βΌ
βββββββββββββββββββββββββββββββ
β SECONDARY: agentic-synth β
β - Gemini (preferred) β
β - Via NPX β
βββββββββββββββββββββββββββββββ
β
(fallback)
βΌ
βββββββββββββββββββββββββββββββ
β TERTIARY: agentic-synth β
β - Anthropic Claude β
β - Via NPX β
βββββββββββββββββββββββββββββββ
β
(final fallback)
βΌ
βββββββββββββββββββββββββββββββ
β Mock Data Generator β
βββββββββββββββββββββββββββββββ
We use NPX to run agentic-synth without local installation because:
- β
Avoids native dependency compilation issues (
gl,sharp) - β Works on all platforms (macOS ARM64, Linux, Windows)
- β Always gets latest version
- β No build tools required
- β Cleaner dependency tree
See AGENTIC_SYNTH_INTEGRATION.md for detailed implementation.
- Agentic-Synth Integration - Complete integration guide
- Azure OpenAI Fixes - Azure OpenAI setup and troubleshooting
# Verify NPX wrapper is working
node tests/test-simple-agentic-synth.jsExpected Output:
β
NPX Availability: β
β
Help Command: β
β Basic Generation: β (requires API key)
This verifies the integration is working - generation requires a valid API key.
# Test agentic-synth with AI generation
node tests/test-agentic-synth-integration.js
# Test Azure OpenAI integration
node tests/test-azure-integration.jsExpected Output (with valid API key):
π§ͺ Testing @ruvector/agentic-synth Integration
1οΈβ£ Testing AgenticSynth Wrapper...
AgenticSynth available via NPX: β
Testing news generation...
Generated 2 news items:
1. [BULLISH] Apple beats Q4 expectations, stock jumps 5%
2. [BEARISH] Microsoft faces regulatory scrutiny in EU markets
β
News generation successful
2οΈβ£ Testing BloombergSimulator Integration...
β
@ruvector/agentic-synth integration enabled (NPX mode)
π€ News: [bullish] Apple stock jumps after strong iPhone sales
π Source: Bloomberg Terminal (AgenticSynth AI)
β
All integration tests completed!
Without API Key: Tests will show CLI is working but generation fails with "401 Unauthorized" - this is expected.
| Metric | AgenticSynth | Azure OpenAI | Mock Data |
|---|---|---|---|
| Throughput | 100-500 records/sec | 50 records/sec | 10,000 records/sec |
| Quality | Excellent (AI) | Excellent (AI) | Good (templates) |
| Cost | Pay-per-use | Pay-per-use | Free |
| Latency | ~2s first run (NPX) | ~500ms | <1ms |
| Variety | Very High | High | Limited |
bloomberg-api-simulator/
βββ src/
β βββ BloombergSimulator.ts # Main simulator class
β βββ agenticSynthWrapper.ts # @ruvector/agentic-synth NPX wrapper
β βββ azureOpenAI.ts # Azure OpenAI fallback
β βββ indicators.ts # Technical indicators
β βββ cli.ts # Command-line interface
β βββ types.ts # TypeScript definitions
β βββ index.ts # Main entry point
βββ tests/
β βββ test-agentic-synth-integration.js
β βββ test-azure-integration.js
βββ docs/
β βββ AGENTIC_SYNTH_INTEGRATION.md
β βββ AZURE_OPENAI_FIXES.md
βββ dist/ # Compiled JavaScript
- Real-time financial news headlines
- Sentiment analysis (bullish/bearish/neutral)
- Impact assessment (low/medium/high)
- Multi-provider support
- Contextually relevant to market conditions
- Realistic price movements with volatility
- Bid/ask spreads and market depth
- Trading volume patterns
- Market conditions (bull/bear/volatile)
- Corporate actions simulation
- RSI (Relative Strength Index)
- MACD (Moving Average Convergence Divergence)
- Bollinger Bands
- Stochastic Oscillator
- Moving Averages (SMA, EMA)
- Pattern detection and recognition
- Adaptive interval adjustment
- Performance optimization
- Cache hit rate tracking
- β
API keys stored in
.env(git-ignored) - β No hardcoded credentials
- β Secure Azure OpenAI integration
- β Rate limiting support
- β Error handling and fallbacks
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details
- @ruvector/agentic-synth - AI-powered synthetic data generation
- Azure OpenAI - Enterprise AI services
- Google Gemini - Generative AI platform
- GitHub Issues: https://github.com/teemulinna/bloomberg-api-simulator/issues
- Documentation: See
docs/directory - Examples: See
tests/directory
- DSPy.ts integration for self-improving prompts
- Vector embeddings for RAG systems
- Model benchmarking dashboard
- WebSocket server implementation
- Historical data replay
- Multi-exchange support
Built with β€οΈ using @ruvector/agentic-synth