StockX is a decentralized, AI-powered stock exchange platform designed to enable secure, transparent, and near-real-time trading of tokenized equities. By combining blockchain-based settlement, smart contract automation, decentralized identity, and AI-driven market intelligence, StockX removes traditional intermediaries while preserving regulatory compliance and institutional-grade reliability.
- πͺ Tokenized Equities: ERC-20/ERC-1400 security tokens representing real-world equities with fractional ownership
- β‘ High-Performance Matching: Off-chain matching engine for fast order processing and low-latency trades
- π€ AI-Powered Insights: Market intelligence, sentiment analysis, and personalized trading recommendations
- π Compliance & Security: On-chain KYC/AML enforcement with decentralized identity (DID)
- ποΈ DAO Governance: Token-holder voting on protocol upgrades, fee structures, and market parameters
- βοΈ Transparent Settlement: Atomic trade settlement with delivery-versus-payment (DvP) logic
- Architecture
- Tech Stack
- Getting Started
- Project Structure
- Development
- Smart Contracts
- AI Services
- Contributing
- License
StockX follows a hybrid on-chain / off-chain architecture:
Users & Institutions
β
Frontend (Web / Mobile)
β
Backend APIs & Relayers
β
Off-chain Matching Engine + AI Services
β
Smart Contracts (EVM)
β
Blockchain Ledger & DAO Governance
- On-Chain Layer: Trust, ownership, settlement, and governance
- Off-Chain Layer: Performance-critical logic, AI computation, and user experience
- Integration Layer: External data providers, compliance services, and custodial systems
- EVM-compatible chain (Ethereum L2 / Besu-based permissioned network)
- Solidity with OpenZeppelin libraries
- Hardhat for development and testing
- Node.js + Express (JavaScript)
- Event-driven architecture
- WebSocket for real-time updates
- Redis for caching
- PostgreSQL for data persistence
- React + TypeScript
- Tailwind CSS for styling
- Framer Motion for animations
- Recharts for data visualization
- Wallet integration (Web3)
- Python + FastAPI
- NLP & ML models for sentiment analysis
- Streaming data pipelines
- Portfolio optimization algorithms
- Docker & Docker Compose for containerization
- Kubernetes for orchestration
- Terraform for infrastructure as code
- Prometheus for monitoring
- GitHub Actions for CI/CD
- Node.js >= 18.0.0
- Python >= 3.9
- Docker & Docker Compose (optional)
- Git
-
Clone the repository
git clone https://github.com/your-org/stockx.git cd stockx -
Install dependencies
Root dependencies:
npm install
Frontend:
cd frontend npm install cd ..
Backend:
cd backend npm install cd ..
Smart Contracts:
cd smart-contracts npm install cd ..
-
Install Python dependencies
cd ai-services pip install -r requirements.txt cd ..
-
Set up environment variables
Copy
.env.examplefiles in respective directories and configure:frontend/.envbackend/.envsmart-contracts/.envai-services/.env
-
Start the backend
cd backend npm run dev -
Start the frontend
cd frontend npm run dev -
Start AI services (optional)
cd ai-services python -m uvicorn src.api.main:app --reload -
Run smart contracts locally
cd smart-contracts npx hardhat node
This submission adds a read-only backend endpoint:
GET /api/market/summaryThe endpoint returns exactly these top-level JSON fields:
{
"tokensListed": 247,
"totalTrades": 5432,
"totalVolume": "12400000",
"generatedAt": "2026-04-28T15:17:12.209Z"
}Implementation files:
backend/src/controllers/market.controller.jsbackend/src/routes/market.routes.js
To test locally:
cd backend
npm run devThen call the endpoint from another terminal:
curl -s http://localhost:3001/api/market/summaryRun the curl command twice to confirm generatedAt changes between requests.
stocks/
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # React components
β β βββ contexts/ # React contexts
β β βββ services/ # API services
β β βββ utils/ # Utility functions
β βββ package.json
β
βββ backend/ # Node.js backend API
β βββ src/
β β βββ controllers/ # Request handlers
β β βββ services/ # Business logic
β β βββ middleware/ # Express middleware
β β βββ models/ # Data models
β β βββ routes/ # API routes
β βββ package.json
β
βββ smart-contracts/ # Solidity smart contracts
β βββ contracts/
β β βββ core/ # Core contracts (TokenizedStock, OrderBook)
β β βββ compliance/ # Compliance contracts
β β βββ governance/ # DAO governance
β β βββ oracles/ # Price oracles
β βββ test/ # Contract tests
β βββ scripts/ # Deployment scripts
β
βββ ai-services/ # Python AI services
β βββ src/
β β βββ analytics/ # Market analysis
β β βββ sentiment/ # Sentiment analysis
β β βββ models/ # ML models
β β βββ api/ # FastAPI endpoints
β βββ requirements.txt
β
βββ infrastructure/ # DevOps configuration
β βββ docker/ # Dockerfiles
β βββ kubernetes/ # K8s manifests
β βββ terraform/ # Infrastructure as code
β βββ ci-cd/ # CI/CD pipelines
β
βββ docs/ # Documentation
β βββ api/ # API documentation
β βββ architecture/ # Architecture docs
β βββ deployment/ # Deployment guides
β βββ user-guide/ # User guides
β
βββ scripts/ # Utility scripts
βββ shared/ # Shared types and utilities
βββ README.md
Backend tests:
cd backend
npm testSmart contract tests:
cd smart-contracts
npx hardhat testAI services tests:
cd ai-services
pytest tests/- JavaScript: ESLint
- TypeScript: ESLint + TypeScript compiler
- Solidity: Solhint
- Python: Black + Flake8
Frontend:
cd frontend
npm run buildBackend:
cd backend
npm run buildSmart Contracts:
cd smart-contracts
npx hardhat compileThe platform uses several core smart contracts:
- TokenizedStock: ERC-20 security tokens with compliance checks
- OrderBook: Trade settlement and order matching coordination
- ComplianceRegistry: KYC/AML status management
- CustodyVault: Multi-signature custody for assets
- DAO: Governance and voting system
- PriceOracle: External price feed integration
See smart-contracts/README.md for detailed documentation.
The AI layer provides:
- Sentiment Analysis: News, social media, and earnings report analysis
- Signal Generation: Bullish/bearish indicators and trading signals
- Price Prediction: ML-based price forecasting
- Portfolio Optimization: Risk-adjusted portfolio recommendations
See ai-services/README.md for more details.
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by the StockX team at LynqEx Labs:
- Alex Chen - AI/ML Engineer
- Sarah Martinez - Full Stack Developer
- David Kim - DevOps/Infrastructure
- Emma Wilson - Technical Writer
- Michael Brown - Smart Contract Developer
For questions and support:
- Email: support@lynqexlabs.com
- Website: https://lynqexlabs.com
- Documentation: See
docs/directory
- OpenZeppelin for security-tested smart contract libraries
- Chainlink for oracle solutions
- The Ethereum community for inspiration and tools
Note: This is a Proof of Concept (PoC) implementation. Production deployment requires additional security audits, compliance reviews, and infrastructure hardening.