dojo.runners package

Simulation runners.

dojo.runners.backtest_run(env: UniswapV3Env | AAVEv3Env | GmxV2Env, policies: list[BasePolicy[Any, Any, Any]], *, output_file: str | None = None, dashboard_server_port: int | None = 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.

  • dashboard_server_port – The port on which the data is served for connection to the dashboard.

  • output_file – The file to write the output to.

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

Raises:

ValueError – In case an invalid value for transaction_order is provided.

Submodules

Runner for backtesting.

dojo.runners.backtest_runner.backtest_run(env: UniswapV3Env | AAVEv3Env | GmxV2Env, policies: list[BasePolicy[Any, Any, Any]], *, output_file: str | None = None, dashboard_server_port: int | None = 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.

  • dashboard_server_port – The port on which the data is served for connection to the dashboard.

  • output_file – The file to write the output to.

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

Raises:

ValueError – In case an invalid value for transaction_order is provided.