dojo.runners package

Simulation runners.

dojo.runners.backtest_run(env: BaseEnvironment, policies: List[BasePolicy], dashboard_port: int | None = None, transaction_order: Literal['market_first', 'agent_first', 'fee'] = 'market_first', auto_close: bool = True) Tuple[List[int], List[float]]

Run a backtest on a given environment.

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

Parameters:
  • env – The environment to run the backtest on.

  • policies – The policies to use for the backtest.

  • dashboard_port – The port on which the dashboard is running, defaults to 8051.

  • 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 disconnect from the local chain after the backtest 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: BaseEnvironment, policies: List[BasePolicy], dashboard_port: int | None = None, transaction_order: Literal['market_first', 'agent_first', 'fee'] = 'market_first', auto_close: bool = True) Tuple[List[int], List[float]]

Run a backtest on a given environment.

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

Parameters:
  • env – The environment to run the backtest on.

  • policies – The policies to use for the backtest.

  • dashboard_port – The port on which the dashboard is running, defaults to 8051.

  • 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 disconnect from the local chain after the backtest is finished.

Raises:

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