Spark Stacker is an advanced on-chain perpetual trading system with integrated hedging capabilities. It's designed to interact with multiple exchanges, implement technical indicators, and execute trading strategies with risk management.
- Multi-Exchange Support: Currently supports Hyperliquid with planned expansion to Synthetix
- Technical Indicators: RSI implementation with framework for custom indicators
- Risk Management: Advanced position sizing, leverage control, and hedging
- Trading Webhooks: Support for TradingView alerts integration
- Dry Run Mode: Test strategies without deploying capital
- Structured Logging: Comprehensive logging for monitoring and debugging
- Containerization: Docker support for easy deployment
Spark Stacker is built with a modular architecture:
- Connectors: Exchange-specific implementations with a common interface
- Indicators: Technical indicators for signal generation
- Risk Management: Handles position sizing and risk control
- Trading Engine: Core component that coordinates all operations
- Webhook Server: Receives external signals via HTTP
- Python 3.11 or higher
- Docker (optional, for containerized deployment)
- Copy
config.jsonto create your own configuration file - Fill in your exchange credentials and strategy parameters
- Set
dry_runtotruefor testing without executing trades
{
"log_level": "INFO",
"webhook_enabled": false,
"webhook_port": 8080,
"webhook_host": "0.0.0.0",
"max_parallel_trades": 1,
"polling_interval": 60,
"dry_run": true,
"exchanges": [
{
"name": "hyperliquid",
"wallet_address": "YOUR_WALLET_ADDRESS",
"private_key": "YOUR_PRIVATE_KEY",
"testnet": true,
"use_as_main": true,
"use_as_hedge": true
}
],
"strategies": [
{
"name": "rsi_eth_strategy",
"market": "ETH",
"enabled": true,
"main_leverage": 5.0,
"hedge_leverage": 2.0,
"hedge_ratio": 0.2,
"stop_loss_pct": 10.0,
"take_profit_pct": 20.0,
"max_position_size": 100.0
}
],
"indicators": [
{
"name": "eth_rsi",
"type": "rsi",
"enabled": true,
"parameters": {
"period": 14,
"overbought": 70,
"oversold": 30,
"signal_period": 1
}
}
]
}# Clone the repository
git clone https://github.com/yourusername/spark-stacker.git
cd spark-stacker
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the application
python app/main.py# Build the Docker image
docker build -t spark-stacker .
# Run the container
docker run -p 8080:8080 --name spark-stacker -v $(pwd)/config.json:/app/config.json spark-stacker- Create a new file in
app/indicators/directory - Implement your indicator by extending the
BaseIndicatorclass - Register your indicator in the
IndicatorFactory
- Create a new file in
app/connectors/directory - Implement the connector by extending the
BaseConnectorclass - Register your connector in the
ConnectorFactory
See ROADMAP.md for the project development roadmap and progress tracking.
Contributions are welcome! Please feel free to submit a Pull Request.
This software is provided for educational and informational purposes only. Trading cryptocurrencies involves substantial risk of loss and is not suitable for every investor. The past performance of any trading strategy is not necessarily indicative of future results. Only risk capital should be used for trading and only those with sufficient experience should trade.