Bybit
A leading derivatives exchange with a unified trading account supporting spot, perpetuals, futures, and options.
Overview
| Property | Value |
|---|---|
| Website | bybit.com |
| Account Model | Unified account |
| Passphrase Required | No |
| API Documentation | Bybit API Docs |
Credential Requirements
| Field | Required | Description |
|---|---|---|
apiKey | ✓ | API Key from Bybit |
apiSecret | ✓ | Secret Key from Bybit |
apiPassphrase | - | Not required |
Account Types
Bybit offers both unified and legacy account types.
| External ID | Account Type | Description |
|---|---|---|
unified | UNIFIED | Unified Trading Account (UTA) |
spot | SPOT | Legacy spot account |
contract | FUTURES | Legacy derivatives account |
fund | FUNDING | Funding account |
tip
We recommend using the Unified Trading Account for the best experience. It provides access to all trading products with shared collateral.
Trading Features
| Feature | Supported | Notes |
|---|---|---|
| Spot Trading | ✓ | |
| Cross Margin | ✓ | Unified account margin |
| Isolated Margin | ✓ | Per-position margin |
| USDT Perpetuals | ✓ | Up to 100x leverage |
| USDC Perpetuals | ✓ | Up to 100x leverage |
| Inverse Perpetuals | ✓ | Coin-margined |
| Options | ✓ | USDC-settled options |
Position Modes
Bybit unified account supports:
| Mode | Description |
|---|---|
| One-Way | Single position per symbol |
| Hedge | Long and short positions simultaneously |
Supported Order Types
| Order Type | Spot | Derivatives |
|---|---|---|
| Market | ✓ | ✓ |
| Limit | ✓ | ✓ |
| Stop Limit | ✓ | ✓ |
| Stop Market | ✓ | ✓ |
| Trailing Stop | - | ✓ |
| Take Profit / Stop Loss | - | ✓ |
| Conditional | ✓ | ✓ |
API Key Setup
Step 1: Access API Management
- Log in to Bybit
- Click on your profile icon
- Select API from the dropdown
Step 2: Create API Key
- Click Create New Key
- Select System-generated API Keys
- Enter a name for the API key
Step 3: Configure Permissions
| Permission | Description | Required For |
|---|---|---|
| Read-Only | Read account info only | View-only access |
| Read-Write | Full trading access | Trading |
Select specific permissions:
| Category | Permission | Required For |
|---|---|---|
| Wallet | Read | Portfolio balances |
| Spot | Trade | Spot orders |
| Contract | Trade | Derivatives orders |
| Unified Trading | Trade | UTA orders |
warning
Never enable "Withdraw" - Cadenza does not require withdrawal permissions.
Step 4: IP Restrictions (Recommended)
- Enable Bind to IP addresses
- Add Cadenza's IP addresses
- Click Submit
Step 5: Save Credentials
- Copy the API Key
- Copy the Secret Key
- Store both securely
Rate Limits
| Endpoint Type | Limit |
|---|---|
| Order placement | 10 requests/second |
| Order cancellation | 10 requests/second |
| Position query | 50 requests/second |
Example: Create Bybit Credential
- Python
- TypeScript
- Go
response = credential_api.create_trading_account_credential(
cadenza_client.CreateTradingAccountCredentialRequest(
venue=cadenza_client.Venue.BYBIT,
credential_type=cadenza_client.CredentialType.EXCHANGE,
api_key="your-bybit-api-key",
api_secret="your-bybit-secret-key",
nickname="My Bybit API"
)
)
const response = await credentialApi.createTradingAccountCredential({
venue: 'BYBIT',
credentialType: 'EXCHANGE',
apiKey: 'your-bybit-api-key',
apiSecret: 'your-bybit-secret-key',
nickname: 'My Bybit API',
})
response, _, err := apiClient.TradingAccountCredentialAPI.CreateTradingAccountCredential(ctx).
CreateTradingAccountCredentialRequest(client.CreateTradingAccountCredentialRequest{
Venue: client.VENUE_BYBIT,
CredentialType: client.CREDENTIALTYPE_EXCHANGE,
ApiKey: client.PtrString("your-bybit-api-key"),
ApiSecret: client.PtrString("your-bybit-secret-key"),
Nickname: client.PtrString("My Bybit API"),
}).Execute()
Example: Connect Bybit Account
- Python
- TypeScript
- Go
# Connect unified trading account
response = trading_account_api.connect_trading_account(
cadenza_client.ConnectTradingAccountRequest(
credential_ids=[credential_id],
external_trading_account_id="unified",
nickname="Bybit Unified"
)
)
trading_account_id = response.data.trading_account_id
print(f"Connected: {trading_account_id}")
// Connect unified trading account
const response = await tradingAccountApi.connectTradingAccount({
credentialIds: [credentialId],
externalTradingAccountId: 'unified',
nickname: 'Bybit Unified',
})
const tradingAccountId = response.data.data.tradingAccountId
console.log('Connected:', tradingAccountId)
// Connect unified trading account
response, _, err := apiClient.TradingAccountAPI.ConnectTradingAccount(ctx).
ConnectTradingAccountRequest(client.ConnectTradingAccountRequest{
CredentialIds: []string{credentialId},
ExternalTradingAccountId: "unified",
Nickname: client.PtrString("Bybit Unified"),
}).Execute()
tradingAccountId := *response.Data.TradingAccountId
fmt.Printf("Connected: %s\n", tradingAccountId)
Instrument ID Format
Bybit instruments use the format: BYBIT:{BASE}/{QUOTE}
| Instrument Type | Example |
|---|---|
| Spot | BYBIT:BTC/USDT |
| USDT Perpetual | BYBIT:BTC/USDT:USDT |
| USDC Perpetual | BYBIT:BTC/USDC:USDC |
| Inverse Perpetual | BYBIT:BTC/USD:BTC |
Unified Trading Account Benefits
- Single account - All products in one place
- Shared margin - Cross-collateral between assets
- Portfolio margin - Lower margin requirements
- Simplified management - No transfers between accounts