Skip to content

Latest commit

 

History

468 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeuroWealth Backend

CI License: ISC Node.js TypeScript PRs Welcome

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.

Features

  • 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

Quickstart

# 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

Available Scripts

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

Tech Stack

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

Project Structure

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

Documentation

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

Environment Variables

See .env.example for all required environment variables.

Key variables:

  • DATABASE_URL - PostgreSQL connection string
  • STELLAR_NETWORK - testnet or mainnet
  • STELLAR_AGENT_SECRET_KEY - Stellar secret key
  • VAULT_CONTRACT_ID - Deployed vault contract ID
  • JWT_SECRET - JWT signing secret
  • ANTHROPIC_API_KEY - Claude AI API key

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the ISC License - see the LICENSE file for details.

About

NeuroWealth is an autonomous AI investment agent that automatically manages and grows your crypto assets on the Stellar blockchain. Deposit once, let the AI find the best yield opportunities across Stellar's DeFi ecosystem — and withdraw anytime with no lock-ups.

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages