Autonomous AI investment agent backend that manages and grows crypto assets on the Stellar blockchain. Users deposit once and the AI finds yield opportunities across Stellar's DeFi ecosystem.
- AI-Powered Portfolio Management - Autonomous rebalancing using Anthropic Claude
- Stellar Blockchain Integration - Native Soroban smart contracts, claimable balances, and multi-sig support
- DeFi Yield Optimization - Automated yield farming across Stellar protocols
- Real-time Analytics - Monte Carlo simulations, correlation analysis, factor exposure, stress testing
- NLP Trading Interface - Natural language commands for portfolio management (Telegram, WhatsApp)
- Circuit Breaker System - Automated risk management with exposure caps and rebalance cost analysis
- Privacy & Compliance - GDPR/CCPA erasure, Travel Rule support, audit trail
- Tax Reporting - Multi-jurisdiction tax calculation (US, UK, DE, CA, AU)
- Referral Program - Multi-tier referral system with fraud detection
# 1. Clone and install
git clone https://github.com/Neurowealth/Backend.git
cd Backend
npm install
# 2. Configure environment
cp .env.example .env
# Edit .env with your values
# 3. Start database
docker-compose up -d
# 4. Run migrations
npx prisma migrate deploy
# 5. Start development server
npm run dev| Script | Description |
|---|---|
npm run dev |
Start development server with hot-reload |
npm test |
Run all tests |
npm run test:unit |
Run unit tests only |
npm run test:integration |
Run integration tests |
npm run test:coverage |
Run tests with coverage report |
npm run lint |
Run ESLint |
npm run typecheck |
Run TypeScript type check |
npm run build |
Build for production |
npm run format |
Format code with Prettier |
npm run validate:spec |
Validate OpenAPI specification |
| Layer | Technology |
|---|---|
| Runtime | Node.js 22+ / TypeScript 5.3 |
| Framework | Express.js |
| Database | PostgreSQL 14+ (Prisma ORM) |
| Cache/Queue | Redis (ioredis) |
| Blockchain | Stellar SDK, Soroban smart contracts |
| AI | Anthropic Claude SDK |
| Monitoring | OpenTelemetry, Prometheus, Sentry |
| Security | Helmet, CORS, JWT, Zod validation |
| Docs | Swagger UI, OpenAPI (Redocly-validated) |
| Testing | Jest, Supertest |
| CI/CD | GitHub Actions, Dependabot |
| Deployment | Docker, Kubernetes |
Backend/
├── src/
│ ├── agent/ # AI agent, strategies, risk management
│ ├── analytics/ # Monte Carlo, correlation, factor analysis
│ ├── auth/ # JWT authentication, API keys
│ ├── compliance/ # Travel Rule, KYC support
│ ├── controllers/ # Request handlers
│ ├── fiat/ # Fiat on-ramp (Transak)
│ ├── jobs/ # Background jobs (erasure, treasury, reconciliation)
│ ├── middleware/ # Auth, rate limiting, sub-accounts
│ ├── nlp/ # Natural language processing
│ ├── outbox/ # Transactional outbox pattern
│ ├── privacy/ # Data mapping, erasure policies
│ ├── referral/ # Multi-tier referral system
│ ├── routes/ # API route definitions
│ ├── stellar/ # Stellar SDK integration
│ ├── strategy/ # Strategy simulation
│ ├── tax/ # Multi-jurisdiction tax reporting
│ ├── telegram/ # Telegram bot integration
│ ├── whatsapp/ # WhatsApp bot integration
│ └── validators/ # Zod request validation
├── tests/
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── load/ # Load tests
├── prisma/ # Database schema & migrations
├── docs/ # Documentation (38+ files)
├── deploy/ # Kubernetes & monitoring configs
└── scripts/ # Operational scripts
| Document | Description |
|---|---|
| Documentation Index | Master index with reading order |
| API Reference | Full endpoint reference |
| Deployment Guide | Local, staging, production setup |
| Runbook | Operational runbook |
| OpenAPI Spec | Machine-readable API specification |
| Contributing | How to contribute |
| Security Policy | Vulnerability reporting & security measures |
See .env.example for all required environment variables.
Key variables:
DATABASE_URL- PostgreSQL connection stringSTELLAR_NETWORK-testnetormainnetSTELLAR_AGENT_SECRET_KEY- Stellar secret keyVAULT_CONTRACT_ID- Deployed vault contract IDJWT_SECRET- JWT signing secretANTHROPIC_API_KEY- Claude AI API key
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the ISC License - see the LICENSE file for details.