Bybit

class BybitDataClientConfig

Bases: object

Configuration for the Bybit live data client.

base_url_http
base_url_ws_private
base_url_ws_public
environment
has_proxy_url
heartbeat_interval_secs
http_timeout_secs
instrument_status_poll_secs
max_retries
product_types
recv_window_ms
retry_delay_initial_ms
retry_delay_max_ms
transport_backend
update_instruments_interval_mins
class BybitDataClientFactory

Bases: object

Factory for creating Bybit data clients.

name()
class BybitEnvironment

Bases: object

Environments supported by the Bybit API stack.

DEMO = <BybitEnvironment.Demo: 1>
MAINNET = <BybitEnvironment.Mainnet: 0>
TESTNET = <BybitEnvironment.Testnet: 2>
classmethod from_str(data)
name
value
static variants()
class BybitExecClientConfig

Bases: object

Configuration for the Bybit live execution client.

account_id
auth_timeout_secs
auto_repay_spot_borrows
base_url_http
base_url_ws_private
base_url_ws_trade
environment
has_proxy_url
heartbeat_interval_secs
http_timeout_secs
margin_mode
max_retries
product_types
recv_window_ms
retry_delay_initial_ms
retry_delay_max_ms
transport_backend
use_spot_position_reports
class BybitExecutionClientFactory

Bases: object

Factory for creating Bybit execution clients.

name()
class BybitMarginAction

Bases: object

Margin actions for spot margin trading operations.

BORROW = <BybitMarginAction.borrow: 'borrow'>
GET_BORROW_AMOUNT = <BybitMarginAction.get_borrow_amount: 'get_borrow_amount'>
REPAY = <BybitMarginAction.repay: 'repay'>
classmethod from_str(data)
name
value
static variants()
class BybitMarginBorrowResult

Bases: object

Result from a Bybit borrow operation for strategy consumption.

amount
coin
message
success
ts_event
ts_init
class BybitMarginRepayResult

Bases: object

Result from a Bybit repay operation for strategy consumption.

amount
coin
message
result_status
success
ts_event
ts_init
class BybitMarginStatusResult

Bases: object

Result with current borrowed amount on Bybit.

borrow_amount
coin
ts_event
ts_init
class BybitPositionIdx

Bases: object

Position index values used for hedge mode payloads.

BUY_HEDGE = <BybitPositionIdx.BUY_HEDGE: 1>
ONE_WAY = <BybitPositionIdx.ONE_WAY: 0>
SELL_HEDGE = <BybitPositionIdx.SELL_HEDGE: 2>
classmethod from_str(data)
name
value
static variants()
class BybitPositionMode

Bases: object

Position mode as returned by the v5 API.

BOTH_SIDES = <BybitPositionMode.BOTH_SIDES: 3>
MERGED_SINGLE = <BybitPositionMode.MERGED_SINGLE: 0>
classmethod from_str(data)
name
value
static variants()
class BybitProductType

Bases: object

Product categories supported by the v5 API.

INVERSE = <BybitProductType.Inverse: 'inverse'>
LINEAR = <BybitProductType.Linear: 'linear'>
OPTION = <BybitProductType.Option: 'option'>
SPOT = <BybitProductType.Spot: 'spot'>
classmethod from_str(data)
name
value
static variants()
class BybitTickerData

Bases: object

Unified ticker data structure containing common fields across all product types.

This simplified ticker structure is designed to work across SPOT, LINEAR, and OPTION products, containing only the most commonly used fields.

ask1_price
ask1_size
bid1_price
bid1_size
funding_rate
high_price24h
index_price
last_price
low_price24h
mark_price
next_funding_time
open_interest
symbol
turnover24h
volume24h