dojo.policies

Policies represent the decision rules for an agent.

You can create a policy encapsulating an agent, and the predict() function will then be called during the simulation, returning a list of actions the agent wants to take.

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()

Initialize 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.

A policy that never takes an action.

DoNothingPolicy()

Contructor.

def predict( self, obs: dojo.observations.base_observation.BaseObservation) -> list[dojo.actions.base_action.BaseAction[typing.Any]]:

Takes no actions.

Parameters
  • obs: Observation object