ManifoldMarketManager.rule

Umbrella package for all rules.

Anyone who wants to develop a plugin is welcome to modify the values in this specific namespace. In particular, to add a rule with your plugin: 1) Add your plugin’s rules as a submodule of this using

`from sys import modules; modules[‘.’.join((PATH_TO_RULE_MODULE, PATH_TO_YOUR_RULE))] = module[PATH_TO_YOUR_RULE]

  1. Append your plugin’s namespace to rule.__all__

  2. Append each of your rules’ import paths to consts.AVAILABLE_RULES

class ManifoldMarketManager.rule.DoResolveRule[source]

Bases: Rule[Optional[bool]]

The subtype of rule which determines if a market should resolve, returning a bool.

_abc_impl = <_abc_data object>
abstract _explain_abstract(indent: int = 0, **kwargs: Any) str
_explain_specific(market: Market, indent: int = 0, sig_figs: int = 4) str
_is_protocol = False
abstract _value(market: Market) T
explain_abstract(indent: int = 0, **kwargs: Any) str

Explain how the market will resolve and decide to resolve.

explain_specific(market: Market, indent: int = 0, sig_figs: int = 4) str

Explain why the market is resolving the way that it is.

classmethod from_dict(env: ModJSONDict) T

Take a dictionary and return an instance of the associated class.

logger: Logger
tags_used: set[str]
value(market: Market, format: Literal['NONE'] | OutcomeType = 'NONE', refresh: bool = False) AnyResolution

Return the resolution value of a market, appropriately formatted for its market type.

class ManifoldMarketManager.rule.ResolutionValueRule[source]

Bases: Rule[Union[Literal[‘CANCEL’], bool, float, Mapping[str, float], Mapping[int, float], Mapping[float, float]]]

The subtype of rule which determines what a market should resolve to.

_abc_impl = <_abc_data object>
abstract _explain_abstract(indent: int = 0, **kwargs: Any) str
_explain_specific(market: Market, indent: int = 0, sig_figs: int = 4) str
_is_protocol = False
abstract _value(market: Market) T
explain_abstract(indent: int = 0, **kwargs: Any) str

Explain how the market will resolve and decide to resolve.

explain_specific(market: Market, indent: int = 0, sig_figs: int = 4) str

Explain why the market is resolving the way that it is.

classmethod from_dict(env: ModJSONDict) T

Take a dictionary and return an instance of the associated class.

logger: Logger
tags_used: set[str]
value(market: Market, format: Literal['NONE'] | OutcomeType = 'NONE', refresh: bool = False) AnyResolution

Return the resolution value of a market, appropriately formatted for its market type.

ManifoldMarketManager.rule.get_rule(type_: str) Type[Rule[Any]][source]

Dynamically import and return a rule type by name.