Cryptocurrency trading has evolved rapidly, and automated solutions are now essential for traders seeking efficiency, precision, and consistent execution. Enter Passivbot, a powerful, open-source trading bot engineered to operate across multiple leading exchanges including Bybit, OKX, Bitget, GateIO, Binance, and Hyperliquid. Designed with minimal user intervention in mind, this advanced tool leverages smart market-making strategies to help users navigate volatile futures markets.
Built using Python and Rust, Passivbot delivers high performance and speed—especially during backtesting and optimization—thanks to its Rust-based core components. It functions exclusively on perpetual futures markets, placing and managing limit orders automatically without relying on technical indicators or trend predictions. Instead, it acts as a contrarian market maker, providing liquidity and helping stabilize price movements by absorbing volatility.
Whether you're a seasoned trader or exploring algorithmic trading for the first time, Passivbot offers a robust framework for executing grid-based and trailing-order strategies with precision.
How Passivbot Works: A Contrarian Market Maker Approach
Unlike traditional bots that chase trends or react to signals, Passivbot adopts a unique market-neutral strategy inspired by the Martingale betting system. The bot starts with a small initial position and systematically doubles down on losing entries at predefined intervals. This approach gradually brings the average entry price closer to the current market level.
Orders are arranged in a grid formation, allowing the bot to absorb sudden price swings in either direction. After each re-entry, take-profit orders are dynamically updated with a fixed markup. As a result, even minor market reversals—or "bounces"—can trigger profitable exits, enabling the bot to reset and begin anew.
This strategy thrives in sideways or ranging markets where frequent price fluctuations create opportunities for profit without requiring directional bias.
👉 Discover how automated trading can enhance your strategy
Advanced Features for Smarter Execution
Trailing Entries and Closes
Passivbot supports trailing orders to improve entry and exit timing. For trailing entries, the bot waits for price to move beyond a threshold and then retrace by a specified percentage before placing an order—helping avoid false breakouts.
Similarly, trailing closes delay profit-taking until price moves favorably by a set margin and then pulls back slightly—locking in gains just before potential reversals. These dynamic triggers allow the bot to adapt to momentum shifts more effectively than fixed grid levels alone.
You can combine grid and trailing logic to manage partial positions differently, optimizing responsiveness across various market conditions.
Forager: Volatility-Based Market Selection
The Forager feature intelligently selects the most volatile markets for trading. It calculates volatility using the mean of the normalized relative range from recent 1-minute OHLCV data:
volatility = mean((high - low) / close)Markets exhibiting higher volatility are prioritized, ensuring the bot focuses on assets with greater movement potential—maximizing opportunity for grid and trailing order activation.
Unstucking Mechanism: Managing Underperforming Positions
Even the best strategies face drawdowns. When positions become "stuck"—meaning they remain underwater without recovery—Passivbot employs an unstucking mechanism to minimize prolonged losses.
The bot evaluates all open losing positions and prioritizes closing those with the smallest gap between entry and market price. This selective realization of small losses prevents capital from being tied up indefinitely. Additionally, account drawdown is capped by enforcing a balance floor—a configurable percentage below the highest historical balance—to preserve equity during extended adverse moves.
Installation Guide: Set Up Passivbot Locally
Getting started with Passivbot requires a few straightforward steps. Below is a complete setup guide compatible with most Unix-like systems (Linux/macOS).
Step 1: Clone the Repository
Begin by cloning the official GitHub repository:
git clone https://github.com/enarjord/passivbot.git
cd passivbotStep 2: Install Rust
Since key performance-critical components are written in Rust, install Rustup, the official Rust toolchain manager:
- Visit https://www.rust-lang.org/tools/install
- Follow platform-specific instructions
- Restart your terminal after installation
Step 3: Create a Virtual Environment
Use Python’s venv module to isolate dependencies:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activateStep 4: Install Python Dependencies
Install required packages from requirements.txt:
pip install -r requirements.txtStep 5 (Optional): Build Rust Extensions Manually
While Passivbot auto-builds Rust extensions on startup, manual compilation ensures everything is optimized:
cd passivbot-rust
maturin develop --release
cd ..Re-run these commands if you modify any Rust source files.
Step 6: Configure API Keys
Copy the example file and add your exchange credentials securely:
cp api-keys.json.example api-keys.jsonEdit api-keys.json with your API keys from supported exchanges. Never expose these files publicly.
Step 7: Launch the Bot
Start with default settings:
python3 src/main.py -u your_account_nameOr use a custom configuration file based on configs/template.json:
python3 src/main.py path/to/config.jsonJupyter Lab Integration
For deeper analysis and real-time monitoring, run Jupyter Lab within the same virtual environment used for the bot. From the project root directory:
jupyter labThis enables interactive exploration of trade logs, performance metrics, and backtest results—all within a notebook interface.
System Requirements
- Python 3.8 or later
- Full installation of dependencies listed in
requirements.txt - Rust toolchain (for compilation of performance modules)
Ensure sufficient RAM and CPU resources when running multiple instances or long-term backtests.
Backtesting and Optimization Tools
Passivbot includes a high-speed backtester powered by Rust for fast historical simulation. You can evaluate strategy performance over past price data across different timeframes and market conditions.
Additionally, an integrated optimizer uses an evolutionary algorithm to test thousands of parameter combinations, converging on optimal configurations through iterative refinement. This allows users to fine-tune grid spacing, leverage levels, take-profit margins, and more—without manual trial and error.
👉 See how professional traders optimize their bots
Frequently Asked Questions (FAQ)
Q: Is Passivbot suitable for beginners?
A: While Passivbot is powerful, it assumes familiarity with futures trading, risk management, and command-line tools. Beginners should start with demo accounts and thoroughly understand the strategy before deploying real funds.
Q: Does Passivbot work on spot markets?
A: No. Passivbot operates exclusively on perpetual futures contracts across supported exchanges.
Q: Can I run Passivbot 24/7 on a VPS?
A: Yes. Many users deploy it on cloud servers like AWS, DigitalOcean, or Hetzner for uninterrupted operation.
Q: How does the unsticking mechanism affect profitability?
A: By cutting small losses early, it frees up margin for better opportunities. While it may realize minor losses, it prevents larger drawdowns during prolonged trends.
Q: Are there GUI options available?
A: While native UI isn't included, third-party tools like PBGUI offer graphical interfaces to simplify configuration and monitoring.
Q: Is there pre-optimized configuration data available?
A: Community-driven configuration databases are emerging. Check external resources like PBConfigDB for shared setups tailored to specific coins and market regimes.
Final Thoughts
Passivbot stands out as a sophisticated, community-driven solution for automated futures trading. Its focus on market-making logic, combined with features like trailing orders, Forager-based market selection, and intelligent unsticking, makes it well-suited for navigating choppy or range-bound markets.
With proper configuration and risk controls, it can be a valuable addition to any trader’s toolkit—especially those looking to automate without relying on predictive analytics.
👉 Start building smarter trading strategies today
The project remains open-source and freely available under a permissive license, encouraging collaboration, modification, and innovation from developers and traders worldwide.