cryptodatapy.extract.exchanges ============================== .. py:module:: cryptodatapy.extract.exchanges Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/cryptodatapy/extract/exchanges/dydx/index /autoapi/cryptodatapy/extract/exchanges/exchange/index Classes ------- .. autoapisummary:: cryptodatapy.extract.exchanges.Exchange cryptodatapy.extract.exchanges.Dydx Package Contents ---------------- .. py:class:: Exchange(name, exch_type, is_active, categories, assets, markets, market_types, fields, frequencies, fees, base_url, api_key, max_obs_per_call, rate_limit) Bases: :py:obj:`abc.ABC` Abstract base class for crypto exchanges (CEX or DEX). This class provides a blueprint for interacting with crypto exchanges, including authentication, data retrieval, and trading functionality. .. py:property:: name Returns the type of exchange. .. py:property:: exch_type Returns the type of exchange. .. py:property:: is_active Returns whether the exchange is active. .. py:property:: categories Returns a list of available categories for the data vendor. .. py:property:: assets Returns a list of available assets for the data vendor. .. py:property:: markets Returns a list of available markets for the data vendor. .. py:property:: market_types Returns a list of available market types for the data vendor. .. py:property:: fields Returns a list of available fields for the data vendor. .. py:property:: frequencies Returns a list of available data frequencies for the data vendor. .. py:property:: fees Returns a list of fees for the data vendor. .. py:property:: base_url Returns the base url for the data vendor. .. py:property:: api_key Returns the api key for the data vendor. .. py:property:: max_obs_per_call Returns the maximum observations per API call for the data vendor. .. py:property:: rate_limit Returns the number of API calls made and remaining. .. py:method:: get_assets_info() :abstractmethod: Gets info for available assets from the data vendor. .. py:method:: get_markets_info() :abstractmethod: Gets info for available markets from the data vendor. .. py:method:: get_fields_info(data_type: Optional[str]) :abstractmethod: Gets info for available fields from the data vendor. .. py:method:: get_frequencies_info(data_type: Optional[str]) :abstractmethod: Gets info for available frequencies from the exchange. .. py:method:: get_rate_limit_info() :abstractmethod: Gets the number of API calls made and remaining. .. py:method:: get_metadata() -> None :abstractmethod: Get exchange metadata. .. py:method:: get_data(data_req) -> pandas.DataFrame :abstractmethod: Submits get data request to API. .. py:method:: _wrangle_data_resp(data_req: cryptodatapy.extract.datarequest.DataRequest, data_resp: Union[Dict[str, Any], pandas.DataFrame]) -> pandas.DataFrame :staticmethod: :abstractmethod: Wrangles data response from data vendor API into tidy format. .. py:class:: Dydx(name: str = 'dydx', exch_type: str = 'dex', is_active: bool = True, categories: Union[str, List[str]] = 'crypto', assets: Optional[Dict[str, List[str]]] = None, markets: Optional[Dict[str, List[str]]] = None, market_types: List[str] = ['spot', 'future', 'perpetual_future', 'option'], fields: Optional[List[str]] = ['open', 'high', 'low', 'close', 'volume', 'funding_rate', 'oi'], frequencies: Optional[Dict[str, Union[str, int]]] = None, fees: Optional[Dict[str, float]] = {'spot': {'maker': 0.0, 'taker': 0.0}, 'perpetual_future': {'maker': 0.0, 'taker': 0.0}}, base_url: Optional[str] = None, api_key: Optional[str] = None, max_obs_per_call: Optional[int] = None, rate_limit: Optional[Any] = None) Bases: :py:obj:`cryptodatapy.extract.exchanges.exchange.Exchange` Retrieves data from dydx exchange. .. py:attribute:: data_req :value: None .. py:attribute:: data .. py:method:: get_assets_info() .. py:method:: get_markets_info() .. py:method:: get_fields_info(data_type: Optional[str]) .. py:method:: get_frequencies_info() .. py:method:: get_rate_limit_info() .. py:method:: get_metadata() .. py:method:: _fetch_ohlcv() .. py:method:: _fetch_funding_rates() .. py:method:: _fetch_open_interest() .. py:method:: _convert_params() .. py:method:: _wrangle_data_resp(data_req: cryptodatapy.extract.datarequest.DataRequest, data_resp: Union[Dict[str, Any], pandas.DataFrame]) -> pandas.DataFrame :staticmethod: .. py:method:: _fetch_tidy_ohlcv() .. py:method:: _fetch_tidy_funding_rates() .. py:method:: _fetch_tidy_open_interest() .. py:method:: get_data(data_req) -> pandas.DataFrame