dojo.policies

Policies are the means to give agent behaviour.

Specifically, policies map observation spaces to actions and are attached to agents

A policy for AAVEv3.

A policy for GMXv2.

A policy for UniswapV3.

class BasePolicy(abc.ABC, typing.Generic[~Action, ~Agent, ~Observation]):

The BasePolicy acts as the base abstract class for all policies.

BasePolicy(agent: ~Agent)

Initialize the policy.

Parameters
  • agent: the agent associated with the policy
@abstractmethod
def predict(self, obs: ~Observation) -> list[~Action]:

Run the policy to get a sequence of actions.

Parameters
  • obs: The observation from the environment.
Returns

The policy actions.