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

Base class for market models.

abstract predict(obs: BaseObs, agents_actions: List[BaseAction]) List[BaseAction]

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

Don’t load any market actions.

predict(obs: BaseObs, agents_actions: List[BaseAction]) List[BaseAction]

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

Replays a sequence of actions for the UniV3Env environment.

DEFAULT_GAS = 500000
predict(obs: AAVEv3Obs, agents_actions: List[BaseAction]) List[BaseAction]

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

Base class for market models.

abstract predict(obs: BaseObs, agents_actions: List[BaseAction]) List[BaseAction]

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

Don’t load any market actions.

predict(obs: BaseObs, agents_actions: List[BaseAction]) List[BaseAction]

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

Replays a sequence of actions for the UniV3Env environment.

DEFAULT_GAS = 500000
predict(obs: AAVEv3Obs, agents_actions: List[BaseAction]) List[BaseAction]

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.UniV3ReplayModel(market_agent: MarketAgent, replay_events: List[Event])

Bases: BaseMarketModel

Replays a sequence of actions for the UniV3Env environment.

DEFAULT_GAS = 500000
predict(obs: UniV3Obs, agents_actions: List[BaseAction]) List[BaseAction]

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.