prediction-market-agent-tooling 0.57.12__py3-none-any.whl → 0.57.13__py3-none-any.whl

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.
@@ -115,7 +115,7 @@ def have_bet_on_market_since(
115
115
  )
116
116
  )
117
117
  if isinstance(market, OmenAgentMarket)
118
- else should_not_happen(f"Uknown market: {market}")
118
+ else should_not_happen(f"Unknown market: {market}")
119
119
  )
120
120
  )
121
121
  return market.question in recently_betted_questions
@@ -317,7 +317,7 @@ class OmenAgentMarket(AgentMarket):
317
317
  def market_redeemable_by(self, user: ChecksumAddress) -> bool:
318
318
  """
319
319
  Will return true if given user placed a bet on this market and that bet has a balance.
320
- If the user never placed a bet on this market, this corretly return False.
320
+ If the user never placed a bet on this market, this correctly return False.
321
321
  """
322
322
  positions = OmenSubgraphHandler().get_positions(condition_id=self.condition.id)
323
323
  user_positions = OmenSubgraphHandler().get_user_positions(
@@ -34,6 +34,7 @@ def claim_bonds_on_realitio_questions(
34
34
  questions: list[RealityQuestion],
35
35
  auto_withdraw: bool,
36
36
  web3: Web3 | None = None,
37
+ skip_failed: bool = False,
37
38
  ) -> list[HexBytes]:
38
39
  claimed_questions: list[HexBytes] = []
39
40
 
@@ -41,10 +42,17 @@ def claim_bonds_on_realitio_questions(
41
42
  logger.info(
42
43
  f"[{idx+1} / {len(questions)}] Claiming bond for {question.questionId=} {question.url=}"
43
44
  )
44
- claim_bonds_on_realitio_question(
45
- api_keys, question, auto_withdraw=auto_withdraw, web3=web3
46
- )
47
- claimed_questions.append(question.questionId)
45
+ try:
46
+ claim_bonds_on_realitio_question(
47
+ api_keys, question, auto_withdraw=auto_withdraw, web3=web3
48
+ )
49
+ claimed_questions.append(question.questionId)
50
+ except Exception as e:
51
+ if not skip_failed:
52
+ raise e
53
+ logger.error(
54
+ f"Failed to claim bond for {question.url=}, {question.questionId=}: {e}"
55
+ )
48
56
 
49
57
  return claimed_questions
50
58
 
@@ -25,7 +25,7 @@ def get_market_moving_bet(
25
25
  `p_yes` to that of the target.
26
26
 
27
27
  Consider a binary fixed-product market containing `x` and `y` tokens.
28
- A trader wishes to aquire `x` tokens by betting an amount `d0`.
28
+ A trader wishes to acquire `x` tokens by betting an amount `d0`.
29
29
 
30
30
  The calculation to determine the number of `x` tokens he acquires, denoted
31
31
  by `dx`, is:
@@ -16,7 +16,7 @@ def json_serializer_default_fn(
16
16
  ) -> str | dict[str, t.Any]:
17
17
  """
18
18
  Used to serialize objects that don't support it by default into a specific string that can be deserialized out later.
19
- If this function returns a dictionary, it will be called recursivelly.
19
+ If this function returns a dictionary, it will be called recursively.
20
20
  If you add something here, also add it to `replace_custom_stringified_objects` below.
21
21
  """
22
22
  if isinstance(y, DatetimeUTC):
@@ -28,7 +28,7 @@ def json_serializer_default_fn(
28
28
  elif isinstance(y, BaseModel):
29
29
  return y.model_dump()
30
30
  raise TypeError(
31
- f"Unsuported type for the default json serialize function, value is {y}."
31
+ f"Unsupported type for the default json serialize function, value is {y}."
32
32
  )
33
33
 
34
34
 
@@ -262,7 +262,7 @@ class ContractERC20BaseClass(ContractBaseClass):
262
262
  class ContractDepositableWrapperERC20BaseClass(ContractERC20BaseClass):
263
263
  """
264
264
  ERC-20 standard base class extended for wrapper tokens.
265
- Altough this is not a standard, it's seems to be a common pattern for wrapped tokens (at least it checks out for wxDai and wETH).
265
+ Although this is not a standard, it's seems to be a common pattern for wrapped tokens (at least it checks out for wxDai and wETH).
266
266
  """
267
267
 
268
268
  abi: ABI = abi_field_validator(
@@ -63,7 +63,7 @@ class DatetimeUTC(datetime):
63
63
  @staticmethod
64
64
  def to_datetime_utc(value: datetime | int | str) -> "DatetimeUTC":
65
65
  if isinstance(value, int):
66
- # Divide by 1000 if the timestamp is assumed to be in miliseconds (if not, 1e11 would be year 5138).
66
+ # Divide by 1000 if the timestamp is assumed to be in milliseconds (if not, 1e11 would be year 5138).
67
67
  value = int(value / 1000) if value > 1e11 else value
68
68
  # In the past, we had bugged data where timestamp was huge and Python errored out.
69
69
  max_timestamp = int((datetime.max - timedelta(days=1)).timestamp())
@@ -37,7 +37,7 @@ QUESTION_IS_INVALID_PROMPT = """Main signs about an invalid question (sometimes
37
37
  - Questions with relative dates will resolve as invalid. Dates must be stated in absolute terms, not relative depending on the current time. But they can be relative to the event specified in the question itself.
38
38
  - Invalid: Who will be the president of the United States in 6 months? ("in 6 months depends on the current time").
39
39
  - Invalid: In the next 14 days, will Gnosis Chain gain another 1M users? ("in the next 14 days depends on the current time").
40
- - Valid: Will GNO price go up 10 days after Gnosis Pay cashback program is annouced? ("10 days after" is relative to the event in the question, so we can determine absolute value).
40
+ - Valid: Will GNO price go up 10 days after Gnosis Pay cashback program is announced? ("10 days after" is relative to the event in the question, so we can determine absolute value).
41
41
  - Questions about moral values and not facts will be resolved as invalid.
42
42
  - Invalid: "Is it ethical to eat meat?".
43
43
 
@@ -22,7 +22,7 @@ QUESTION_IS_PREDICTABLE_BINARY_PROMPT = """Main signs about a fully qualified qu
22
22
  - If the market's question contains year, but without an exact date, it's okay.
23
23
  - The market's question can not be about itself or refer to itself.
24
24
  - The answer is probably Google-able, after the event happened.
25
- - The potential asnwer can be only "Yes" or "No".
25
+ - The potential answer can be only "Yes" or "No".
26
26
 
27
27
  Follow a chain of thought to evaluate if the question is fully qualified:
28
28
 
@@ -37,7 +37,7 @@ def check_not_none(
37
37
  ```
38
38
  keys = pma.utils.get_keys()
39
39
  pma.omen.omen_buy_outcome_tx(
40
- from_addres=check_not_none(keys.bet_from_address), # <-- No more Optional[HexAddress], so type checker will be happy.
40
+ from_address=check_not_none(keys.bet_from_address), # <-- No more Optional[HexAddress], so type checker will be happy.
41
41
  ...,
42
42
  )
43
43
  ```
@@ -60,7 +60,7 @@ def should_not_happen(
60
60
  1 if variable == X
61
61
  else 2 if variable == Y
62
62
  else 3 if variable == Z
63
- else should_not_happen(f"Variable {variable} is uknown.")
63
+ else should_not_happen(f"Variable {variable} is unknown.")
64
64
  )
65
65
  ```
66
66
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.57.12
3
+ Version: 0.57.13
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.13
@@ -45,15 +45,15 @@ prediction_market_agent_tooling/markets/manifold/data_models.py,sha256=eiGS4rEkx
45
45
  prediction_market_agent_tooling/markets/manifold/manifold.py,sha256=qemQIwuFg4yf6egGWFp9lWpz1lXr02QiBeZ2akcT6II,5026
46
46
  prediction_market_agent_tooling/markets/manifold/utils.py,sha256=cPPFWXm3vCYH1jy7_ctJZuQH9ZDaPL4_AgAYzGWkoow,513
47
47
  prediction_market_agent_tooling/markets/market_fees.py,sha256=Q64T9uaJx0Vllt0BkrPmpMEz53ra-hMVY8Czi7CEP7s,1227
48
- prediction_market_agent_tooling/markets/markets.py,sha256=_b-BAfoKIcXl5ZXVODi1ywMhRCbc52022csH1nQT084,3893
48
+ prediction_market_agent_tooling/markets/markets.py,sha256=5x_bX_Mr-696RGXL97qZWnkqq6uV3q2stI-v2-dcaHs,3894
49
49
  prediction_market_agent_tooling/markets/metaculus/api.py,sha256=4TRPGytQQbSdf42DCg2M_JWYPAuNjqZ3eBqaQBLkNks,2736
50
50
  prediction_market_agent_tooling/markets/metaculus/data_models.py,sha256=Suxa7xELdYuFNKqvGvFh8qyfVtAg79E-vaQ6dqNZOtA,3261
51
51
  prediction_market_agent_tooling/markets/metaculus/metaculus.py,sha256=86TIx6cavEWc8Cv4KpZxSvwiSw9oFybXE3YB49pg-CA,4377
52
52
  prediction_market_agent_tooling/markets/omen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  prediction_market_agent_tooling/markets/omen/data_models.py,sha256=javEACWZL-9y-BaFpyXu-Rl0tQJxMlOWu_vZ89nqK8w,28387
54
- prediction_market_agent_tooling/markets/omen/omen.py,sha256=zmERtzp1JNsd-8Bo-chnj30MDJX3rfLc3JPEHObaFFY,51851
54
+ prediction_market_agent_tooling/markets/omen/omen.py,sha256=XU0A-Uj4FAYY2a_o5Gq2_PtmowxoVvwCY5BDVdcyIjk,51852
55
55
  prediction_market_agent_tooling/markets/omen/omen_contracts.py,sha256=baXJwk-jSI3-FV-k239oCNOA4oKz6LT47juX8AKpW3A,28297
56
- prediction_market_agent_tooling/markets/omen/omen_resolving.py,sha256=ZmOmCeRMkfY9_AodX3-L2dIgUz9IW7aVd9mxNMyGyQc,9427
56
+ prediction_market_agent_tooling/markets/omen/omen_resolving.py,sha256=TTi-HP_fUHKH5YTlWSBdszQFb5q3pfzXnXr1FsFu3bM,9703
57
57
  prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py,sha256=mZ0CgKfHj0gLFq9plNpBhNqMuclb8V3qNagWfLYcpUc,38806
58
58
  prediction_market_agent_tooling/markets/polymarket/api.py,sha256=UZ4_TG8ceb9Y-qgsOKs8Qiv8zDt957QkT8IX2c83yqo,4800
59
59
  prediction_market_agent_tooling/markets/polymarket/data_models.py,sha256=Fd5PI5y3mJM8VHExBhWFWEnuuIKxQmIAXgBuoPDvNjw,4341
@@ -73,18 +73,18 @@ prediction_market_agent_tooling/monitor/monitor_settings.py,sha256=Xiozs3AsufuJ0
73
73
  prediction_market_agent_tooling/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
74
  prediction_market_agent_tooling/tools/balances.py,sha256=PhLUKHKJR5Fx9j2EcaUzuQRnnZJM10cw70SxVdsELlI,962
75
75
  prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py,sha256=TKVF8qZhxgz-4TTEHr7iVLfpurIhuji38qLc8CYaiXA,4662
76
- prediction_market_agent_tooling/tools/betting_strategies/market_moving.py,sha256=J63kFdDlTHLjWwHE5pDp1fArWpuU6hNNFVpGLE1aRYw,5269
76
+ prediction_market_agent_tooling/tools/betting_strategies/market_moving.py,sha256=Ej2s9fiG_iLWvgj1o5rtxN7NR4jmq8Y9syP5PCGIx6U,5270
77
77
  prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py,sha256=-FUSuQQgjcWSSnoFxnlAyTeilY6raJABJVM2QKkFqAY,438
78
78
  prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py,sha256=THMXwFlskvzbjnX_OiYtDSzI8XVFyULWfP2525_9UGc,429
79
79
  prediction_market_agent_tooling/tools/betting_strategies/utils.py,sha256=kpIb-ci67Vc1Yqqaa-_S4OUkbhWSIYog4_Iwp69HU_k,97
80
80
  prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=aafau_n_AUbLIwkyIRiTPgKB0dmM0767mSqyPDLF2A4,10576
81
81
  prediction_market_agent_tooling/tools/caches/inmemory_cache.py,sha256=ZW5iI5rmjqeAebu5T7ftRnlkxiL02IC-MxCfDB80x7w,1506
82
- prediction_market_agent_tooling/tools/caches/serializers.py,sha256=upSXN5__rmRlzJ6tv1h7FodKzJu9eCkFrN_zeuwroJM,2151
83
- prediction_market_agent_tooling/tools/contract.py,sha256=glnPQr9B0WmhLcdifD892zLPaHS5f0fZZ3dKLOUB6pI,29559
82
+ prediction_market_agent_tooling/tools/caches/serializers.py,sha256=vFDx4fsPxclXp2q0sv27j4al_M_Tj9aR2JJP-xNHQXA,2151
83
+ prediction_market_agent_tooling/tools/contract.py,sha256=aNWfNlbo-5hrgWm-uyhtK0d6p4H2ktM_7MzyzeicCeY,29560
84
84
  prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
85
85
  prediction_market_agent_tooling/tools/custom_exceptions.py,sha256=Fh8z1fbwONvP4-j7AmV_PuEcoqb6-QXa9PJ9m7guMcM,93
86
86
  prediction_market_agent_tooling/tools/data_models.py,sha256=jDQ7FU0QQhXlcgJh5VZZGwDTYP2OPAqKPHZFewCPAUY,732
87
- prediction_market_agent_tooling/tools/datetime_utc.py,sha256=2JSWF7AXQnv04_D_cu9Vmdkq0TWmGJ1QcK9AeqrA-U8,2765
87
+ prediction_market_agent_tooling/tools/datetime_utc.py,sha256=8_WackjtjC8zHXrhQFTGQ6e6Fz_6llWoKR4CSFvIv9I,2766
88
88
  prediction_market_agent_tooling/tools/db/db_manager.py,sha256=GtzHH1NLl8HwqC8Z7s6eTlIQXuV0blxfaV2PeQrBnfQ,3013
89
89
  prediction_market_agent_tooling/tools/google_utils.py,sha256=t3_UEEvKX3L0biSIQ560GdRbllQ6eprhK_upE243A-0,3185
90
90
  prediction_market_agent_tooling/tools/hexbytes_custom.py,sha256=Bp94qgPjvjWf1Vb4lNzGFDXRdThw1rJ91vL6r2PWq5E,2096
@@ -92,8 +92,8 @@ prediction_market_agent_tooling/tools/httpx_cached_client.py,sha256=RxD-hwtZCMct
92
92
  prediction_market_agent_tooling/tools/image_gen/image_gen.py,sha256=HzRwBx62hOXBOmrtpkXaP9Qq1Ku03uUGdREocyjLQ_k,1266
93
93
  prediction_market_agent_tooling/tools/image_gen/market_thumbnail_gen.py,sha256=jgOow4zw6g8dIJrog6Tp-3NQs4wjUJ3VgVKyMQv-0QM,1286
94
94
  prediction_market_agent_tooling/tools/ipfs/ipfs_handler.py,sha256=CTTMfTvs_8PH4kAtlQby2aeEKwgpmxtuGbd4oYIdJ2A,1201
95
- prediction_market_agent_tooling/tools/is_invalid.py,sha256=vuX0TKKhc_7iVnwAjXvfZeFwjr9nyYgREaYQDe-GYgA,5334
96
- prediction_market_agent_tooling/tools/is_predictable.py,sha256=dSuL8eLnGNKd_MQ3CaT1OuQkAykr3m5kn7f8HHKgDcM,6797
95
+ prediction_market_agent_tooling/tools/is_invalid.py,sha256=TAHQXiiusAU45xJ11ZyEP7PnEfcjfzVG7qHRbsHiAd0,5335
96
+ prediction_market_agent_tooling/tools/is_predictable.py,sha256=qVd6zqay2Dg2fyeAuZvAFqSHMg71TcPfCZULsVk2XvA,6797
97
97
  prediction_market_agent_tooling/tools/langfuse_.py,sha256=jI_4ROxqo41CCnWGS1vN_AeDVhRzLMaQLxH3kxDu3L8,1153
98
98
  prediction_market_agent_tooling/tools/langfuse_client_utils.py,sha256=83T31s-YbsnNBLyYCjmBI2BBKUEqJUuYFa0uCdkoqy8,5901
99
99
  prediction_market_agent_tooling/tools/omen/reality_accuracy.py,sha256=M1SF7iSW1gVlQSTskdVFTn09uPLST23YeipVIWj54io,2236
@@ -107,10 +107,10 @@ prediction_market_agent_tooling/tools/streamlit_user_login.py,sha256=NXEqfjT9Lc9
107
107
  prediction_market_agent_tooling/tools/tavily/tavily_models.py,sha256=5ldQs1pZe6uJ5eDAuP4OLpzmcqYShlIV67kttNFvGS0,342
108
108
  prediction_market_agent_tooling/tools/tavily/tavily_search.py,sha256=Kw2mXNkMTYTEe1MBSTqhQmLoeXtgb6CkmHlcAJvhtqE,3809
109
109
  prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
110
- prediction_market_agent_tooling/tools/utils.py,sha256=WvuUCHgMCiMq8_wMm5PHNwvLhcdDk2zGKaAM8OUC-qY,6438
110
+ prediction_market_agent_tooling/tools/utils.py,sha256=jLG4nbEoIzzJiZ4RgMx4Q969Zdl0p0s63p8uET_0Fuw,6440
111
111
  prediction_market_agent_tooling/tools/web3_utils.py,sha256=wqUDCed3iNrn1Wao1iwGN6tzIrhpzrTRj319wlveJEo,12275
112
- prediction_market_agent_tooling-0.57.12.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
113
- prediction_market_agent_tooling-0.57.12.dist-info/METADATA,sha256=Ba_pGJdY3JCswMW1-3Ydts3bhUxk4PW4Y-A8_CujSZc,8240
114
- prediction_market_agent_tooling-0.57.12.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
115
- prediction_market_agent_tooling-0.57.12.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
116
- prediction_market_agent_tooling-0.57.12.dist-info/RECORD,,
112
+ prediction_market_agent_tooling-0.57.13.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
113
+ prediction_market_agent_tooling-0.57.13.dist-info/METADATA,sha256=60C_f4ZOm6fkwEnVhSI_b0if9E2sVUYeNNrT7Uq8200,8240
114
+ prediction_market_agent_tooling-0.57.13.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
115
+ prediction_market_agent_tooling-0.57.13.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
116
+ prediction_market_agent_tooling-0.57.13.dist-info/RECORD,,