An Open-Source Automated Cryptocurrency Trading Application
β οΈ UNDER CONSTRUCTION - This project is in active development and not production-ready.
- Overview
- Features
- Architecture
- Security Model
- Prerequisites
- Installation
- Usage
- Configuration
- API Integration
- Project Structure
- Roadmap
- Contributing
- Disclaimer
- License
Jacquard's Loom is a sophisticated cryptocurrency trading platform written in modern C++. Named after the revolutionary Jacquard loom that automated weaving patterns, this application weaves together multiple technologies to automate cryptocurrency trading strategies.
The platform features:
- Algorithmic Trading with reinforcement learning capabilities
- Multi-Exchange Support (Binance, Coinbase, Kraken, and more)
- BIP-39 Mnemonic Authentication for secure wallet recovery
- Encrypted File Storage using custom AES-256 implementation
- Real-time Market Data analysis and candlestick pattern recognition
- Advanced Order Management with multiple order types
- Blockchain Integration for on-chain wallet management
-
Multi-Exchange Trading: Support for major cryptocurrency exchanges
- Binance (Spot & Futures)
- Coinbase Pro
- Kraken
- Bitfinex
- And more...
-
Order Types:
- Market Orders
- Limit Orders
- Stop-Loss Orders
- Trailing Stop Orders
- OCO (One-Cancels-Other) Orders
- Iceberg Orders
-
Technical Analysis:
- Real-time candlestick data collection
- Multiple timeframe analysis (1m, 5m, 15m, 1h, 4h, 1d)
- Pattern recognition
- Volume analysis
- Price action indicators
- Reinforcement Learning Engine:
- Q-Learning implementation
- State-space modeling
- Adaptive strategy optimization
- Performance tracking and learning
-
BIP-39 Mnemonic System:
- 12-word recovery phrases (2048-word dictionary)
- Deterministic wallet generation
- Secure entropy collection
-
Encryption:
- AES-256 file encryption
- Custom cryptographic primitives (educational implementation)
- SHA-256 and HMAC for integrity
- PBKDF2-based key derivation
- Master key protection
-
Authentication:
- Mnemonic-based login system
- Automatic file encryption on exit
- Memory clearing for sensitive data
-
HD Wallet Support:
- Hierarchical Deterministic wallet generation
- Multiple address derivation
- Bitcoin address generation (P2PKH, P2SH, Bech32)
- Balance tracking
-
Transaction Management:
- UTXO tracking
- Transaction building and signing
- Fee estimation
- Blockchain explorers integration
-
Terminal-based UI:
- ANSI color support
- Multi-column layouts
- Real-time updates
- Interactive menus
- Progress indicators and loaders
-
Data Visualization:
- Candlestick charts (ASCII-based)
- Portfolio performance metrics
- Order book visualization
- Trade history display
-
Metrics Tracking:
- Loop speed monitoring
- API latency tracking
- Memory usage reporting
- Trade performance analytics
-
Logging System:
- Multi-level logging (DEBUG, INFO, WARNING, ERROR)
- File-based log persistence
- Console output with color coding
- Timestamp tracking
-
Portfolio Management:
- Multi-currency balance tracking
- Profit/loss calculation
- Transaction history
- Position sizing
-
Risk Management:
- Configurable position limits
- Stop-loss automation
- Portfolio diversification tracking
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Jacquard's Loom β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Security β β Trading β β Blockchain β β
β β System β β Engine β β Integration β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β β β β
β ββ Mnemonic Auth ββ Order Mgmt ββ Wallet β
β ββ Encryption ββ Market Data ββ Tx Builderβ
β ββ Key Derivation ββ RL Engine ββ UTXO Pool β
β ββ Multi-Exchange β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Infrastructure Layer β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β
β β Logging β File I/O β HTTP Client β JSON Parser β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- FlowState: Main application orchestrator
- Interface_Login: Mnemonic-based authentication UI
- Interface_Home: Main trading interface and menu system
- Trader: Core trading logic and strategy execution
- Banking: Portfolio and balance management
- Blockchain: Blockchain interaction and wallet management
- ReinforcementLearning: Q-learning engine for strategy optimization
- CandleCollector: Market data aggregation
- FileStorage: Encrypted file persistence
- MnemonicAuthentication: BIP-39 implementation
This implementation contains custom cryptographic code for EDUCATIONAL PURPOSES ONLY.
The following primitives have been re-implemented from scratch:
- AES-256 (Advanced Encryption Standard)
- SHA-256 (Secure Hash Algorithm)
- HMAC (Hash-based Message Authentication Code)
- PBKDF (Password-Based Key Derivation Function)
DO NOT USE THIS FOR PRODUCTION/REAL FUNDS:
- Not Audited: These implementations have not undergone professional security audits
- No Side-Channel Protection: Vulnerable to timing attacks and other side-channel exploits
- Educational Code: Designed for learning, not battlefield-hardened security
- Potential Vulnerabilities: May contain undiscovered bugs or weaknesses
Use industry-standard, audited libraries:
- OpenSSL (already partially integrated)
- libsodium
- Bouncy Castle
- Crypto++ (Crypto Plus Plus)
- BIP-39 Mnemonic: Uses the standard 2048-word English dictionary
- File Encryption: AES-256 for all sensitive data at rest
- Key Derivation: PBKDF2-style key stretching
- Memory Protection: Explicit clearing of sensitive data
- Auto-Encryption: Files automatically encrypted on application exit
- OS: Windows (ANSI terminal support required)
- Compiler: C++17 or later (MSVC, MinGW, or Clang)
- RAM: 4GB minimum, 8GB recommended
- Storage: 1GB for application and data files
-
libcurl - HTTP client for API requests
# Using vcpkg (recommended) vcpkg install curl -
nlohmann/json - JSON parsing
vcpkg install nlohmann-json
-
OpenSSL - Cryptographic functions (for API auth)
vcpkg install openssl
-
C++ Standard Library - C++17 filesystem support
- CMake 3.15+ (optional, for build automation)
- Git (for version control)
- Visual Studio 2019+ or compatible compiler
# Clone the repository
git clone https://github.com/oiko-nomikos/Jacquards-Loom.git
cd Jacquards-Loom
# Install dependencies (using vcpkg)
vcpkg install curl nlohmann-json openssl
# Compile
g++ -std=c++17 latest_edition.cpp \
-o jacquards_loom \
-lcurl \
-lssl \
-lcrypto \
-lpthread \
-I/path/to/vcpkg/installed/x64-windows/include \
-L/path/to/vcpkg/installed/x64-windows/libmkdir build && cd build
cmake ..
cmake --build ../jacquards_loomYou should see the login terminal splash screen.
-
Launch the application:
./jacquards_loom
-
Mnemonic Creation: On first launch, the system will generate a 12-word recovery phrase
- CRITICAL: Write down your mnemonic phrase and store it securely
- This phrase is your ONLY way to recover access to the application
- Loss of the mnemonic means permanent loss of access
-
Login: Enter your 12-word mnemonic (spaces are optional)
-
Main Menu: Navigate through the interface using the menu system
Launch β Authenticate β Main Menu
β
ββββββββββββββββββββΌβββββββββββββββββββ
β β β
Trading Menu Blockchain Menu Settings Menu
β β β
Start/Stop View Wallet API Keys
View Orders Transactions Parameters
Strategies Addresses Preferences
-
Navigate to Trading Menu
-
Select Start Automated Trading
-
Configure trading parameters:
- Trading pairs (e.g., BTC/USD, ETH/USD)
- Position sizes
- Risk limits
- Strategy selection
-
Monitor performance through:
- Real-time order updates
- Portfolio balance changes
- Trade history logs
- Navigate to Blockchain Menu
- Options include:
- Generate new addresses
- View wallet balances
- Track UTXOs
- Build and sign transactions
The application creates several files in the program directory:
Jacquards-Loom/
βββ mnemonic_hash.enc # Encrypted authentication hash
βββ qtable.csv # Reinforcement learning Q-table
βββ loop_layout.txt # Trading loop configuration
βββ debug.log # Application logs
βββ [user_data]/ # Encrypted user files
βββ wallet_data.enc
βββ trade_history.enc
βββ api_keys.enc
To enable exchange trading:
- Navigate to Settings β API Keys
- Enter credentials for each exchange:
- API Key
- API Secret
- Passphrase (if required)
- Test connection before trading
| Exchange | Spot Trading | Futures | WebSocket |
|---|---|---|---|
| Binance | β | β | β |
| Coinbase Pro | β | β | β |
| Kraken | β | β | β |
| Bitfinex | β | β | β |
| Bybit | β | β | β |
| OKX | β | β | β |
Key configurable parameters:
// Risk Management
maxPositionSize = 0.1; // 10% of portfolio per trade
stopLossPercent = 0.02; // 2% stop loss
takeProfitPercent = 0.05; // 5% take profit
// Strategy
tradingMode = "RL"; // Reinforcement Learning
timeframe = "1h"; // 1-hour candles
lookbackPeriod = 100; // Historical candles to analyze
// Execution
orderType = "LIMIT"; // Limit orders by default
slippage = 0.001; // 0.1% max slippageEach exchange requires slightly different authentication:
exchange = "BINANCE";
apiKey = "your_api_key";
apiSecret = "your_api_secret";
baseURL = "https://api.binance.com";exchange = "COINBASE";
apiKey = "your_api_key";
apiSecret = "your_api_secret";
passphrase = "your_passphrase";
baseURL = "https://api.pro.coinbase.com";- Market Data:
/api/v3/ticker/price,/api/v3/klines - Account:
/api/v3/account - Orders:
/api/v3/order,/api/v3/openOrders - WebSocket: Real-time market data streams
The application implements rate limiting to comply with exchange restrictions:
- Binance: 1200 requests/minute
- Coinbase: 10 requests/second public, 5 requests/second private
- Kraken: 15-20 requests/second (tier dependent)
latest_edition.cpp (13,066 lines)
βββ Headers & Includes (Lines 1-156)
β βββ Standard Library
β βββ Networking (libcurl)
β βββ JSON (nlohmann)
β βββ Cryptography (OpenSSL)
β
βββ Core Utilities (Lines 157-2500)
β βββ ANSI Terminal Support
β βββ Logging System
β βββ File System Abstraction
β βββ Render Engine (UI Components)
β βββ Utility Functions
β
βββ Cryptography Layer (Lines 2501-5000)
β βββ AES-256 Implementation
β βββ SHA-256 Hashing
β βββ HMAC
β βββ PBKDF Key Derivation
β βββ BIP-39 Mnemonic (2048 words)
β βββ File Encryption/Decryption
β
βββ Blockchain System (Lines 5001-7500)
β βββ Wallet Management
β βββ HD Key Derivation (BIP-32/44)
β βββ Address Generation
β βββ UTXO Management
β βββ Transaction Building
β βββ Blockchain API Integration
β
βββ Trading Engine (Lines 7501-10000)
β βββ Exchange Connectors
β βββ Order Management
β βββ Market Data Collection
β βββ Candlestick Analysis
β βββ Technical Indicators
β βββ Risk Management
β
βββ Machine Learning (Lines 10001-11000)
β βββ Q-Learning Implementation
β βββ State Space Modeling
β βββ Reward Functions
β βββ Strategy Optimization
β
βββ Banking & Accounting (Lines 11001-12000)
β βββ Portfolio Management
β βββ Balance Tracking
β βββ Transaction History
β βββ P&L Calculation
β
βββ User Interface (Lines 12001-13066)
βββ Login System
βββ Main Menu
βββ Trading Interface
βββ Blockchain Interface
βββ Settings & Configuration
- Web-based dashboard (React frontend)
- RESTful API for external integrations
- Backtesting engine with historical data
- Advanced charting and visualization
- Multi-user support
- Machine learning model improvements
- Sentiment analysis integration
- Telegram/Discord bot notifications
- Portfolio optimization algorithms
- Tax reporting features
- Production-ready security audit
- Replace custom crypto with OpenSSL fully
- Linux and macOS support
- Docker containerization
- Comprehensive documentation
- Unit and integration tests (90%+ coverage)
- DeFi protocol integration (Uniswap, Aave)
- Options and derivatives trading
- Arbitrage detection and execution
- Social trading / copy trading features
- Mobile app (iOS/Android)
Contributions are welcome! This project is open source and community-driven.
- Fork the repository
- Create a feature branch:
git checkout -b feature/AmazingFeature - Commit your changes:
git commit -m 'Add some AmazingFeature' - Push to the branch:
git push origin feature/AmazingFeature - Open a Pull Request
- Follow existing code style (see
.clang-format) - Add comments for complex logic
- Update documentation for new features
- Test thoroughly before submitting PR
- Security: Help audit and improve cryptographic implementations
- Testing: Write unit tests and integration tests
- Documentation: Improve README, add code comments, create tutorials
- Features: Implement items from the roadmap
- Bug Fixes: Identify and fix issues
- Optimization: Improve performance and reduce latency
Found a bug? Have a feature request?
- Check existing issues first
- Create a new issue with:
- Clear description
- Steps to reproduce (for bugs)
- Expected vs actual behavior
- System information
- Relevant logs
CRYPTOCURRENCY TRADING CARRIES SUBSTANTIAL RISK OF LOSS.
- This software is provided for EDUCATIONAL AND EXPERIMENTAL PURPOSES ONLY
- DO NOT USE WITH REAL MONEY until the codebase is production-ready
- Past performance does not guarantee future results
- Automated trading can lead to significant financial losses
- The developers assume NO LIABILITY for any losses incurred
- Ensure cryptocurrency trading is legal in your jurisdiction
- Comply with all local regulations and tax requirements
- Some jurisdictions require licenses for automated trading
- You are solely responsible for legal compliance
- Alpha Software: This is version 0.1.0 - expect bugs and breaking changes
- No Warranty: Provided "AS IS" without warranties of any kind
- Security: Custom cryptography is NOT production-grade
- Data Loss: Always backup your mnemonic phrase
- API Changes: Exchange APIs may change without notice
This tool is powerful. Use it responsibly:
- Start with small amounts for testing
- Understand the strategies you deploy
- Monitor the system regularly
- Have stop-loss measures in place
- Never invest more than you can afford to lose
This project is licensed under the MIT License - see below for details.
MIT License
Copyright (c) 2026 oiko-nomikos
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- BIP-39 Word List: Copyright (c) 2013-2017 Marek Palatinus, Pavol Rusnak (MIT License)
- nlohmann/json: Copyright (c) 2013-2022 Niels Lohmann (MIT License)
- libcurl: Copyright (c) 1996-2024 Daniel Stenberg (curl License)
- OpenSSL: Licensed under Apache License 2.0
Special thanks to:
- Bitcoin Core Developers: For BIP-32, BIP-39, and BIP-44 specifications
- Crypto Community: For open-source cryptographic implementations
- Exchange APIs: Binance, Coinbase, Kraken for comprehensive API documentation
- C++ Community: For excellent libraries and tools
- GitHub Issues: Report bugs or request features
- Discussions: Community forum
- Security: For security vulnerabilities, please report responsibly via GitHub Security Advisories
- Bitcoin BIPs - Bitcoin Improvement Proposals
- Cryptocurrency Trading Basics
- C++ Reference
- Modern Cryptography
- ccxt - Cryptocurrency trading library
- freqtrade - Algorithmic trading bot
- bitcoin-core - Bitcoin reference implementation
Built with β€οΈ by the Open Source Community
β Star this repo if you find it useful! β