agent0.core.base ================ .. py:module:: agent0.core.base .. autoapi-nested-parse:: The agent0 base module exports some types here. .. !! processed by numpydoc !! Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/agent0/core/base/agent/index /autoapi/agent0/core/base/make_key/index /autoapi/agent0/core/base/policies/index /autoapi/agent0/core/base/types/index /autoapi/agent0/core/base/types_test/index Attributes ---------- .. autoapisummary:: agent0.core.base.WEI Classes ------- .. autoapisummary:: agent0.core.base.BaseMarketAction agent0.core.base.EthWallet agent0.core.base.Freezable agent0.core.base.MarketType agent0.core.base.Quantity agent0.core.base.TokenType agent0.core.base.Trade Package Contents ---------------- .. py:class:: BaseMarketAction Bases: :py:obj:`Generic`\ [\ :py:obj:`T`\ ] Market action specification .. !! processed by numpydoc !! .. py:attribute:: action_type :type: T .. py:class:: EthWallet Stateful variable for storing what is in the agent's wallet. .. !! processed by numpydoc !! .. py:attribute:: address :type: hexbytes.HexBytes The associated agent's eth address. .. !! processed by numpydoc !! .. py:attribute:: balance :type: agent0.core.base.types.Quantity The base assets that held by the trader. .. !! processed by numpydoc !! .. py:method:: copy() -> EthWallet Return a new copy of self. :returns: A deepcopy of the wallet. :rtype: EthWallet .. !! processed by numpydoc !! .. py:method:: check_valid_wallet_state(dictionary: dict | None = None) -> None Test that all wallet state variables are greater than zero. :param dictionary: The dictionary to check. If not provided, it will use `self.__dict__`. :type dictionary: dict | None, optional .. !! processed by numpydoc !! .. py:data:: WEI .. py:class:: Freezable Config object with frozen attributes. .. !! processed by numpydoc !! .. py:method:: freeze() -> None Disallows changing existing members. .. !! processed by numpydoc !! .. py:method:: disable_new_attribs() -> None Disallows adding new members. .. !! processed by numpydoc !! .. py:method:: astype(new_type) Cast all member attributes to a new type. :param new_type: The type to cast to. :type new_type: Any .. !! processed by numpydoc !! .. py:property:: dtypes :type: dict[str, type] Return a dict listing name & type of each member variable. :returns: The named types of the class. :rtype: dict[str, type] .. !! processed by numpydoc !! .. py:class:: MarketType Bases: :py:obj:`enum.Enum` A type of market. .. !! processed by numpydoc !! .. py:attribute:: HYPERDRIVE :value: 'hyperdrive' .. py:attribute:: BORROW :value: 'borrow' .. py:class:: Quantity An amount with a unit. .. !! processed by numpydoc !! .. py:attribute:: amount :type: fixedpointmath.FixedPoint .. py:attribute:: unit :type: TokenType .. py:class:: TokenType Bases: :py:obj:`enum.Enum` A type of token. .. !! processed by numpydoc !! .. py:attribute:: BASE :value: 'base' .. py:class:: Trade Bases: :py:obj:`Generic`\ [\ :py:obj:`MarketAction`\ ] A trade for a market. .. !! processed by numpydoc !! .. py:attribute:: market_type :type: MarketType .. py:attribute:: market_action :type: MarketAction