pyokx.ws_data_structures
- class pyokx.ws_data_structures.AccountChannel(*, arg: AccountChannelReturnArgs, data: List[AccountBalanceData])[source]
Bases:
OKXBaseModel
- arg: AccountChannelReturnArgs = 'arg'
- data: List[AccountBalanceData] = 'data'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=AccountChannelReturnArgs, required=True), 'data': FieldInfo(annotation=List[AccountBalanceData], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.AccountChannelInputArgs(*, channel: str, ccy: str | None = None, extraParams: str | None = None)[source]
Bases:
OKXBaseModel
- ccy: str | None = 'ccy'
- channel: str = 'channel'
- extraParams: str | None = 'extraParams'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'ccy': FieldInfo(annotation=Union[str, NoneType], required=False), 'channel': FieldInfo(annotation=str, required=True), 'extraParams': FieldInfo(annotation=Union[str, NoneType], required=False)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.AccountChannelReturnArgs(*, channel: str, uid: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'uid': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- uid: str = 'uid'
- class pyokx.ws_data_structures.AlgoOrdersChannel(*, arg: AlgoOrdersChannelReturnArgs, data: List[WSAlgoOrder])[source]
Bases:
OKXBaseModel
- arg: AlgoOrdersChannelReturnArgs = 'arg'
- data: List[WSAlgoOrder] = 'data'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=AlgoOrdersChannelReturnArgs, required=True), 'data': FieldInfo(annotation=List[WSAlgoOrder], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.AlgoOrdersChannelInputArgs(*, channel: str, instType: str, instFamily: str | None = None, instId: str | None = None)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instFamily: str | None = 'instFamily'
- instId: str | None = 'instId'
- instType: str = 'instType'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instFamily': FieldInfo(annotation=Union[str, NoneType], required=False), 'instId': FieldInfo(annotation=Union[str, NoneType], required=False), 'instType': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.AlgoOrdersChannelReturnArgs(*, channel: str, uid: str, instType: str, instFamily: str | None = None, instId: str | None = None)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instFamily: str | None = 'instFamily'
- instId: str | None = 'instId'
- instType: str = 'instType'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instFamily': FieldInfo(annotation=Union[str, NoneType], required=False), 'instId': FieldInfo(annotation=Union[str, NoneType], required=False), 'instType': FieldInfo(annotation=str, required=True), 'uid': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- uid: str = 'uid'
- class pyokx.ws_data_structures.BalanceAndPositionData(*, pTime: str, eventType: str, balData: List[ws_balData_element], posData: List[ws_posData_element], trades: List[ws_trades_element])[source]
Bases:
OKXBaseModel
- balData: List[ws_balData_element] = 'balData'
- eventType: str = 'eventType'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'balData': FieldInfo(annotation=List[ws_balData_element], required=True), 'eventType': FieldInfo(annotation=str, required=True), 'pTime': FieldInfo(annotation=str, required=True), 'posData': FieldInfo(annotation=List[ws_posData_element], required=True), 'trades': FieldInfo(annotation=List[ws_trades_element], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- pTime: str = 'pTime'
- posData: List[ws_posData_element] = 'posData'
- trades: List[ws_trades_element] = 'trades'
- class pyokx.ws_data_structures.BalanceAndPositionsChannel(*, arg: BalanceAndPositionsChannelReturnArgs, data: List[BalanceAndPositionData])[source]
Bases:
OKXBaseModel
- arg: BalanceAndPositionsChannelReturnArgs = 'arg'
- data: List[BalanceAndPositionData] = 'data'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=BalanceAndPositionsChannelReturnArgs, required=True), 'data': FieldInfo(annotation=List[BalanceAndPositionData], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.BalanceAndPositionsChannelInputArgs(*, channel: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.BalanceAndPositionsChannelReturnArgs(*, channel: str, uid: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'uid': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- uid: str = 'uid'
- class pyokx.ws_data_structures.CandleStick(*, timestamp: str, open: str, high: str, low: str, close: str, is_closed: str)[source]
Bases:
OKXBaseModel
- close: str = 'close'
- high: str = 'high'
- is_closed: str = 'is_closed'
- low: str = 'low'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'close': FieldInfo(annotation=str, required=True), 'high': FieldInfo(annotation=str, required=True), 'is_closed': FieldInfo(annotation=str, required=True), 'low': FieldInfo(annotation=str, required=True), 'open': FieldInfo(annotation=str, required=True), 'timestamp': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- open: str = 'open'
- timestamp: str = 'timestamp'
- class pyokx.ws_data_structures.IndexCandleSticksChannel(*, arg: IndexCandleSticksChannelInputArgs, data: List[CandleStick])[source]
Bases:
OKXBaseModel
- arg: IndexCandleSticksChannelInputArgs = 'arg'
- data: List[CandleStick] = 'data'
- static from_array(arg: IndexCandleSticksChannelInputArgs, data)[source]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=IndexCandleSticksChannelInputArgs, required=True), 'data': FieldInfo(annotation=List[CandleStick], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.IndexCandleSticksChannelInputArgs(*, channel: str, instId: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.IndexTickers(*, instId: str, idxPx: str, high24h: str, low24h: str, open24h: str, sodUtc0: str, sodUtc8: str, ts: str)[source]
Bases:
OKXBaseModel
- high24h: str = 'high24h'
- idxPx: str = 'idxPx'
- instId: str = 'instId'
- low24h: str = 'low24h'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'high24h': FieldInfo(annotation=str, required=True), 'idxPx': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True), 'low24h': FieldInfo(annotation=str, required=True), 'open24h': FieldInfo(annotation=str, required=True), 'sodUtc0': FieldInfo(annotation=str, required=True), 'sodUtc8': FieldInfo(annotation=str, required=True), 'ts': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- open24h: str = 'open24h'
- sodUtc0: str = 'sodUtc0'
- sodUtc8: str = 'sodUtc8'
- ts: str = 'ts'
- class pyokx.ws_data_structures.IndexTickersChannel(*, arg: IndexTickersChannelInputArgs, data: List[IndexTickers])[source]
Bases:
OKXBaseModel
- arg: IndexTickersChannelInputArgs = 'arg'
- data: List[IndexTickers] = 'data'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=IndexTickersChannelInputArgs, required=True), 'data': FieldInfo(annotation=List[IndexTickers], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.IndexTickersChannelInputArgs(*, channel: str, instId: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.InstrumentStatusReport(*, instId: str, positions: List[WSPosition], orders: List[Order], algo_orders: List[Algo_Order], timestamp: str = '2024-03-01 22:30:10')[source]
Bases:
OKXBaseModel
- algo_orders: List[Algo_Order] = 'algo_orders'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'algo_orders': FieldInfo(annotation=List[Algo_Order], required=True), 'instId': FieldInfo(annotation=str, required=True), 'orders': FieldInfo(annotation=List[Order], required=True), 'positions': FieldInfo(annotation=List[WSPosition], required=True), 'timestamp': FieldInfo(annotation=str, required=False, default='2024-03-01 22:30:10')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- positions: List[WSPosition] = 'positions'
- timestamp: str = 'timestamp'
- class pyokx.ws_data_structures.InstrumentsChannel(*, arg: InstrumentsChannelInputArgs, data: List[Instrument])[source]
Bases:
OKXBaseModel
- arg: InstrumentsChannelInputArgs = 'arg'
- data: List[Instrument] = 'data'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=InstrumentsChannelInputArgs, required=True), 'data': FieldInfo(annotation=List[Instrument], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.InstrumentsChannelInputArgs(*, channel: str, instType: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instType: str = 'instType'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instType': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.MarkPrice(*, instType: str, instId: str, markPx: str, ts: str)[source]
Bases:
OKXBaseModel
- instId: str = 'instId'
- instType: str = 'instType'
- markPx: str = 'markPx'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'instId': FieldInfo(annotation=str, required=True), 'instType': FieldInfo(annotation=str, required=True), 'markPx': FieldInfo(annotation=str, required=True), 'ts': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- ts: str = 'ts'
- class pyokx.ws_data_structures.MarkPriceCandleSticksChannel(*, arg: MarkPriceChannelInputArgs, data: List[CandleStick])[source]
Bases:
OKXBaseModel
- arg: MarkPriceChannelInputArgs = 'arg'
- data: List[CandleStick] = 'data'
- static from_array(arg: MarkPriceCandleSticksChannelInputArgs, data)[source]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=MarkPriceChannelInputArgs, required=True), 'data': FieldInfo(annotation=List[CandleStick], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.MarkPriceCandleSticksChannelInputArgs(*, channel: str, instId: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.MarkPriceChannel(*, arg: MarkPriceChannelInputArgs, data: List[MarkPrice])[source]
Bases:
OKXBaseModel
- arg: MarkPriceChannelInputArgs = 'arg'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=MarkPriceChannelInputArgs, required=True), 'data': FieldInfo(annotation=List[MarkPrice], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.MarkPriceChannelInputArgs(*, channel: str, instId: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.OrderBookChannel(*, arg: OrderBookReturnArgs, data: List[OrderBookData], action: str | None = None)[source]
Bases:
OKXBaseModel
- action: str | None = 'action'
- arg: OrderBookReturnArgs = 'arg'
- data: List[OrderBookData] = 'data'
- static from_array(arg: OrderBookReturnArgs, data, action: str | None = None)[source]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'action': FieldInfo(annotation=Union[str, NoneType], required=False), 'arg': FieldInfo(annotation=OrderBookReturnArgs, required=True), 'data': FieldInfo(annotation=List[OrderBookData], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.OrderBookData(*, asks: List[Ask], bids: List[Bid], ts: str, seqId: int, instId: str | None = None, checksum: int | None = None, prevSeqId: int | None = None)[source]
Bases:
OKXBaseModel
- checksum: int | None = 'checksum'
- instId: str | None = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'asks': FieldInfo(annotation=List[Ask], required=True), 'bids': FieldInfo(annotation=List[Bid], required=True), 'checksum': FieldInfo(annotation=Union[int, NoneType], required=False), 'instId': FieldInfo(annotation=Union[str, NoneType], required=False), 'prevSeqId': FieldInfo(annotation=Union[int, NoneType], required=False), 'seqId': FieldInfo(annotation=int, required=True), 'ts': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- prevSeqId: int | None = 'prevSeqId'
- seqId: int = 'seqId'
- ts: str = 'ts'
- class pyokx.ws_data_structures.OrderBookInputArgs(*, channel: str, instId: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.OrderBookReturnArgs(*, channel: str, instId: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.OrdersChannel(*, arg: OrdersChannelReturnArgs, data: List[WSOrder])[source]
Bases:
OKXBaseModel
- arg: OrdersChannelReturnArgs = 'arg'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=OrdersChannelReturnArgs, required=True), 'data': FieldInfo(annotation=List[WSOrder], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.OrdersChannelInputArgs(*, channel: str, instType: str, instFamily: str | None = None, instId: str | None = None)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instFamily: str | None = 'instFamily'
- instId: str | None = 'instId'
- instType: str = 'instType'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instFamily': FieldInfo(annotation=Union[str, NoneType], required=False), 'instId': FieldInfo(annotation=Union[str, NoneType], required=False), 'instType': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.OrdersChannelReturnArgs(*, channel: str, instType: str, uid: str, instFamily: str | None = None, instId: str | None = None)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instFamily: str | None = 'instFamily'
- instId: str | None = 'instId'
- instType: str = 'instType'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instFamily': FieldInfo(annotation=Union[str, NoneType], required=False), 'instId': FieldInfo(annotation=Union[str, NoneType], required=False), 'instType': FieldInfo(annotation=str, required=True), 'uid': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- uid: str = 'uid'
- class pyokx.ws_data_structures.PositionsChannel(*, arg: PositionsChannelReturnArgs, data: List[WSPosition])[source]
Bases:
OKXBaseModel
- arg: PositionsChannelReturnArgs = 'arg'
- data: List[WSPosition] = 'data'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=PositionsChannelReturnArgs, required=True), 'data': FieldInfo(annotation=List[WSPosition], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.PositionsChannelInputArgs(*, channel: str, instType: str, instFamily: str | None = None, instId: str | None = None, extraParams: str | None = None)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- extraParams: str | None = 'extraParams'
- instFamily: str | None = 'instFamily'
- instId: str | None = 'instId'
- instType: str = 'instType'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'extraParams': FieldInfo(annotation=Union[str, NoneType], required=False), 'instFamily': FieldInfo(annotation=Union[str, NoneType], required=False), 'instId': FieldInfo(annotation=Union[str, NoneType], required=False), 'instType': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.PositionsChannelReturnArgs(*, channel: str, uid: str, instType: str, instFamily: str | None = None, instId: str | None = None)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instFamily: str | None = 'instFamily'
- instId: str | None = 'instId'
- instType: str = 'instType'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instFamily': FieldInfo(annotation=Union[str, NoneType], required=False), 'instId': FieldInfo(annotation=Union[str, NoneType], required=False), 'instType': FieldInfo(annotation=str, required=True), 'uid': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- uid: str = 'uid'
- class pyokx.ws_data_structures.PriceLimit(*, instId: str, buyLmt: str, sellLmt: str, ts: str, enabled: bool)[source]
Bases:
OKXBaseModel
- buyLmt: str = 'buyLmt'
- enabled: bool = 'enabled'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'buyLmt': FieldInfo(annotation=str, required=True), 'enabled': FieldInfo(annotation=bool, required=True), 'instId': FieldInfo(annotation=str, required=True), 'sellLmt': FieldInfo(annotation=str, required=True), 'ts': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- sellLmt: str = 'sellLmt'
- ts: str = 'ts'
- class pyokx.ws_data_structures.PriceLimitChannel(*, arg: PriceLimitChannelInputArgs, data: List[PriceLimit])[source]
Bases:
OKXBaseModel
- arg: PriceLimitChannelInputArgs = 'arg'
- data: List[PriceLimit] = 'data'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=PriceLimitChannelInputArgs, required=True), 'data': FieldInfo(annotation=List[PriceLimit], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.PriceLimitChannelInputArgs(*, channel: str, instId: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.TickersChannel(*, arg: TickersChannelReturnArgs, data: List[Ticker])[source]
Bases:
OKXBaseModel
- arg: TickersChannelReturnArgs = 'arg'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'arg': FieldInfo(annotation=TickersChannelReturnArgs, required=True), 'data': FieldInfo(annotation=List[Ticker], required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.TickersChannelInputArgs(*, channel: str, instId: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.TickersChannelReturnArgs(*, channel: str, instId: str)[source]
Bases:
OKXBaseModel
- channel: str = 'channel'
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channel': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class pyokx.ws_data_structures.WSAlgoOrder(*, instType: str, instId: str, ccy: str, ordId: str, ordIdList: list, algoId: str, clOrdId: str, sz: str, ordType: str, side: str, posSide: str, tdMode: str, tgtCcy: str, lever: str, state: str, tpTriggerPx: str, tpTriggerPxType: str, tpOrdPx: str, slTriggerPx: str, slTriggerPxType: str, slOrdPx: str, triggerPx: str, triggerPxType: str, ordPx: str, last: str, actualSz: str, actualPx: str, notionalUsd: str, tag: str, actualSide: str, triggerTime: str, reduceOnly: str, failCode: str, algoClOrdId: str, cTime: str, reqId: str, amendResult: str, amendPxOnTriggerType: str, attachAlgoOrds: list)[source]
Bases:
OKXBaseModel
- actualPx: str = 'actualPx'
- actualSide: str = 'actualSide'
- actualSz: str = 'actualSz'
- algoClOrdId: str = 'algoClOrdId'
- algoId: str = 'algoId'
- amendPxOnTriggerType: str = 'amendPxOnTriggerType'
- amendResult: str = 'amendResult'
- attachAlgoOrds: list = 'attachAlgoOrds'
- cTime: str = 'cTime'
- ccy: str = 'ccy'
- clOrdId: str = 'clOrdId'
- failCode: str = 'failCode'
- instId: str = 'instId'
- instType: str = 'instType'
- last: str = 'last'
- lever: str = 'lever'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'actualPx': FieldInfo(annotation=str, required=True), 'actualSide': FieldInfo(annotation=str, required=True), 'actualSz': FieldInfo(annotation=str, required=True), 'algoClOrdId': FieldInfo(annotation=str, required=True), 'algoId': FieldInfo(annotation=str, required=True), 'amendPxOnTriggerType': FieldInfo(annotation=str, required=True), 'amendResult': FieldInfo(annotation=str, required=True), 'attachAlgoOrds': FieldInfo(annotation=list, required=True), 'cTime': FieldInfo(annotation=str, required=True), 'ccy': FieldInfo(annotation=str, required=True), 'clOrdId': FieldInfo(annotation=str, required=True), 'failCode': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True), 'instType': FieldInfo(annotation=str, required=True), 'last': FieldInfo(annotation=str, required=True), 'lever': FieldInfo(annotation=str, required=True), 'notionalUsd': FieldInfo(annotation=str, required=True), 'ordId': FieldInfo(annotation=str, required=True), 'ordIdList': FieldInfo(annotation=list, required=True), 'ordPx': FieldInfo(annotation=str, required=True), 'ordType': FieldInfo(annotation=str, required=True), 'posSide': FieldInfo(annotation=str, required=True), 'reduceOnly': FieldInfo(annotation=str, required=True), 'reqId': FieldInfo(annotation=str, required=True), 'side': FieldInfo(annotation=str, required=True), 'slOrdPx': FieldInfo(annotation=str, required=True), 'slTriggerPx': FieldInfo(annotation=str, required=True), 'slTriggerPxType': FieldInfo(annotation=str, required=True), 'state': FieldInfo(annotation=str, required=True), 'sz': FieldInfo(annotation=str, required=True), 'tag': FieldInfo(annotation=str, required=True), 'tdMode': FieldInfo(annotation=str, required=True), 'tgtCcy': FieldInfo(annotation=str, required=True), 'tpOrdPx': FieldInfo(annotation=str, required=True), 'tpTriggerPx': FieldInfo(annotation=str, required=True), 'tpTriggerPxType': FieldInfo(annotation=str, required=True), 'triggerPx': FieldInfo(annotation=str, required=True), 'triggerPxType': FieldInfo(annotation=str, required=True), 'triggerTime': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- notionalUsd: str = 'notionalUsd'
- ordId: str = 'ordId'
- ordIdList: list = 'ordIdList'
- ordPx: str = 'ordPx'
- ordType: str = 'ordType'
- posSide: str = 'posSide'
- reduceOnly: str = 'reduceOnly'
- reqId: str = 'reqId'
- side: str = 'side'
- slOrdPx: str = 'slOrdPx'
- slTriggerPx: str = 'slTriggerPx'
- slTriggerPxType: str = 'slTriggerPxType'
- state: str = 'state'
- sz: str = 'sz'
- tag: str = 'tag'
- tdMode: str = 'tdMode'
- tgtCcy: str = 'tgtCcy'
- tpOrdPx: str = 'tpOrdPx'
- tpTriggerPx: str = 'tpTriggerPx'
- tpTriggerPxType: str = 'tpTriggerPxType'
- triggerPx: str = 'triggerPx'
- triggerPxType: str = 'triggerPxType'
- triggerTime: str = 'triggerTime'
- class pyokx.ws_data_structures.WSOrder(*, accFillSz: str, algoClOrdId: str, algoId: str, amendResult: str, amendSource: str, attachAlgoClOrdId: str, attachAlgoOrds: list, avgPx: str, cTime: str, cancelSource: str, category: str, ccy: str, clOrdId: str, code: str, execType: str, fee: str, feeCcy: str, fillFee: str, fillFeeCcy: str, fillFwdPx: str, fillMarkPx: str, fillMarkVol: str, fillNotionalUsd: str, fillPnl: str, fillPx: str, fillPxUsd: str, fillPxVol: str, fillSz: str, fillTime: str, instId: str, instType: str, lastPx: str, lever: str, msg: str, notionalUsd: str, ordId: str, ordType: str, pnl: str, posSide: str, px: str, pxType: str, pxUsd: str, pxVol: str, quickMgnType: str, rebate: str, rebateCcy: str, reduceOnly: str, reqId: str, side: str, slOrdPx: str, slTriggerPx: str, slTriggerPxType: str, source: str, state: str, stpId: str, stpMode: str, sz: str, tag: str, tdMode: str, tgtCcy: str, tpOrdPx: str, tpTriggerPx: str, tpTriggerPxType: str, tradeId: str, uTime: str)[source]
Bases:
OKXBaseModel
- accFillSz: str = 'accFillSz'
- algoClOrdId: str = 'algoClOrdId'
- algoId: str = 'algoId'
- amendResult: str = 'amendResult'
- amendSource: str = 'amendSource'
- attachAlgoClOrdId: str = 'attachAlgoClOrdId'
- attachAlgoOrds: list = 'attachAlgoOrds'
- avgPx: str = 'avgPx'
- cTime: str = 'cTime'
- cancelSource: str = 'cancelSource'
- category: str = 'category'
- ccy: str = 'ccy'
- clOrdId: str = 'clOrdId'
- code: str = 'code'
- execType: str = 'execType'
- fee: str = 'fee'
- feeCcy: str = 'feeCcy'
- fillFee: str = 'fillFee'
- fillFeeCcy: str = 'fillFeeCcy'
- fillFwdPx: str = 'fillFwdPx'
- fillMarkPx: str = 'fillMarkPx'
- fillMarkVol: str = 'fillMarkVol'
- fillNotionalUsd: str = 'fillNotionalUsd'
- fillPnl: str = 'fillPnl'
- fillPx: str = 'fillPx'
- fillPxUsd: str = 'fillPxUsd'
- fillPxVol: str = 'fillPxVol'
- fillSz: str = 'fillSz'
- fillTime: str = 'fillTime'
- instId: str = 'instId'
- instType: str = 'instType'
- lastPx: str = 'lastPx'
- lever: str = 'lever'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'accFillSz': FieldInfo(annotation=str, required=True), 'algoClOrdId': FieldInfo(annotation=str, required=True), 'algoId': FieldInfo(annotation=str, required=True), 'amendResult': FieldInfo(annotation=str, required=True), 'amendSource': FieldInfo(annotation=str, required=True), 'attachAlgoClOrdId': FieldInfo(annotation=str, required=True), 'attachAlgoOrds': FieldInfo(annotation=list, required=True), 'avgPx': FieldInfo(annotation=str, required=True), 'cTime': FieldInfo(annotation=str, required=True), 'cancelSource': FieldInfo(annotation=str, required=True), 'category': FieldInfo(annotation=str, required=True), 'ccy': FieldInfo(annotation=str, required=True), 'clOrdId': FieldInfo(annotation=str, required=True), 'code': FieldInfo(annotation=str, required=True), 'execType': FieldInfo(annotation=str, required=True), 'fee': FieldInfo(annotation=str, required=True), 'feeCcy': FieldInfo(annotation=str, required=True), 'fillFee': FieldInfo(annotation=str, required=True), 'fillFeeCcy': FieldInfo(annotation=str, required=True), 'fillFwdPx': FieldInfo(annotation=str, required=True), 'fillMarkPx': FieldInfo(annotation=str, required=True), 'fillMarkVol': FieldInfo(annotation=str, required=True), 'fillNotionalUsd': FieldInfo(annotation=str, required=True), 'fillPnl': FieldInfo(annotation=str, required=True), 'fillPx': FieldInfo(annotation=str, required=True), 'fillPxUsd': FieldInfo(annotation=str, required=True), 'fillPxVol': FieldInfo(annotation=str, required=True), 'fillSz': FieldInfo(annotation=str, required=True), 'fillTime': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True), 'instType': FieldInfo(annotation=str, required=True), 'lastPx': FieldInfo(annotation=str, required=True), 'lever': FieldInfo(annotation=str, required=True), 'msg': FieldInfo(annotation=str, required=True), 'notionalUsd': FieldInfo(annotation=str, required=True), 'ordId': FieldInfo(annotation=str, required=True), 'ordType': FieldInfo(annotation=str, required=True), 'pnl': FieldInfo(annotation=str, required=True), 'posSide': FieldInfo(annotation=str, required=True), 'px': FieldInfo(annotation=str, required=True), 'pxType': FieldInfo(annotation=str, required=True), 'pxUsd': FieldInfo(annotation=str, required=True), 'pxVol': FieldInfo(annotation=str, required=True), 'quickMgnType': FieldInfo(annotation=str, required=True), 'rebate': FieldInfo(annotation=str, required=True), 'rebateCcy': FieldInfo(annotation=str, required=True), 'reduceOnly': FieldInfo(annotation=str, required=True), 'reqId': FieldInfo(annotation=str, required=True), 'side': FieldInfo(annotation=str, required=True), 'slOrdPx': FieldInfo(annotation=str, required=True), 'slTriggerPx': FieldInfo(annotation=str, required=True), 'slTriggerPxType': FieldInfo(annotation=str, required=True), 'source': FieldInfo(annotation=str, required=True), 'state': FieldInfo(annotation=str, required=True), 'stpId': FieldInfo(annotation=str, required=True), 'stpMode': FieldInfo(annotation=str, required=True), 'sz': FieldInfo(annotation=str, required=True), 'tag': FieldInfo(annotation=str, required=True), 'tdMode': FieldInfo(annotation=str, required=True), 'tgtCcy': FieldInfo(annotation=str, required=True), 'tpOrdPx': FieldInfo(annotation=str, required=True), 'tpTriggerPx': FieldInfo(annotation=str, required=True), 'tpTriggerPxType': FieldInfo(annotation=str, required=True), 'tradeId': FieldInfo(annotation=str, required=True), 'uTime': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- msg: str = 'msg'
- notionalUsd: str = 'notionalUsd'
- ordId: str = 'ordId'
- ordType: str = 'ordType'
- pnl: str = 'pnl'
- posSide: str = 'posSide'
- px: str = 'px'
- pxType: str = 'pxType'
- pxUsd: str = 'pxUsd'
- pxVol: str = 'pxVol'
- quickMgnType: str = 'quickMgnType'
- rebate: str = 'rebate'
- rebateCcy: str = 'rebateCcy'
- reduceOnly: str = 'reduceOnly'
- reqId: str = 'reqId'
- side: str = 'side'
- slOrdPx: str = 'slOrdPx'
- slTriggerPx: str = 'slTriggerPx'
- slTriggerPxType: str = 'slTriggerPxType'
- source: str = 'source'
- state: str = 'state'
- stpId: str = 'stpId'
- stpMode: str = 'stpMode'
- sz: str = 'sz'
- tag: str = 'tag'
- tdMode: str = 'tdMode'
- tgtCcy: str = 'tgtCcy'
- tpOrdPx: str = 'tpOrdPx'
- tpTriggerPx: str = 'tpTriggerPx'
- tpTriggerPxType: str = 'tpTriggerPxType'
- tradeId: str = 'tradeId'
- uTime: str = 'uTime'
- class pyokx.ws_data_structures.WSPosition(*, instType: str, mgnMode: str, posId: str, posSide: str, pos: str, baseBal: str, quoteBal: str, baseBorrowed: str, baseInterest: str, quoteBorrowed: str, quoteInterest: str, posCcy: str, availPos: str, avgPx: str, upl: str, uplRatio: str, uplLastPx: str, uplRatioLastPx: str, instId: str, lever: str, liqPx: str, markPx: str, imr: str, margin: str, mgnRatio: str, mmr: str, liab: str, liabCcy: str, interest: str, tradeId: str, notionalUsd: str, optVal: str, adl: str, bizRefId: str, bizRefType: str, ccy: str, last: str, idxPx: str, usdPx: str, bePx: str, deltaBS: str, deltaPA: str, gammaBS: str, gammaPA: str, thetaBS: str, thetaPA: str, vegaBS: str, vegaPA: str, spotInUseAmt: str, spotInUseCcy: str, realizedPnl: str, pnl: str, fee: str, fundingFee: str, liqPenalty: str, closeOrderAlgo: List[dict], cTime: str, uTime: str, pTime: str)[source]
Bases:
OKXBaseModel
- adl: str = 'adl'
- availPos: str = 'availPos'
- avgPx: str = 'avgPx'
- baseBal: str = 'baseBal'
- baseBorrowed: str = 'baseBorrowed'
- baseInterest: str = 'baseInterest'
- bePx: str = 'bePx'
- bizRefId: str = 'bizRefId'
- bizRefType: str = 'bizRefType'
- cTime: str = 'cTime'
- ccy: str = 'ccy'
- closeOrderAlgo: List[dict] = 'closeOrderAlgo'
- deltaBS: str = 'deltaBS'
- deltaPA: str = 'deltaPA'
- fee: str = 'fee'
- fundingFee: str = 'fundingFee'
- gammaBS: str = 'gammaBS'
- gammaPA: str = 'gammaPA'
- idxPx: str = 'idxPx'
- imr: str = 'imr'
- instId: str = 'instId'
- instType: str = 'instType'
- interest: str = 'interest'
- last: str = 'last'
- lever: str = 'lever'
- liab: str = 'liab'
- liabCcy: str = 'liabCcy'
- liqPenalty: str = 'liqPenalty'
- liqPx: str = 'liqPx'
- margin: str = 'margin'
- markPx: str = 'markPx'
- mgnMode: str = 'mgnMode'
- mgnRatio: str = 'mgnRatio'
- mmr: str = 'mmr'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'adl': FieldInfo(annotation=str, required=True), 'availPos': FieldInfo(annotation=str, required=True), 'avgPx': FieldInfo(annotation=str, required=True), 'baseBal': FieldInfo(annotation=str, required=True), 'baseBorrowed': FieldInfo(annotation=str, required=True), 'baseInterest': FieldInfo(annotation=str, required=True), 'bePx': FieldInfo(annotation=str, required=True), 'bizRefId': FieldInfo(annotation=str, required=True), 'bizRefType': FieldInfo(annotation=str, required=True), 'cTime': FieldInfo(annotation=str, required=True), 'ccy': FieldInfo(annotation=str, required=True), 'closeOrderAlgo': FieldInfo(annotation=List[dict], required=True), 'deltaBS': FieldInfo(annotation=str, required=True), 'deltaPA': FieldInfo(annotation=str, required=True), 'fee': FieldInfo(annotation=str, required=True), 'fundingFee': FieldInfo(annotation=str, required=True), 'gammaBS': FieldInfo(annotation=str, required=True), 'gammaPA': FieldInfo(annotation=str, required=True), 'idxPx': FieldInfo(annotation=str, required=True), 'imr': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True), 'instType': FieldInfo(annotation=str, required=True), 'interest': FieldInfo(annotation=str, required=True), 'last': FieldInfo(annotation=str, required=True), 'lever': FieldInfo(annotation=str, required=True), 'liab': FieldInfo(annotation=str, required=True), 'liabCcy': FieldInfo(annotation=str, required=True), 'liqPenalty': FieldInfo(annotation=str, required=True), 'liqPx': FieldInfo(annotation=str, required=True), 'margin': FieldInfo(annotation=str, required=True), 'markPx': FieldInfo(annotation=str, required=True), 'mgnMode': FieldInfo(annotation=str, required=True), 'mgnRatio': FieldInfo(annotation=str, required=True), 'mmr': FieldInfo(annotation=str, required=True), 'notionalUsd': FieldInfo(annotation=str, required=True), 'optVal': FieldInfo(annotation=str, required=True), 'pTime': FieldInfo(annotation=str, required=True), 'pnl': FieldInfo(annotation=str, required=True), 'pos': FieldInfo(annotation=str, required=True), 'posCcy': FieldInfo(annotation=str, required=True), 'posId': FieldInfo(annotation=str, required=True), 'posSide': FieldInfo(annotation=str, required=True), 'quoteBal': FieldInfo(annotation=str, required=True), 'quoteBorrowed': FieldInfo(annotation=str, required=True), 'quoteInterest': FieldInfo(annotation=str, required=True), 'realizedPnl': FieldInfo(annotation=str, required=True), 'spotInUseAmt': FieldInfo(annotation=str, required=True), 'spotInUseCcy': FieldInfo(annotation=str, required=True), 'thetaBS': FieldInfo(annotation=str, required=True), 'thetaPA': FieldInfo(annotation=str, required=True), 'tradeId': FieldInfo(annotation=str, required=True), 'uTime': FieldInfo(annotation=str, required=True), 'upl': FieldInfo(annotation=str, required=True), 'uplLastPx': FieldInfo(annotation=str, required=True), 'uplRatio': FieldInfo(annotation=str, required=True), 'uplRatioLastPx': FieldInfo(annotation=str, required=True), 'usdPx': FieldInfo(annotation=str, required=True), 'vegaBS': FieldInfo(annotation=str, required=True), 'vegaPA': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- notionalUsd: str = 'notionalUsd'
- optVal: str = 'optVal'
- pTime: str = 'pTime'
- pnl: str = 'pnl'
- pos: str = 'pos'
- posCcy: str = 'posCcy'
- posId: str = 'posId'
- posSide: str = 'posSide'
- quoteBal: str = 'quoteBal'
- quoteBorrowed: str = 'quoteBorrowed'
- quoteInterest: str = 'quoteInterest'
- realizedPnl: str = 'realizedPnl'
- spotInUseAmt: str = 'spotInUseAmt'
- spotInUseCcy: str = 'spotInUseCcy'
- thetaBS: str = 'thetaBS'
- thetaPA: str = 'thetaPA'
- tradeId: str = 'tradeId'
- uTime: str = 'uTime'
- upl: str = 'upl'
- uplLastPx: str = 'uplLastPx'
- uplRatio: str = 'uplRatio'
- uplRatioLastPx: str = 'uplRatioLastPx'
- usdPx: str = 'usdPx'
- vegaBS: str = 'vegaBS'
- vegaPA: str = 'vegaPA'
- class pyokx.ws_data_structures.WebSocketConnectionConfig(*, name: str, wss_url: str, channels: dict = {})[source]
Bases:
OKXBaseModel
- channels: dict = 'channels'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'channels': FieldInfo(annotation=dict, required=False, default={}), 'name': FieldInfo(annotation=str, required=True), 'wss_url': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- name: str = 'name'
- wss_url: str = 'wss_url'
- class pyokx.ws_data_structures.ws_balData_element(*, ccy: str, cashBal: str, uTime: str)[source]
Bases:
OKXBaseModel
- cashBal: str = 'cashBal'
- ccy: str = 'ccy'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'cashBal': FieldInfo(annotation=str, required=True), 'ccy': FieldInfo(annotation=str, required=True), 'uTime': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- uTime: str = 'uTime'
- class pyokx.ws_data_structures.ws_posData_element(*, posId: str, tradeId: str, instId: str, instType: str, mgnMode: str, posSide: str, pos: str, ccy: str, posCcy: str, avgPx: str, uTime: str)[source]
Bases:
OKXBaseModel
- avgPx: str = 'avgPx'
- ccy: str = 'ccy'
- instId: str = 'instId'
- instType: str = 'instType'
- mgnMode: str = 'mgnMode'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'avgPx': FieldInfo(annotation=str, required=True), 'ccy': FieldInfo(annotation=str, required=True), 'instId': FieldInfo(annotation=str, required=True), 'instType': FieldInfo(annotation=str, required=True), 'mgnMode': FieldInfo(annotation=str, required=True), 'pos': FieldInfo(annotation=str, required=True), 'posCcy': FieldInfo(annotation=str, required=True), 'posId': FieldInfo(annotation=str, required=True), 'posSide': FieldInfo(annotation=str, required=True), 'tradeId': FieldInfo(annotation=str, required=True), 'uTime': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- pos: str = 'pos'
- posCcy: str = 'posCcy'
- posId: str = 'posId'
- posSide: str = 'posSide'
- tradeId: str = 'tradeId'
- uTime: str = 'uTime'
- class pyokx.ws_data_structures.ws_trades_element(*, instId: str, tradeId: str)[source]
Bases:
OKXBaseModel
- instId: str = 'instId'
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'instId': FieldInfo(annotation=str, required=True), 'tradeId': FieldInfo(annotation=str, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- tradeId: str = 'tradeId'
