dojo.market_models package

This module contains market impact models.

These models evaluate what appropriate market actions to take given the policy actions of the other agents.

class dojo.market_models.BaseMarketModel(market_agent: MarketAgent)

Bases: ABC, Generic[Action, Observation]

Base class for market models.

abstract predict(obs: Observation, agents_actions: list[Action]) list[Action]

Predict the market actions in the current block.

Parameters:
  • obs – The observation from the environment.

  • agents_actions – The actions from the policies of the other agents.

class dojo.market_models.NoMarket(market_agent: MarketAgent)

Bases: BaseMarketModel[Action, Any]

Don’t load any market actions.

predict(obs: BaseObservation, agents_actions: list[Action]) list[Action]

Return an empty list of actions.

Parameters:
  • obs – The observation from the environment.

  • agents_actions – The actions from the policies of the other agents.

Submodules

Replay market models replay history in the simulation.

class dojo.market_models.aaveV3.AaveV3DefaultModel(market_agent: MarketAgent)

Bases: BaseMarketModel[BaseAaveAction, AAVEv3Observation]

Replays a sequence of actions for the UniswapV3Env environment.

DEFAULT_GAS = 500000
predict(obs: AAVEv3Observation, agents_actions: list[BaseAaveAction]) list[BaseAaveAction]

Replay the actions history of the current block.

Parameters:
  • obs – The observation from the environment.

  • agents_actions – The actions from the policies of the other agents.

Base class for market models.

class dojo.market_models.base_market_model.BaseMarketModel(market_agent: MarketAgent)

Bases: ABC, Generic[Action, Observation]

Base class for market models.

abstract predict(obs: Observation, agents_actions: list[Action]) list[Action]

Predict the market actions in the current block.

Parameters:
  • obs – The observation from the environment.

  • agents_actions – The actions from the policies of the other agents.

The no market model doesn’t load any market actions.

class dojo.market_models.no_market.NoMarket(market_agent: MarketAgent)

Bases: BaseMarketModel[Action, Any]

Don’t load any market actions.

predict(obs: BaseObservation, agents_actions: list[Action]) list[Action]

Return an empty list of actions.

Parameters:
  • obs – The observation from the environment.

  • agents_actions – The actions from the policies of the other agents.

Replay market models replay history in the simulation.

class dojo.market_models.uniswapV3.AaveV3DefaultModel(market_agent: MarketAgent)

Bases: BaseMarketModel[BaseAaveAction, AAVEv3Observation]

Replays a sequence of actions for the UniswapV3Env environment.

DEFAULT_GAS = 500000
predict(obs: AAVEv3Observation, agents_actions: list[BaseAaveAction]) list[BaseAaveAction]

Replay the actions history of the current block.

Parameters:
  • obs – The observation from the environment.

  • agents_actions – The actions from the policies of the other agents.

class dojo.market_models.uniswapV3.UniswapV3ReplayModel(market_agent: MarketAgent, replay_events: list[Event])

Bases: BaseMarketModel[UniswapV3Action, UniswapV3Observation]

Replays a sequence of actions for the UniswapV3Env environment.

DEFAULT_GAS = 30500000
predict(obs: UniswapV3Observation, agents_actions: list[UniswapV3Action]) list[UniswapV3Action]

Replay the actions history of the current block.

Parameters:
  • obs – The observation from the environment.

  • agents_actions – The actions from the policies of the other agents.