A TypeScript monorepo that connects blockchain integrations (Stellar + Soroban) with AI services for trading, credit scoring, fraud detection, and risk automation.
LuminaryTrade is a production-ready platform for building AI-driven financial services on the Stellar blockchain. It bridges decentralized finance (DeFi) with artificial intelligence to enable trustless, intelligent financial services.
LuminaryTrade combines three core pillars:
-
Stellar Blockchain Integration
- Direct connection to Stellar Horizon API for account data, transaction history, and on-chain state
- Soroban smart contracts for immutable, verifiable scoring and fraud detection results
- Native support for Stellar assets and payments
-
AI-Powered Analysis
- Credit Scoring: Calculate creditworthiness from on-chain and off-chain signals
- Fraud Detection: Real-time machine learning analysis of transactions
- Risk Signals: Predictive analytics for portfolio and counterparty assessment
- Pluggable AI providers (OpenAI, custom models, etc.)
-
Enterprise-Grade Backend & Frontend
- REST API and WebSocket support for real-time updates
- React dashboards for monitoring and analytics
- Background workers for batch processing and automation
- Full JWT authentication and role-based access control
LuminaryTrade enables teams to rapidly build:
- 🏦 Lending Platforms: Automated credit scoring and underwriting with blockchain verification
- 🚨 Fraud Prevention Systems: Real-time transaction monitoring and anomaly detection
- 📊 Risk Management: Portfolio analysis and risk signal generation
- 🤖 Algorithmic Trading: Trading bots with AI-enhanced decision making
- ✅ Compliance Systems: Trustless verification and immutable audit trails
- 💼 Financial Services: Any DeFi application needing AI-powered decisions backed by blockchain
- DeFi Platforms building lending, trading, or derivatives protocols
- Blockchain Teams integrating Stellar with AI decision systems
- FinTech Innovators combining centralized and decentralized finance
- Enterprise Blockchain deploying regulated financial services on-chain
- Teams that need to ship AI + blockchain features in weeks, not months
| Feature | Benefit |
|---|---|
| Blockchain-Verified Decisions | AI decisions recorded immutably on-chain for compliance and audit trails |
| Fully Typed TypeScript | Catch errors at compile time, not production; full IDE support |
| Production Ready | Database pooling, caching, rate limiting, error handling all built-in |
| Composable Architecture | Use individual packages (SDKs, services) or the full platform |
| Quick Start | Working examples and CLI tools get you productive in hours |
| Monorepo Layout | Backend, frontend, contracts, docs all in one place with shared types |
- Stellar Horizon Client: Type-safe wrapper around Stellar Horizon REST API
- Soroban Contracts: Smart contract helpers for on-chain verification and state management
- Account Management: Track balances, transactions, and account history
- Asset Operations: Seamless asset issuance, trading, and payment workflows
- Credit Scoring: Calculate creditworthiness based on on-chain and off-chain signals
- Fraud Detection: Machine learning models for transaction anomaly detection
- Risk Signals: Predictive risk assessment for portfolio and counterparty analysis
- Pluggable Providers: Support for multiple AI providers (OpenAI, custom models, etc.)
- Strongly Typed SDKs: Full TypeScript support with comprehensive type definitions
- Node & Browser Support: SDKs work in both server and client environments
- Monorepo Structure: Shared types and utilities across all packages
- Build Tooling: Modern build pipelines with hot reload and production optimization
- CLI Tools: Command-line utilities for contract deployment, account management, and testing
- Example Applications: Reference implementations for common use cases
- Comprehensive Docs: Architecture guides, API references, and integration tutorials
- DevOps Scripts: Automation for building, testing, and deploying to testnet/mainnet
- Dashboard UI: Real-time visualization of accounts, scores, and risk signals
- Audit Logs: Immutable transaction history on-chain and in database
- Metrics: Performance monitoring and analytics for scoring and fraud detection
- Alerts: Configurable alerts for high-risk events and anomalies
luminarytrade/
├── backend/ # Backend services and APIs
│ ├── src/ # API source code (controllers, services, models)
│ ├── tests/ # Unit & integration tests
│ └── README.md
├── frontend/ # Frontend applications and UI components
│ ├── apps/ # Multiple apps (dashboard, wallet, etc.)
│ ├── components/ # Shared React components
│ └── README.md
├── contracts/ # Soroban smart contracts and build artifacts
│ ├── credit-score/ # Credit scoring contract(s)
│ ├── fraud-detect/ # Fraud detection contract(s)
│ └── common-utils/ # Shared contract utilities & tests
├── examples/ # Example integrations & reference apps
│ ├── credit-scoring-app/
│ ├── wallet-chatbot/
│ └── fraud-detection-service/
├── packages/ # Shared TypeScript packages / SDKs
│ ├── core/ # Core SDK (connectors, types, utilities)
│ └── cli/ # CLI tools and scripts
├── docs/ # Documentation (guides, API reference)
├── scripts/ # Build, deploy, and automation scripts
├── tests/ # End-to-end and system tests
├── .github/ # CI workflows, issue templates, PR templates
└── README.md # This file
- Node.js: v18 or higher (LTS recommended)
- pnpm: v8+ (recommended) or npm/yarn
- Docker: For local PostgreSQL, Redis, and contract testing (recommended)
- AI Provider API Key: When using hosted AI features (e.g., OpenAI)
- Clone the repository
git clone https://github.com/GameChangable/luminarytrade.git
cd luminarytrade- Install dependencies
pnpm install- Set up environment variables
# Copy example environment file
cp .env.example .env
# Edit .env with your configuration
# - Database URL (PostgreSQL)
# - Redis URL
# - Stellar network (testnet/public)
# - AI provider API keys- Start local services (using Docker)
docker-compose up -dThis starts:
- PostgreSQL database
- Redis cache
- (Optional) Soroban local testnet
cd backend
# Install dependencies
pnpm install
# Start development server (with hot reload)
pnpm dev
# Run tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Build for production
pnpm buildDefault API Endpoints:
- Health:
GET /api/health - Credit Score:
GET /api/accounts/:accountId/credit-score - Fraud Detection:
POST /api/transactions/analyze
cd frontend
# Install dependencies
pnpm install
# Start development server
pnpm start
# Run tests
pnpm test
# Build for production
pnpm buildAccess the app:
- Dashboard: http://localhost:3000
- Admin Panel: http://localhost:3001
cd contracts/credit-score
# Install dependencies
pnpm install
# Build contract
pnpm build
# Run tests
pnpm test
# Deploy to testnet
pnpm deploy:testnetimport { StellarConnector, AIService, CreditScorer } from '@luminarytrade/core';
// Initialize Stellar connection
const stellar = new StellarConnector({
network: 'testnet',
horizonUrl: 'https://horizon-testnet.stellar.org',
});
// Initialize AI service
const ai = new AIService({
provider: 'openai',
apiKey: process.env.AI_API_KEY,
});
// Initialize credit scorer
const scorer = new CreditScorer(stellar, ai);
// Get an account and calculate credit score
async function main() {
const account = await stellar.getAccount('GXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
const score = await scorer.calculateScore(account);
console.log('Account:', account.id);
console.log('Credit Score:', score.rating);
console.log('Risk Level:', score.riskLevel);
}
main().catch(console.error);┌─────────────────────────────────────────────────────────────┐
│ Frontend Applications │
│ (React Dashboard, Wallet, Admin) │
└────────────────────────┬────────────────────────────────────┘
│ HTTPS / WebSocket
┌────────────────────────▼────────────────────────────────────┐
│ Backend API Layer │
│ (REST API, WebSocket, Authentication, Rate Limiting) │
└────────────────────────┬────────────────────────────────────┘
│
┌────────────────┼────────────────┐
│ │ │
▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌──────────┐
│Database │ │ Redis │ │ Workers │
│(PostgreSQL) │ (Cache) │ │(Background)
└─────────┘ └──────────┘ └──────────┘
│
└────────────────┬────────────────┐
│ │
┌────────────────┼────────────────┐
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Stellar │ │ AI/ML │ │ Soroban │
│ Horizon │ │ Services │ │ Contracts│
│ API │ │(OpenAI) │ │(On-Chain)│
└──────────┘ └──────────┘ └──────────┘
Backend Services:
- API Server: Express/Fastify REST API handling client requests
- Authentication: JWT-based auth with refresh token rotation
- Account Service: Track and manage user accounts on Stellar
- Scoring Service: Calculate credit scores using AI models
- Fraud Detection: Real-time transaction analysis
- Worker Pool: Background jobs for long-running operations
Frontend Applications:
- Dashboard: Analytics and account monitoring
- Wallet: Stellar wallet operations and payments
- Admin Panel: System management and configuration
Blockchain Layer:
- Stellar Connection: Horizon API integration for account and transaction data
- Soroban Contracts: On-chain scoring and verification logic
- Smart Contract Helpers: TypeScript utilities for contract interaction
AI Integration:
- Credit Scoring Model: Trained model for creditworthiness assessment
- Fraud Detection Model: Anomaly detection for suspicious transactions
- Risk Signals: Predictive analytics for portfolio management
- Provider Abstraction: Support for multiple AI providers
# Server
PORT=3000
NODE_ENV=development
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/luminary
DATABASE_POOL_SIZE=20
# Redis (caching and sessions)
REDIS_URL=redis://localhost:6379/0
# Stellar
STELLAR_NETWORK=testnet
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
STELLAR_SERVER_SIGNING_KEY=SXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# AI Services
AI_PROVIDER=openai
AI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AI_MODEL=gpt-4
# JWT Authentication
JWT_SECRET=your-secret-key-here
JWT_EXPIRY=1h
JWT_REFRESH_EXPIRY=7d
# Logging
LOG_LEVEL=info
LOG_FORMAT=json
# CORS
CORS_ORIGIN=http://localhost:3000,http://localhost:3001
# Email (for notifications)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-passwordREACT_APP_API_URL=http://localhost:3000/api
REACT_APP_STELLAR_NETWORK=testnet
REACT_APP_WS_URL=ws://localhost:3000
REACT_APP_SENTRY_DSN=https://your-sentry-dsn@sentry.io/1234567All API requests require a Bearer token:
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
http://localhost:3000/api/accountsAccounts:
GET /api/accounts/:id- Get account detailsGET /api/accounts/:id/credit-score- Get credit scoreGET /api/accounts/:id/transactions- Get account transactions
Scoring:
POST /api/scoring/calculate- Calculate credit scorePOST /api/scoring/explain- Explain score factors
Fraud Detection:
POST /api/fraud-detect/analyze- Analyze transaction for fraudGET /api/fraud-detect/alerts- Get fraud alerts
Admin:
GET /api/admin/health- System health checkGET /api/admin/metrics- Performance metrics
See docs/api-reference.md for complete endpoint documentation.
On-chain contract for immutable credit score verification:
pub fn calculate_credit_score(
account: Address,
balance: i128,
transaction_count: u32,
) -> i32Features:
- Deterministic scoring based on on-chain data
- Immutable score history
- Audit trail for compliance
Verify fraud detection results on-chain:
pub fn verify_fraud_score(
transaction_id: String,
fraud_score: i32,
timestamp: u64,
) -> boolSee contracts/ directory and docs/smart-contracts.md for details.
See examples/credit-scoring-app/ for a complete working example.
See examples/fraud-detection-service/ for a standalone fraud detection implementation.
See examples/trading-bot/ for an algorithmic trading example.
See examples/wallet-chatbot/ for a conversational wallet interface.
We welcome contributions from the community! Please follow these guidelines:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes and commit:
git commit -m "Add feature description" - Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request
- Write tests for new features (aim for >80% coverage)
- Follow the TypeScript style guide in
CONTRIBUTING.md - Update documentation for API changes
- Ensure all tests pass before submitting PR
- At least one maintainer review required
- All CI checks must pass
- Address feedback and push updates
- Merge after approval
See CONTRIBUTING.md for detailed guidelines.
docs/architecture.md- System design and component relationshipsdocs/authentication.md- JWT auth flow and security best practicesdocs/api-reference.md- Complete API endpoint documentationdocs/smart-contracts.md- Contract architecture and deploymentdocs/deployment.md- Production deployment guidedocs/integration-guide.md- How to integrate LuminaryTradedocs/ai-providers.md- AI provider configurationdocs/troubleshooting.md- Common issues and solutions
- Issues: Open an issue for bug reports or feature requests
- Discussions: Use GitHub Discussions for questions and ideas
- Email: contact@luminarytrade.dev
- Maintained by the GameChangable team
- For urgent issues, tag maintainers in PRs or open an issue with the
urgentlabel
This project is licensed under the MIT License. See the LICENSE file for details.
- Stellar Development Foundation for the Stellar blockchain and Horizon API
- Soroban team for smart contract platform
- OpenAI and other AI providers for ML capabilities
- Community contributors who have helped improve this project
- Multi-chain support (Ethereum, Polygon)
- Advanced portfolio analytics
- Real-time trading execution
- Enhanced mobile app
- GraphQL API
- Kafka integration for event streaming
- Enhanced AI model fine-tuning
Last Updated: June 5, 2026
For the latest updates, visit GitHub.