pyokx.InstrumentSearcher

class pyokx.InstrumentSearcher.InstrumentSearcher(instTypes=['FUTURES', 'SWAP'], _instrument_map=None)[source]

Bases: object

Provides functionality to search for instruments within a provided list of instruments based on various criteria such as instrument ID, type, or underlying asset.

Parameters:

instruments (List[Instrument]) – A list of instruments to search within.

find_by_instId()[source]

Returns an instrument matching a specific instrument ID.

find_by_type()[source]

Returns all instruments of a specific type.

find_by_underlying()[source]

Returns all instruments with a specific underlying asset.

find_by_instId(instId: str) Instrument | None[source]

Find an instrument by its instId

find_by_type(instType: InstType) List[Instrument][source]

Find all instruments of a specific type

find_by_underlying(underlying: str) List[Instrument][source]

Find all instruments of a specific underlying

get_instrument_ids(instType: InstType | None = None) List[str][source]

Get all instrument IDs

request_instruments()[source]
async update_instruments()[source]

Update the instruments list

Inheritance diagram of pyokx.InstrumentSearcher