Market Information

Fetching Available Assets

Retrieve information about available assets using the get_assets() method:

assets = client.get_assets()

This method returns a list of Asset objects, each with the following attributes:

id: The unique identifier of the asset.
total_open_interest: The total open interest of the asset.
notional_volume_24h: The notional volume of the asset in the last 24 hours.
expiration_timestamps: The expiration timestamps of the asset.
total_options_open_interest: The total options open interest of the asset.
total_futures_open_interest: The total futures open interest of the asset.
options_notional_volume_24h: The options notional volume of the asset in the last 24 hours.
futures_notional_volume_24h: The futures notional volume of the asset in the last 24 hours.
name: The name of the asset.
ticker: The ticker of the asset.
underlying_price: The underlying price of the asset.
underlying_price_updated_at: The timestamp when the underlying price was last updated.

Fetching Market Instruments

Retrieve a list of instruments with optional filters using the get_markets() method:

instruments = client.get_markets(
    expiration_timestamp=expiration_timestamp,
    instrument_id=instrument_id,
    instrument_name=instrument_name,
    instrument_type=instrument_type,
    is_expired=is_expired,
    limit=limit,
    offset=offset,
    option_type=option_type,
    strike_price=strike_price
)

Parameters:

  • expiration_timestamp (Optional[Union[str, List[str]]]): Filter by expiration timestamp (default is None)
  • instrument_id (Optional[Union[int, List[int]]]): Filter by instrument ID (default is None)
  • instrument_name (Optional[Union[str, List[str]]]): Filter by instrument name (default is None)
  • instrument_type (Optional[Union[InstrumentType, List[InstrumentType]]]): Filter by instrument type (default is None)
  • is_expired (Optional[bool]): Filter by expired status (default is None)
  • limit (Optional[int]): Limit the number of results (default is None)
  • offset (Optional[int]): Offset the results (default is None)
  • option_type (Optional[Union[OptionType, List[OptionType]]]): Filter by option type (default is None)
  • strike_price (Optional[Union[float, List[float]]]): Filter by strike price (default is None)

The returned list contains Instrument objects with the following attributes:

  • id: The unique identifier of the instrument, as an int
  • asset: The asset related to the instrument, as a string
  • instrument_name: The name of the instrument, as a string
  • mark_price: The mark price of the instrument, as a float
  • expiration_timestamp: The expiration timestamp of the instrument, as a string
  • settlement_period: The settlement period of the instrument, as a string
  • mark_price_updated_at: The timestamp when the mark price was last updated, as a string
  • mark_price_iv: The implied volatility at the mark price, as a float
  • created_at: The timestamp when the instrument was created, as a string
  • instrument_type: The type of the instrument, as a string
  • strike_price (Optional): The strike price of the instrument (if applicable), as a float
  • option_type (Optional): The type of option (if the instrument is an option), as a string
  • underlying_price_at_expiration (Optional): The underlying price of the instrument at its expiration, as a float
  • best_bid (Optional): The best bid for the instrument, as a BBA object
  • best_ask (Optional): The best ask for the instrument, as a BBA object
  • open_interest (Optional): The open interest of the instrument, as a float
  • implied_volatility_bids (Optional): The implied volatility of the bids for the instrument, as a float
  • implied_volatility_asks (Optional): The implied volatility of the asks for the instrument, as a float
  • delta (Optional): The delta of the instrument, as a float
  • vega (Optional): The vega of the instrument, as a float
  • gamma (Optional): The gamma of the instrument, as a float
  • rho (Optional): The rho of the instrument, as a float
  • theta (Optional): The theta of the instrument, as a float

Fetching Orderbook Information

Retrieve the orderbook information for specified instrument(s) using the get_orderbook() method:

orderbook = client.get_orderbook(
    instrument_id=instrument_id,
    instrument_name=instrument_name,
    depth=depth
)

Parameters:

  • instrument_id (Optional[Union[int, List[int]]]): Instrument ID(s) to filter by (default is None)
  • instrument_name (Optional[Union[str, List[str]]]): Instrument name(s) to filter by (default is None)
  • depth (Optional[int]): The maximum number of levels to retrieve (default is None)

You must provide either instrument_id or instrument_name to retrieve the orderbook information, but not both.

The returned Orderbook object contains the following attributes:

  • bids: The list of bids in the orderbook, as a list of BidAsk objects
  • asks: The list of asks in the orderbook, as a list of BidAsk objects

Each BidAsk object has the following attributes:

  • price: The price of the bid or ask, as a float
  • quantity: The quantity of the bid or ask, as a float