prediction-market-agent-tooling 0.65.1__py3-none-any.whl → 0.65.2__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.
@@ -122,10 +122,15 @@ class PriceManager:
122
122
  # Inspired by https://github.com/seer-pm/demo/blob/ca682153a6b4d4dd3dcc4ad8bdcbe32202fc8fe7/web/src/hooks/useMarketOdds.ts#L15
123
123
  price_data: dict[HexAddress, CollateralToken] = {}
124
124
 
125
- for wrapped_token in self.seer_market.wrapped_tokens:
125
+ for idx, wrapped_token in enumerate(self.seer_market.wrapped_tokens):
126
126
  price = self.get_price_for_token(
127
127
  token=Web3.to_checksum_address(wrapped_token),
128
128
  )
129
+ # It's okay if invalid (last) outcome has price 0, but not the other outcomes.
130
+ if price is None and idx != len(self.seer_market.wrapped_tokens) - 1:
131
+ raise ValueError(
132
+ f"Couldn't get price for {wrapped_token} for market {self.seer_market.url}."
133
+ )
129
134
  price_data[wrapped_token] = (
130
135
  price if price is not None else CollateralToken.zero()
131
136
  )
@@ -137,10 +142,9 @@ class PriceManager:
137
142
  sum(price_data.values(), start=CollateralToken.zero())
138
143
  == CollateralToken.zero()
139
144
  ):
140
- return {
141
- OutcomeStr(outcome): Probability(0)
142
- for outcome in self.seer_market.outcomes
143
- }
145
+ raise ValueError(
146
+ f"All prices for market {self.seer_market.url} are zero. This shouldn't happen."
147
+ )
144
148
 
145
149
  for outcome_token, price in price_data.items():
146
150
  old_price = price
@@ -9,7 +9,7 @@ from prediction_market_agent_tooling.deploy.constants import (
9
9
  NO_OUTCOME_LOWERCASE_IDENTIFIER,
10
10
  YES_OUTCOME_LOWERCASE_IDENTIFIER,
11
11
  )
12
- from prediction_market_agent_tooling.gtypes import ChecksumAddress
12
+ from prediction_market_agent_tooling.gtypes import ChecksumAddress, Wei
13
13
  from prediction_market_agent_tooling.loggers import logger
14
14
  from prediction_market_agent_tooling.markets.agent_market import FilterBy, SortBy
15
15
  from prediction_market_agent_tooling.markets.base_subgraph_handler import (
@@ -77,6 +77,7 @@ class SeerSubgraphHandler(BaseSubgraphHandler):
77
77
  @staticmethod
78
78
  def _build_where_statements(
79
79
  filter_by: FilterBy,
80
+ outcome_supply_gt_if_open: Wei,
80
81
  include_conditional_markets: bool = False,
81
82
  include_categorical_markets: bool = True,
82
83
  ) -> dict[Any, Any]:
@@ -88,6 +89,7 @@ class SeerSubgraphHandler(BaseSubgraphHandler):
88
89
  case FilterBy.OPEN:
89
90
  and_stms["openingTs_gt"] = now
90
91
  and_stms["hasAnswers"] = False
92
+ and_stms["outcomesSupply_gt"] = outcome_supply_gt_if_open.value
91
93
  case FilterBy.RESOLVED:
92
94
  # We consider RESOLVED == CLOSED (on Seer UI)
93
95
  and_stms["payoutReported"] = True
@@ -154,6 +156,7 @@ class SeerSubgraphHandler(BaseSubgraphHandler):
154
156
  filter_by: FilterBy,
155
157
  sort_by: SortBy = SortBy.NONE,
156
158
  limit: int | None = None,
159
+ outcome_supply_gt_if_open: Wei = Wei(0),
157
160
  include_conditional_markets: bool = True,
158
161
  include_categorical_markets: bool = True,
159
162
  ) -> list[SeerMarket]:
@@ -163,6 +166,7 @@ class SeerSubgraphHandler(BaseSubgraphHandler):
163
166
  # Binary markets on Seer contain 3 outcomes: OutcomeA, outcomeB and an Invalid option.
164
167
  where_stms = self._build_where_statements(
165
168
  filter_by=filter_by,
169
+ outcome_supply_gt_if_open=outcome_supply_gt_if_open,
166
170
  include_conditional_markets=include_conditional_markets,
167
171
  include_categorical_markets=include_categorical_markets,
168
172
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.65.1
3
+ Version: 0.65.2
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.13
@@ -67,10 +67,10 @@ prediction_market_agent_tooling/markets/polymarket/data_models_web.py,sha256=wCw
67
67
  prediction_market_agent_tooling/markets/polymarket/polymarket.py,sha256=meAhQ5_gwVDvlSxhGGVAvRB7B47zKLnRvZ-_13tKtwY,3433
68
68
  prediction_market_agent_tooling/markets/polymarket/utils.py,sha256=8kTeVjXPcXC6DkDvWYsZQLY7x8DS6CEp_yznSEazsNU,2037
69
69
  prediction_market_agent_tooling/markets/seer/data_models.py,sha256=G0i-fnVaK16KWDYVI6w3lvyte6Op7ca_iIC8IfrXmlM,4702
70
- prediction_market_agent_tooling/markets/seer/price_manager.py,sha256=ciplVu2BnI9D9REq9x9cVlBLlzhzZSMmNWTulfO2YRg,5787
70
+ prediction_market_agent_tooling/markets/seer/price_manager.py,sha256=4hSSDyxSj9po9-tRrdtNvJ2d9v0xXT08Ezgbk1JDE3c,6122
71
71
  prediction_market_agent_tooling/markets/seer/seer.py,sha256=5uSKUhyM_3PTguYi9yiD3-E5Famb6M_fayBX1NqebAE,20273
72
72
  prediction_market_agent_tooling/markets/seer/seer_contracts.py,sha256=kH9nPXsx6UM5er42g2f3fLvy36sY5JM2f_beXeuNgUc,3790
73
- prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py,sha256=v7gOlRRsbj1xpQiz3D3TE6gbO8_Itg2xhPeTqU9DBsc,9701
73
+ prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py,sha256=pJxch9_u0EdiIatQP1-UFClt8UEfMZAXBlk5wDO_ovk,9940
74
74
  prediction_market_agent_tooling/markets/seer/subgraph_data_models.py,sha256=0izxS8Mtzonfdl9UqvFVXrdj0hVzieroekXhogfZKCw,1817
75
75
  prediction_market_agent_tooling/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
76
  prediction_market_agent_tooling/tools/_generic_value.py,sha256=pD_PI13lpPp1gFoljHwa_Lzlp-u2pu0m-Z7LcxwDM2U,10618
@@ -116,8 +116,8 @@ prediction_market_agent_tooling/tools/tokens/usd.py,sha256=yuW8iPPtcpP4eLH2nORMD
116
116
  prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
117
117
  prediction_market_agent_tooling/tools/utils.py,sha256=Jzpck3_QwShhejhgbAhmNxPSOPQJssBQep0eVemVjZ4,7064
118
118
  prediction_market_agent_tooling/tools/web3_utils.py,sha256=zRq-eeBGWt8uUGN9G_WfjmJ0eVvO8aWE9S0Pz_Y6AOA,12342
119
- prediction_market_agent_tooling-0.65.1.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
120
- prediction_market_agent_tooling-0.65.1.dist-info/METADATA,sha256=kpSC3I15pU7pCOkvGEv_nl5WiXDyDzk9JegAlbWdkRg,8734
121
- prediction_market_agent_tooling-0.65.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
122
- prediction_market_agent_tooling-0.65.1.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
123
- prediction_market_agent_tooling-0.65.1.dist-info/RECORD,,
119
+ prediction_market_agent_tooling-0.65.2.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
120
+ prediction_market_agent_tooling-0.65.2.dist-info/METADATA,sha256=jBOq7XzJn2iSjWMZMgdo0kdt-KZ26z6KP2pKb3EqtaY,8734
121
+ prediction_market_agent_tooling-0.65.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
122
+ prediction_market_agent_tooling-0.65.2.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
123
+ prediction_market_agent_tooling-0.65.2.dist-info/RECORD,,