prediction-market-agent-tooling 0.45.0__tar.gz → 0.46.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/PKG-INFO +1 -1
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/loggers.py +15 -1
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/omen/data_models.py +1 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/omen/omen_contracts.py +47 -9
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/omen/omen_resolving.py +48 -3
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/pyproject.toml +1 -1
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/LICENSE +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/README.md +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/depositablewrapper_erc20.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/erc20.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/erc4626.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/omen_dxdao.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/omen_fpmm.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/omen_fpmm_conditionaltokens.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/omen_fpmm_factory.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/omen_kleros.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/omen_oracle.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/omen_realitio.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/omen_thumbnailmapping.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/abis/proxy.abi.json +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/benchmark/__init__.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/benchmark/agents.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/benchmark/benchmark.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/benchmark/utils.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/config.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/deploy/agent.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/deploy/agent_example.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/deploy/constants.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/deploy/gcp/deploy.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/deploy/gcp/kubernetes_models.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/deploy/gcp/utils.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/gtypes.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/agent_market.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/categorize.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/data_models.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/manifold/__init__.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/manifold/api.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/manifold/data_models.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/manifold/manifold.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/manifold/utils.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/markets.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/metaculus/api.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/metaculus/data_models.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/metaculus/metaculus.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/omen/__init__.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/omen/omen.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/polymarket/api.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/polymarket/data_models.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/polymarket/data_models_web.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/polymarket/polymarket.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/markets/polymarket/utils.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/monitor/langfuse/langfuse_wrapper.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/monitor/markets/manifold.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/monitor/markets/metaculus.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/monitor/markets/omen.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/monitor/markets/polymarket.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/monitor/monitor.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/monitor/monitor_app.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/monitor/monitor_settings.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/py.typed +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/balances.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/betting_strategies/market_moving.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/cache.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/contract.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/costs.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/gnosis_rpc.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/google.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/hexbytes_custom.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/image_gen/image_gen.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/image_gen/market_thumbnail_gen.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/is_predictable.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/parallelism.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/safe.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/singleton.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/streamlit_user_login.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/utils.py +0 -0
- {prediction_market_agent_tooling-0.45.0 → prediction_market_agent_tooling-0.46.0}/prediction_market_agent_tooling/tools/web3_utils.py +0 -0
@@ -31,6 +31,11 @@ class LogConfig(BaseSettings):
|
|
31
31
|
LOG_LEVEL: LogLevel = LogLevel.DEBUG
|
32
32
|
|
33
33
|
|
34
|
+
class NoNewLineStreamHandler(logging.StreamHandler): # type: ignore # StreamHandler is not typed in the standard library.
|
35
|
+
def format(self, record: logging.LogRecord) -> str:
|
36
|
+
return super().format(record).replace("\n", " ")
|
37
|
+
|
38
|
+
|
34
39
|
GCP_LOG_LOGURU_FORMAT = (
|
35
40
|
"{level:<.1}{time:MMDD HH:mm:ss} {process} {name}:{line}] {message}"
|
36
41
|
)
|
@@ -40,6 +45,10 @@ GCP_LOG_LOGGING_FORMAT, GCP_LOG_FORMAT_LOGGING_DATEFMT = (
|
|
40
45
|
|
41
46
|
|
42
47
|
def patch_logger() -> None:
|
48
|
+
"""
|
49
|
+
Function to patch loggers according to the deployed environment.
|
50
|
+
Patches Loguru's logger, Python's default logger, warnings library and also monkey-patch print function as many libraries just use it.
|
51
|
+
"""
|
43
52
|
config = LogConfig()
|
44
53
|
|
45
54
|
if config.LOG_FORMAT == LogFormat.GCP:
|
@@ -47,10 +56,12 @@ def patch_logger() -> None:
|
|
47
56
|
format_logging = GCP_LOG_LOGGING_FORMAT
|
48
57
|
datefmt_logging = GCP_LOG_FORMAT_LOGGING_DATEFMT
|
49
58
|
print_logging = print_using_loguru_info
|
59
|
+
handlers = [NoNewLineStreamHandler()]
|
50
60
|
|
51
61
|
elif config.LOG_FORMAT == LogFormat.DEFAULT:
|
52
62
|
format_loguru, format_logging, datefmt_logging = None, None, None
|
53
63
|
print_logging = None
|
64
|
+
handlers = None
|
54
65
|
|
55
66
|
else:
|
56
67
|
raise ValueError(f"Unknown log format: {config.LOG_FORMAT}")
|
@@ -58,7 +69,10 @@ def patch_logger() -> None:
|
|
58
69
|
# Change built-in logging.
|
59
70
|
if format_logging is not None:
|
60
71
|
logging.basicConfig(
|
61
|
-
level=config.LOG_LEVEL.value,
|
72
|
+
level=config.LOG_LEVEL.value,
|
73
|
+
format=format_logging,
|
74
|
+
datefmt=datefmt_logging,
|
75
|
+
handlers=handlers,
|
62
76
|
)
|
63
77
|
|
64
78
|
# Change loguru.
|
@@ -31,6 +31,7 @@ from prediction_market_agent_tooling.tools.web3_utils import wei_to_xdai
|
|
31
31
|
OMEN_TRUE_OUTCOME = "Yes"
|
32
32
|
OMEN_FALSE_OUTCOME = "No"
|
33
33
|
INVALID_ANSWER = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
34
|
+
INVALID_ANSWER_HEX_BYTES = HexBytes(INVALID_ANSWER)
|
34
35
|
OMEN_BASE_URL = "https://aiomen.eth.limo"
|
35
36
|
PRESAGIO_BASE_URL = "https://presagio.pages.dev"
|
36
37
|
|
@@ -22,6 +22,9 @@ from prediction_market_agent_tooling.gtypes import (
|
|
22
22
|
wei_type,
|
23
23
|
xdai_type,
|
24
24
|
)
|
25
|
+
from prediction_market_agent_tooling.markets.omen.data_models import (
|
26
|
+
INVALID_ANSWER_HEX_BYTES,
|
27
|
+
)
|
25
28
|
from prediction_market_agent_tooling.tools.contract import (
|
26
29
|
ContractDepositableWrapperERC20OnGnosisChain,
|
27
30
|
ContractERC20OnGnosisChain,
|
@@ -562,8 +565,7 @@ class OmenRealitioContract(ContractOnGnosisChain):
|
|
562
565
|
self,
|
563
566
|
api_keys: APIKeys,
|
564
567
|
question_id: HexBytes,
|
565
|
-
answer:
|
566
|
-
outcomes: list[str],
|
568
|
+
answer: HexBytes,
|
567
569
|
bond: Wei,
|
568
570
|
max_previous: Wei | None = None,
|
569
571
|
web3: Web3 | None = None,
|
@@ -573,24 +575,60 @@ class OmenRealitioContract(ContractOnGnosisChain):
|
|
573
575
|
# same as on Omen website: https://github.com/protofire/omen-exchange/blob/763d9c9d05ebf9edacbc1dbaa561aa5d08813c0f/app/src/services/realitio.ts#L363.
|
574
576
|
max_previous = Wei(0)
|
575
577
|
|
576
|
-
# Normalise the answer to lowercase, to match Enum values as [YES, NO] against outcomes as ["Yes", "No"].
|
577
|
-
answer = answer.lower()
|
578
|
-
outcomes = [o.lower() for o in outcomes]
|
579
|
-
|
580
578
|
return self.send_with_value(
|
581
579
|
api_keys=api_keys,
|
582
580
|
function_name="submitAnswer",
|
583
581
|
function_params=dict(
|
584
582
|
question_id=question_id,
|
585
|
-
answer=
|
586
|
-
outcomes.index(answer)
|
587
|
-
), # Contract's method expects answer index in bytes.
|
583
|
+
answer=answer,
|
588
584
|
max_previous=max_previous,
|
589
585
|
),
|
590
586
|
amount_wei=bond,
|
591
587
|
web3=web3,
|
592
588
|
)
|
593
589
|
|
590
|
+
def submit_answer(
|
591
|
+
self,
|
592
|
+
api_keys: APIKeys,
|
593
|
+
question_id: HexBytes,
|
594
|
+
answer: str,
|
595
|
+
outcomes: list[str],
|
596
|
+
bond: Wei,
|
597
|
+
max_previous: Wei | None = None,
|
598
|
+
web3: Web3 | None = None,
|
599
|
+
) -> TxReceipt:
|
600
|
+
# Normalise the answer to lowercase, to match Enum values as [YES, NO] against outcomes as ["Yes", "No"].
|
601
|
+
answer = answer.lower()
|
602
|
+
outcomes = [o.lower() for o in outcomes]
|
603
|
+
|
604
|
+
return self.submitAnswer(
|
605
|
+
api_keys=api_keys,
|
606
|
+
question_id=question_id,
|
607
|
+
answer=int_to_hexbytes(
|
608
|
+
outcomes.index(answer)
|
609
|
+
), # Contract's method expects answer index in bytes.
|
610
|
+
bond=bond,
|
611
|
+
max_previous=max_previous,
|
612
|
+
web3=web3,
|
613
|
+
)
|
614
|
+
|
615
|
+
def submit_answer_invalid(
|
616
|
+
self,
|
617
|
+
api_keys: APIKeys,
|
618
|
+
question_id: HexBytes,
|
619
|
+
bond: Wei,
|
620
|
+
max_previous: Wei | None = None,
|
621
|
+
web3: Web3 | None = None,
|
622
|
+
) -> TxReceipt:
|
623
|
+
return self.submitAnswer(
|
624
|
+
api_keys=api_keys,
|
625
|
+
question_id=question_id,
|
626
|
+
answer=INVALID_ANSWER_HEX_BYTES,
|
627
|
+
bond=bond,
|
628
|
+
max_previous=max_previous,
|
629
|
+
web3=web3,
|
630
|
+
)
|
631
|
+
|
594
632
|
def claimWinnings(
|
595
633
|
self,
|
596
634
|
api_keys: APIKeys,
|
@@ -1,3 +1,5 @@
|
|
1
|
+
from datetime import datetime
|
2
|
+
|
1
3
|
from web3 import Web3
|
2
4
|
|
3
5
|
from prediction_market_agent_tooling.config import APIKeys
|
@@ -140,6 +142,7 @@ def claim_bonds_on_realitio_question(
|
|
140
142
|
def finalize_markets(
|
141
143
|
api_keys: APIKeys,
|
142
144
|
markets_with_resolutions: list[tuple[OmenMarket, Resolution | None]],
|
145
|
+
wait_n_days_before_invalid: int = 30,
|
143
146
|
web3: Web3 | None = None,
|
144
147
|
) -> list[HexAddress]:
|
145
148
|
finalized_markets: list[HexAddress] = []
|
@@ -148,9 +151,24 @@ def finalize_markets(
|
|
148
151
|
logger.info(
|
149
152
|
f"[{idx+1} / {len(markets_with_resolutions)}] Looking into {market.url=} {market.question_title=}"
|
150
153
|
)
|
154
|
+
closed_before_days = (datetime.now() - market.close_time).days
|
151
155
|
|
152
156
|
if resolution is None:
|
153
|
-
|
157
|
+
if closed_before_days > wait_n_days_before_invalid:
|
158
|
+
logger.warning(
|
159
|
+
f"Finalizing as invalid, market closed before {closed_before_days} days: {market.url=}"
|
160
|
+
)
|
161
|
+
omen_submit_invalid_answer_market_tx(
|
162
|
+
api_keys,
|
163
|
+
market,
|
164
|
+
OMEN_DEFAULT_REALITIO_BOND_VALUE,
|
165
|
+
web3=web3,
|
166
|
+
)
|
167
|
+
|
168
|
+
else:
|
169
|
+
logger.warning(
|
170
|
+
f"Skipping, no resolution provided, market closed before {closed_before_days} days: {market.url=}"
|
171
|
+
)
|
154
172
|
|
155
173
|
elif resolution in (Resolution.YES, Resolution.NO):
|
156
174
|
logger.info(f"Found resolution {resolution.value=} for {market.url=}")
|
@@ -165,7 +183,15 @@ def finalize_markets(
|
|
165
183
|
logger.info(f"Finalized {market.url=}")
|
166
184
|
|
167
185
|
else:
|
168
|
-
logger.
|
186
|
+
logger.warning(
|
187
|
+
f"Invalid resolution found, {resolution=}, for {market.url=}, finalizing as invalid."
|
188
|
+
)
|
189
|
+
omen_submit_invalid_answer_market_tx(
|
190
|
+
api_keys,
|
191
|
+
market,
|
192
|
+
OMEN_DEFAULT_REALITIO_BOND_VALUE,
|
193
|
+
web3=web3,
|
194
|
+
)
|
169
195
|
|
170
196
|
return finalized_markets
|
171
197
|
|
@@ -199,7 +225,7 @@ def omen_submit_answer_market_tx(
|
|
199
225
|
And after the period is over, you need to resolve the market using `omen_resolve_market_tx`.
|
200
226
|
"""
|
201
227
|
realitio_contract = OmenRealitioContract()
|
202
|
-
realitio_contract.
|
228
|
+
realitio_contract.submit_answer(
|
203
229
|
api_keys=api_keys,
|
204
230
|
question_id=market.question.id,
|
205
231
|
answer=resolution.value,
|
@@ -209,6 +235,25 @@ def omen_submit_answer_market_tx(
|
|
209
235
|
)
|
210
236
|
|
211
237
|
|
238
|
+
def omen_submit_invalid_answer_market_tx(
|
239
|
+
api_keys: APIKeys,
|
240
|
+
market: OmenMarket,
|
241
|
+
bond: xDai,
|
242
|
+
web3: Web3 | None = None,
|
243
|
+
) -> None:
|
244
|
+
"""
|
245
|
+
After the answer is submitted, there is 24h waiting period where the answer can be challenged by others.
|
246
|
+
And after the period is over, you need to resolve the market using `omen_resolve_market_tx`.
|
247
|
+
"""
|
248
|
+
realitio_contract = OmenRealitioContract()
|
249
|
+
realitio_contract.submit_answer_invalid(
|
250
|
+
api_keys=api_keys,
|
251
|
+
question_id=market.question.id,
|
252
|
+
bond=xdai_to_wei(bond),
|
253
|
+
web3=web3,
|
254
|
+
)
|
255
|
+
|
256
|
+
|
212
257
|
def omen_resolve_market_tx(
|
213
258
|
api_keys: APIKeys,
|
214
259
|
market: OmenMarket,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|