agent0.core.base.policies ========================= .. py:module:: agent0.core.base.policies .. autoapi-nested-parse:: Policies for expert system trading agents .. !! processed by numpydoc !! Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/agent0/core/base/policies/base/index /autoapi/agent0/core/base/policies/no_action/index Classes ------- .. autoapisummary:: agent0.core.base.policies.BasePolicy agent0.core.base.policies.NoActionPolicy Package Contents ---------------- .. py:class:: BasePolicy(policy_config: Config) Bases: :py:obj:`Generic`\ [\ :py:obj:`MarketInterface`\ , :py:obj:`Wallet`\ ] Base class policy. .. !! processed by numpydoc !! .. py:class:: Config Bases: :py:obj:`agent0.core.base.types.Freezable` Config data class for policy specific configuration. .. !! processed by numpydoc !! .. py:attribute:: rng_seed :type: int | None :value: None The seed for the random number generator. Defaults to None. .. !! processed by numpydoc !! .. py:attribute:: rng :type: numpy.random.Generator | None :value: None The experiment's stateful random number generator. Defaults to a spawn of the global rng. .. !! processed by numpydoc !! .. py:attribute:: slippage_tolerance :type: fixedpointmath.FixedPoint | None :value: None The slippage tolerance for trades. Defaults to None. .. !! processed by numpydoc !! .. py:attribute:: base_fee_multiple :type: float | None :value: None The base fee multiple for transactions. Defaults to None. .. !! processed by numpydoc !! .. py:attribute:: priority_fee_multiple :type: float | None :value: None The priority fee multiple for transactions. Defaults to None. .. !! processed by numpydoc !! .. py:attribute:: gas_limit :type: int | None :value: None Maximum gas to spend per trade. .. !! processed by numpydoc !! .. py:attribute:: config :type: Any .. py:attribute:: slippage_tolerance .. py:property:: name :type: str Return the class name. :returns: The class name. :rtype: str .. !! processed by numpydoc !! .. py:method:: action(interface: MarketInterface, wallet: Wallet) -> tuple[list[agent0.core.base.types.Trade], bool] :abstractmethod: Specify actions. :param interface: The trading market interface. :type interface: MarketInterface :param wallet: The agent's wallet. :type wallet: Wallet :returns: A tuple where the first element is a list of actions, and the second element defines if the agent is done trading. :rtype: tuple[list[Trade], bool] .. !! processed by numpydoc !! .. py:method:: describe(raw_description: str) -> str :classmethod: Describe the policy in a user friendly manner that allows newcomers to decide whether to use it. :param raw_description: The description of the policy's action plan. :type raw_description: str :returns: A description of the policy. :rtype: str .. !! processed by numpydoc !! .. py:class:: NoActionPolicy(policy_config: Config) Bases: :py:obj:`agent0.core.base.policies.base.BasePolicy`\ [\ :py:obj:`agent0.core.base.policies.base.MarketInterface`\ , :py:obj:`agent0.core.base.policies.base.Wallet`\ ] NoOp class policy .. !! processed by numpydoc !! .. py:method:: action(interface: agent0.core.base.policies.base.MarketInterface, wallet: agent0.core.base.policies.base.Wallet) -> tuple[list[agent0.core.base.types.Trade], bool] Returns an empty list, indicating no action :param interface: The trading market interface. :type interface: MarketInterface :param wallet: The agent's wallet. :type wallet: Wallet :returns: A tuple where the first element is a list of actions, and the second element defines if the agent is done trading :rtype: tuple[list[MarketAction], bool] .. !! processed by numpydoc !! .. py:method:: description() -> str :classmethod: Describe the policy in a user friendly manner that allows newcomers to decide whether to use it. :returns: A description of the policy. :rtype: str .. !! processed by numpydoc !!