dojo.runners

Simulation runners.

def backtest_run( env: Union[dojo.environments.UniswapV3Env, dojo.environments.AAVEv3Env, dojo.environments.GmxV2Env], policies: list[dojo.policies.BasePolicy[typing.Any, typing.Any, typing.Any]], *, output_file: Optional[str] = None, dashboard_server_port: Optional[int] = None, transaction_order: Literal['market_first', 'agent_first', 'fee'] = 'market_first', auto_close: bool = True, simulation_status_bar: bool = False, simulation_title: str = 'no title', simulation_description: str = 'no description') -> None:

Run a backtest on a given environment.

NB: This runner is in beta and is not yet fully supported. Currently, it only supports UniswapV3Env and the demo UniswapV3WealthAgent which can be found here https://github.com/CompassLabs/dojo_examples/blob/main/agents/UniswapV3_pool_wealth.py

Parameters
  • env: The environment to run the backtest on.
  • policies: The policies to use for the backtest.
  • output_file: The file to write the output to.
  • dashboard_server_port: The port on which the data is served for connection to the dashboard.
  • transaction_order: The order in which actions are executed within a block. By default, market actions are executed first ('market_first'), followed by the policy actions in the order of the policies. You can also choose to first execute the agent actions or to have the order randomized.
  • auto_close: Whether to automatically close the dashboard server once the simulation is finished.
  • simulation_status_bar: Whether to show a status bar for the simulation.
  • simulation_title: The title of the simulation.
  • simulation_description: The description of the simulation.
Raises
  • ValueError: In case an invalid value for transaction_order is provided.