Crypto

Bybit Setup Guide

Time: 10 minutes | Difficulty: Moderate | Market: Crypto Mode: Full automation | API: V5 Unified API (REST + WebSocket) | Docs: bybit-exchange.github.io/docs

This guide wires a Bybit trading bot to the V5 Unified API using the botwir3 runtime. Configure API credentials, connect to spot or derivatives markets, and run automated crypto trading locally.


Before you start

Verify that automated operation is permitted under Bybit's current terms of service before deploying. botwir3 provides tools for building structured automation. The user is responsible for compliance with the platform's terms and all applicable regulations.

Jurisdiction. Bybit is not available in the United States or the United Kingdom. Bybit is also scaling back services in Japan in 2026. Verify availability in the applicable jurisdiction before proceeding.

Bybit Terms of Service | Last verified: May 2026

What you need

  • A Bybit account with identity verification complete
  • The botwir3 runtime downloaded and unzipped
  • A strategy config file from the builder

Step 1: Create API credentials

  1. Log in to bybit.com
  2. Navigate to Account → API Management
  3. Click Create New Key and select System-generated API Keys
  4. Under Permissions, enable Read-Write for the relevant account type (Unified Trading)
  5. Under IP Access Restrictions, bind the key to the IP address of the machine running the bot
  6. Copy the API Key and Secret Key

Permissions required: Read-Write access for Unified Trading Account. Permissions to disable: Withdrawal, Transfer. These scopes are not required for trading and can be left disabled.

🔒 Security. IP binding is required for Bybit API keys with trade permissions. New accounts have a 48-hour lockout before API key creation is available.

Step 2: Configure the adapter

Create adapter.json in the bot directory:

{
  "adapter": "bybit",
  "credentials": {
    "api_key": "paste-api-key-here",
    "api_secret": "paste-api-secret-here"
  },
  "trading_pair": "BTCUSDT",
  "category": "spot",
  "environment": "live",
  "rate_limit_ms": 100
}

Common trading pairs: BTCUSDT, ETHUSDT, SOLUSDT. Set category to "spot", "linear" (USDT perpetuals), or "inverse" depending on the strategy.

API keys are stored in a local config file on the machine running the bot. They are not transmitted to botwir3 or any third party. botwir3 never sees, stores, or has access to platform credentials.

Step 3: Test the connection

botwir3 test --adapter bybit

Expected output:

[botwir3] Adapter: bybit
[botwir3] Connection: OK
[botwir3] Permissions: READ_WRITE (unified)
[botwir3] Rate limit: weight-based (120 requests/5s for orders)

Step 4: Start the bot

botwir3 start --config my-strategy.json

The runtime loads the strategy, computes the spec hash, connects to Bybit via the local API credentials, and begins evaluating signals. The gate function compares proposed actions against the configured spec. The user is responsible for monitoring the bot and verifying execution outcomes.

Rate limits and considerations

EndpointLimitNotes
Order placement10 requests/secondPer UID. Applies to create, amend, cancel.
Market data120 requests/5 secondsPer UID.
WebSocket500 subscriptions/connectionPer connection.

Common Bybit bot configurations include perpetual futures grid trading, spot DCA strategies, and derivatives momentum trading on high-leverage pairs. Bybit's native bot suite (Grid, DCA, AI-powered Aurora) is a hosted alternative — botwir3 provides the local, air-gapped version with configurable discipline features. All actions and decisions are recorded in the local ledger.

Troubleshooting

ErrorCauseFix
CONNECTION_REFUSEDAPI key invalid or IP not boundVerify API key and bind the machine's IP in API Management
RATE_LIMITEDRequest limit exceededIncrease rate_limit_ms in adapter config
PERMISSION_DENIEDRead-Only key used for tradingCreate a new key with Read-Write permissions
INSUFFICIENT_FUNDSAccount balance cannot cover the proposed tradeReduce position sizing in strategy config
MANDATE_INTEGRITY_VIOLATIONConfig file modified while bot is runningStop the bot, verify config, restart

Related guides


One bot. $129. No subscription. No $749/mo platform. → Build for Bybit


Build your Bybit bot

Ready to build?