Affiliate disclosure: Links to brokers (Exness, Deriv, Binance, Bybit, OKX, IQ Option, Pocket Option, Quotex) may earn us a referral commission. Your costs don't change. Our ratings don't either. Bybit links may earn us a referral commission. Risk disclosure: Independent research finds 70–84% of Polymarket traders lose money (Sergeenkov, April 2026; Akey et al., SSRN, March 2026). Forex CFDs: 70–85% retail loss rate. Binary options: 80%+ in most jurisdictions. AI agents don't change these baselines. Full disclaimer.
Bybit is the second-largest crypto futures exchange globally and the preferred venue for OpenClaw bots trading perpetual futures. This guide walks through setting up a futures bot — with the explicit warning that 80%+ of retail futures traders lose money and leverage amplifies both wins and losses.
If you've followed our Binance setup guide, much is similar. The differences are critical: leverage, liquidation, funding rates, and margin modes. Read this end-to-end before placing a single live trade.
TL;DR — The 30-second answer
- Futures = leverage. Leverage = liquidation risk.
- Even with stops, gaps and slippage can wipe accounts.
- Use isolated margin, not cross. Limit damage per trade.
- Start with 2x or 3x leverage maximum. Skip the headlines about 100x.
- Hard liquidation math: 5x = -20% move = liquidated. 25x = -4% = liquidated.
- OpenClaw + CCXT supports Bybit perpetuals natively.
Why futures are different (and dangerous)
In spot trading, if BTC drops 50% and you're holding 1 BTC, you still have 1 BTC — just worth half. In futures with 10x leverage and 1 BTC notional position, if BTC drops 10% your entire collateral is liquidated; you have $0.
Liquidation is the mechanism by which the exchange protects itself when your position can no longer cover its margin. Bybit triggers liquidation when your equity drops below the maintenance margin requirement. Once liquidation hits, your position is force-closed at market price — usually at unfavorable levels because the order book is moving against you.
The liquidation math

Rough liquidation math, assuming isolated margin mode (just your position's margin is at risk):
- 2x leverage: 50% adverse move to liquidate. Almost safe.
- 5x leverage: 20% adverse move. Possible in 1-2 days on BTC.
- 10x leverage: 10% adverse move. Possible in hours during volatility.
- 25x leverage: 4% adverse move. Possible in minutes.
- 100x leverage: 1% adverse move. Possible during one spike on a slow exchange.
Important: the above assumes no fees, no funding payments, and no slippage. Realistic liquidation often happens at smaller adverse moves because all three reduce your buffer.
Step 1 — Bybit API key setup
Same general process as Binance. Log into Bybit, navigate to API → Create New Key. Critical settings:
- System-generated: Yes
- API Type: Read-only + Contract Trade. NOT Spot, NOT Wallet, NOT Asset Conversion.
- Withdraw: NEVER. Same principle as Binance.
- IP Whitelist: Your VPS IP only.
- UID (sub-account): Use a sub-account if you have multiple bots. Limits cross-contamination.
Step 2 — Configure CCXT for Bybit perpetuals
openclaw config set ccxt.bybit.api_key YOUR_KEY
openclaw config set ccxt.bybit.api_secret YOUR_SECRET
openclaw config set ccxt.bybit.defaultType swap # perpetual futures
openclaw config set ccxt.bybit.testnet true # always testnet first
Test with: openclaw chat "check my Bybit balance". CCXT should return your USDT balance and any open positions. If errors, debug the API key permissions before moving on.
Step 3 — Set isolated margin mode (critical)
By default, Bybit uses cross margin — all positions share collateral. A liquidation on one position can drain other positions' margin. Switch to isolated margin for each symbol:
Via API: ccxt.bybit.set_margin_mode('isolated', 'BTC/USDT:USDT'). Repeat for each symbol you trade. This means each position has its own dedicated collateral and can only liquidate that collateral, not your whole account.
Counter-argument for cross margin: more capital efficiency, less likely to get liquidated. Counter-counter: if you have a strategy that can wipe accounts, isolated margin is your circuit breaker. Use isolated.
Step 4 — Set initial leverage (low)
For each symbol, set leverage:
ccxt.bybit.set_leverage(3, 'BTC/USDT:USDT') # 3x leverage on BTC perps
Recommended starting leverage: 2x or 3x. Skip the 25x/50x/100x posts you see on Twitter — those accounts blow up within weeks. The boring 2x-3x leverage traders are the ones who last.
Step 5 — Build the safe trading skill
Create ~/.openclaw/skills/safe-bybit-futures/SKILL.md:
---
name: safe-bybit-futures
description: "Trade Bybit perpetuals with hard caps on leverage, position, daily loss."
trigger: "long|short|perp|futures"
permissions:
- network
---
Before any order:
1. Verify symbol is in approved_symbols list (BTC, ETH only initially).
2. Verify leverage will be 2x or 3x. REFUSE if higher.
3. Compute position size in USDT. Cap at 0.02 * (USDT balance + open position value).
4. Compute estimated liquidation price. Distance from entry must be >5%.
5. Place order with stop_loss at 2% adverse, take_profit at 4% favorable.
6. After fill, send telegram with position details and liquidation price.
7. If daily P&L < -5%, close all positions and halt.
Step 6 — Understand funding rates
Perpetual futures don't expire. Instead, they use funding rates to keep prices anchored to spot. Every 8 hours, longs pay shorts (or vice versa) a small percentage based on the imbalance.
Practical impact: if you're long BTC perp and funding is +0.01% every 8 hours (typical), you pay 0.03%/day. Over a month: 0.9%. Over a year: 11%. This adds up. During hype cycles funding can spike to 0.1% / 8h (3%/day, 1080%/year annualized) — at that point holding a long position is paying a casino rate.
Strategy implication: if you're systematically long, choose times when funding is negative or near-zero. Some bots specifically trade the funding-rate side — collecting funding while hedging spot. That's a real strategy but adds complexity.
Step 7 — What you must monitor daily
- Open positions and their liquidation distance. If any position is within 2x your stop loss of liquidation, close it before the market moves.
- Funding rate. If you're paying >0.05% per 8h cumulatively, your alpha needs to clear that hurdle.
- USDT balance. Make sure it's enough to cover required margin. Top up before you get margin-called.
- Daily P&L. If trending toward -5% daily loss, manually intervene before kill-switch triggers.
- Bybit announcements. Maintenance windows, listing/delisting events, leverage changes all affect your positions.
📧 Get every new tutorial in your inbox
One email per week. Tutorials, CVE disclosures, broker updates. Unsubscribe in one click.
(Connect FluentCRM / ConvertKit / Beehiiv form here)
Frequently asked questions
Why not just use higher leverage for higher profit?
Higher leverage means smaller drawdowns can wipe accounts. The expected return is the same, but variance is much higher. Mathematically, optimal Kelly leverage for most strategies is 1-3x.
Can I do options on Bybit?
Yes, Bybit supports options. They're more complex than perpetuals. We don't cover them in this guide.
What if my position gets liquidated?
Bybit closes it at market. You lose your isolated margin. Other positions are unaffected (if you're using isolated margin).
Should I use cross margin if I'm experienced?
For most traders, no. Even experienced traders benefit from the circuit-breaker effect of isolated margin.
How do I exit during a flash crash?
Have a pre-configured close-all-positions command in a separate skill. If market is moving fast, manual intervention is too slow.
What to read next
- OpenClaw + Binance Setup Guide
- Binance vs Bybit vs OKX for Bots
- Crypto Arbitrage Realistic Expectations
- Hot Wallet Hygiene for Trading Bots
Sources cited: The Hacker News (CVE-2026-25253 disclosure, Feb 2026); Conscia 2026 OpenClaw Security Crisis advisory; Snyk ToxicSkills study; Cyber Press ClawHavoc reporting; Wall Street Journal Polymarket profitability analysis (May 2026); Andrey Sergeenkov via The Defiant (April 2026); Akey, Grégoire, Harvie & Martineau, SSRN paper (March 2026); openclaw.ai official advisories; Peter Steinberger public statements on X. Bybit API documentation; CCXT library docs; Bybit margin and leverage policies.