ManifoldMarketManager.rule.abstract

Contains abstract subclasses of Rule which allow for forms of pluggable behavior.

class ManifoldMarketManager.rule.abstract.AbstractRule[source]

Bases: Generic[T], Rule[T]

Provide a rule where the explanations are pre-generated.

_abc_impl = <_abc_data object>
_explain_abstract(indent: int = 0, **kwargs: Any) str[source]
_explain_specific(market: Market, indent: int = 0, sig_figs: int = 4) str[source]
_explainer_stub: ClassVar[str] = 'A programatic explanation was not provided'
_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.abstract.BinaryRule(rule1: Rule[T], rule2: Rule[T])[source]

Bases: AbstractRule[T]

Perform a binary operation on two Rules.

_abc_impl = <_abc_data object>
_explain_abstract(indent: int = 0, **kwargs: Any) str[source]
_explain_specific(market: Market, indent: int = 0, sig_figs: int = 4) str[source]
_explainer_stub: ClassVar[str] = 'A programatic explanation was not provided'
_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) BinaryRule[T][source]

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

logger: Logger
rule1: Rule[T]
rule2: Rule[T]
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.abstract.ResolveRandomSeed(seed: int | float | str | bytes | bytearray = b'\x8b\x8b\x04d\xa9\xccR"\x8d\xdf\xf4(6\xa7Y\xbf', method: str = 'random', rounds: int = 1, args: Sequence[Any] = (), kwargs: JSONDict = NOTHING)[source]

Bases: ResolutionValueRule

Abstract class that handles the nitty-gritty of the Random object.

_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
_value(market: Market) Any[source]
args: Sequence[Any]
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.

kwargs: JSONDict
logger: Logger
method: str
rounds: int
seed: int | float | str | bytes | bytearray
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.abstract.UnaryRule(child: Rule[T])[source]

Bases: AbstractRule[T]

Perform a unary operation on another DoResolveRule.

_abc_impl = <_abc_data object>
_explain_abstract(indent: int = 0, **kwargs: Any) str[source]
_explain_specific(market: Market, indent: int = 0, sig_figs: int = 4) str[source]
_explainer_stub: ClassVar[str] = 'A programatic explanation was not provided'
_is_protocol = False
abstract _value(market: Market) T
child: Rule[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) UnaryRule[T][source]

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.abstract.VariadicRule(rules: list[Rule[T]] = NOTHING)[source]

Bases: AbstractRule[T]

Perform a variadic operation on many Rules.

_abc_impl = <_abc_data object>
_explain_abstract(indent: int = 0, **kwargs: Any) str[source]
_explain_specific(market: Market, indent: int = 0, sig_figs: int = 4) str[source]
_explainer_stub: ClassVar[str] = 'A programatic explanation was not provided'
_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) VariadicRule[T][source]

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

logger: Logger
rules: list[Rule[T]]
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.