prediction-market-agent-tooling 0.62.1__tar.gz → 0.63.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.
Files changed (128) hide show
  1. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/PKG-INFO +1 -1
  2. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/deploy/betting_strategy.py +21 -5
  3. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/agent_market.py +3 -1
  4. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/blockchain_utils.py +5 -1
  5. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/omen/omen.py +1 -0
  6. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/seer/data_models.py +4 -65
  7. prediction_market_agent_tooling-0.63.0/prediction_market_agent_tooling/markets/seer/price_manager.py +117 -0
  8. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/seer/seer.py +94 -46
  9. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/seer/seer_contracts.py +3 -3
  10. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py +47 -18
  11. prediction_market_agent_tooling-0.63.0/prediction_market_agent_tooling/markets/seer/subgraph_data_models.py +64 -0
  12. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/contract.py +11 -0
  13. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/cow/cow_order.py +52 -12
  14. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/tokens/token_utils.py +4 -3
  15. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/tokens/usd.py +7 -6
  16. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/pyproject.toml +1 -1
  17. prediction_market_agent_tooling-0.62.1/prediction_market_agent_tooling/tools/cow/cow_manager.py +0 -112
  18. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/LICENSE +0 -0
  19. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/README.md +0 -0
  20. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/debuggingcontract.abi.json +0 -0
  21. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/depositablewrapper_erc20.abi.json +0 -0
  22. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/erc20.abi.json +0 -0
  23. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/erc4626.abi.json +0 -0
  24. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/erc721.abi.json +0 -0
  25. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/omen_agentresultmapping.abi.json +0 -0
  26. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/omen_dxdao.abi.json +0 -0
  27. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/omen_fpmm.abi.json +0 -0
  28. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/omen_fpmm_conditionaltokens.abi.json +0 -0
  29. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/omen_fpmm_factory.abi.json +0 -0
  30. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/omen_kleros.abi.json +0 -0
  31. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/omen_oracle.abi.json +0 -0
  32. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/omen_realitio.abi.json +0 -0
  33. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/omen_thumbnailmapping.abi.json +0 -0
  34. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/ownable.abi.json +0 -0
  35. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/ownable_erc721.abi.json +0 -0
  36. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/proxy.abi.json +0 -0
  37. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/abis/seer_market_factory.abi.json +0 -0
  38. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/benchmark/__init__.py +0 -0
  39. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/benchmark/agents.py +0 -0
  40. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/benchmark/benchmark.py +0 -0
  41. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/benchmark/utils.py +0 -0
  42. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/config.py +0 -0
  43. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/deploy/agent.py +0 -0
  44. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/deploy/agent_example.py +0 -0
  45. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/deploy/constants.py +0 -0
  46. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/deploy/gcp/deploy.py +0 -0
  47. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/deploy/gcp/kubernetes_models.py +0 -0
  48. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/deploy/gcp/utils.py +0 -0
  49. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/deploy/trade_interval.py +0 -0
  50. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/gtypes.py +0 -0
  51. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/jobs/__init__.py +0 -0
  52. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/jobs/jobs_models.py +0 -0
  53. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/jobs/omen/omen_jobs.py +0 -0
  54. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/loggers.py +0 -0
  55. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/base_subgraph_handler.py +0 -0
  56. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/categorize.py +0 -0
  57. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/data_models.py +0 -0
  58. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/manifold/__init__.py +0 -0
  59. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/manifold/api.py +0 -0
  60. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/manifold/data_models.py +0 -0
  61. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/manifold/manifold.py +0 -0
  62. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/manifold/utils.py +0 -0
  63. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/market_fees.py +0 -0
  64. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/markets.py +0 -0
  65. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/metaculus/api.py +0 -0
  66. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/metaculus/data_models.py +0 -0
  67. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/metaculus/metaculus.py +0 -0
  68. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/omen/__init__.py +0 -0
  69. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/omen/data_models.py +0 -0
  70. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/omen/omen_constants.py +0 -0
  71. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/omen/omen_contracts.py +0 -0
  72. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/omen/omen_resolving.py +0 -0
  73. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py +0 -0
  74. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/polymarket/api.py +0 -0
  75. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/polymarket/data_models.py +0 -0
  76. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/polymarket/data_models_web.py +0 -0
  77. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/polymarket/polymarket.py +0 -0
  78. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/markets/polymarket/utils.py +0 -0
  79. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/monitor/financial_metrics/financial_metrics.py +0 -0
  80. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/monitor/markets/manifold.py +0 -0
  81. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/monitor/markets/metaculus.py +0 -0
  82. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/monitor/markets/omen.py +0 -0
  83. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/monitor/markets/polymarket.py +0 -0
  84. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/monitor/monitor.py +0 -0
  85. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/monitor/monitor_app.py +0 -0
  86. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/monitor/monitor_settings.py +0 -0
  87. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/py.typed +0 -0
  88. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/_generic_value.py +0 -0
  89. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/balances.py +0 -0
  90. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py +0 -0
  91. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/betting_strategies/market_moving.py +0 -0
  92. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py +0 -0
  93. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py +0 -0
  94. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/betting_strategies/utils.py +0 -0
  95. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/caches/db_cache.py +0 -0
  96. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/caches/inmemory_cache.py +0 -0
  97. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/caches/serializers.py +0 -0
  98. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/costs.py +0 -0
  99. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/custom_exceptions.py +0 -0
  100. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/datetime_utc.py +0 -0
  101. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/db/db_manager.py +0 -0
  102. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/google_utils.py +0 -0
  103. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/hexbytes_custom.py +0 -0
  104. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/httpx_cached_client.py +0 -0
  105. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/image_gen/image_gen.py +0 -0
  106. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/image_gen/market_thumbnail_gen.py +0 -0
  107. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/ipfs/ipfs_handler.py +0 -0
  108. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/is_invalid.py +0 -0
  109. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/is_predictable.py +0 -0
  110. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/langfuse_.py +0 -0
  111. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/langfuse_client_utils.py +0 -0
  112. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/omen/reality_accuracy.py +0 -0
  113. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/omen/sell_positions.py +0 -0
  114. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/parallelism.py +0 -0
  115. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/relevant_news_analysis/data_models.py +0 -0
  116. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_analysis.py +0 -0
  117. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_cache.py +0 -0
  118. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/safe.py +0 -0
  119. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/singleton.py +0 -0
  120. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/streamlit_user_login.py +0 -0
  121. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/tavily/tavily_models.py +0 -0
  122. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/tavily/tavily_search.py +0 -0
  123. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/tokens/auto_deposit.py +0 -0
  124. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/tokens/auto_withdraw.py +0 -0
  125. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/tokens/main_token.py +0 -0
  126. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/transaction_cache.py +0 -0
  127. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/utils.py +0 -0
  128. {prediction_market_agent_tooling-0.62.1 → prediction_market_agent_tooling-0.63.0}/prediction_market_agent_tooling/tools/web3_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.62.1
3
+ Version: 0.63.0
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.13
@@ -47,23 +47,39 @@ class BettingStrategy(ABC):
47
47
  @staticmethod
48
48
  def assert_buy_trade_wont_be_guaranteed_loss(
49
49
  market: AgentMarket, trades: list[Trade]
50
- ) -> None:
50
+ ) -> list[Trade]:
51
+ clean_trades = []
51
52
  for trade in trades:
52
53
  if trade.trade_type == TradeType.BUY:
53
54
  outcome_tokens_to_get = market.get_buy_token_amount(
54
55
  trade.amount, trade.outcome
55
56
  )
57
+
58
+ if not outcome_tokens_to_get:
59
+ logger.info(
60
+ f"Could not determine buy_token_amount for trade {trade}. Skipping trade."
61
+ )
62
+ continue
63
+
56
64
  outcome_tokens_to_get_in_usd = market.get_token_in_usd(
57
65
  outcome_tokens_to_get.as_token
58
66
  )
67
+
59
68
  if outcome_tokens_to_get_in_usd <= trade.amount:
60
69
  raise GuaranteedLossError(
61
- f"Trade {trade=} would result in guaranteed loss by getting only {outcome_tokens_to_get=}."
70
+ f"Trade {trade=} would result in guaranteed loss by getting only {outcome_tokens_to_get=}. Halting execution."
62
71
  )
63
72
 
73
+ clean_trades.append(trade)
74
+
75
+ return clean_trades
76
+
64
77
  @staticmethod
65
- def check_trades(market: AgentMarket, trades: list[Trade]) -> None:
66
- BettingStrategy.assert_buy_trade_wont_be_guaranteed_loss(market, trades)
78
+ def filter_trades(market: AgentMarket, trades: list[Trade]) -> list[Trade]:
79
+ trades = BettingStrategy.assert_buy_trade_wont_be_guaranteed_loss(
80
+ market, trades
81
+ )
82
+ return trades
67
83
 
68
84
  def _build_rebalance_trades_from_positions(
69
85
  self,
@@ -109,7 +125,7 @@ class BettingStrategy(ABC):
109
125
  trades.sort(key=lambda t: t.trade_type == TradeType.SELL)
110
126
 
111
127
  # Run some sanity checks to not place unreasonable bets.
112
- BettingStrategy.check_trades(market, trades)
128
+ trades = BettingStrategy.filter_trades(market, trades)
113
129
 
114
130
  return trades
115
131
 
@@ -4,6 +4,7 @@ from enum import Enum
4
4
  from eth_typing import ChecksumAddress
5
5
  from pydantic import BaseModel, field_validator, model_validator
6
6
  from pydantic_core.core_schema import FieldValidationInfo
7
+ from web3 import Web3
7
8
 
8
9
  from prediction_market_agent_tooling.config import APIKeys
9
10
  from prediction_market_agent_tooling.gtypes import (
@@ -235,7 +236,7 @@ class AgentMarket(BaseModel):
235
236
 
236
237
  def get_buy_token_amount(
237
238
  self, bet_amount: USD | CollateralToken, direction: bool
238
- ) -> OutcomeToken:
239
+ ) -> OutcomeToken | None:
239
240
  raise NotImplementedError("Subclasses must implement this method")
240
241
 
241
242
  def sell_tokens(self, outcome: bool, amount: USD | OutcomeToken) -> str:
@@ -293,6 +294,7 @@ class AgentMarket(BaseModel):
293
294
  traded_market: ProcessedTradedMarket | None,
294
295
  keys: APIKeys,
295
296
  agent_name: str,
297
+ web3: Web3 | None = None,
296
298
  ) -> None:
297
299
  """
298
300
  If market allows to upload trades somewhere, implement it in this method.
@@ -22,10 +22,11 @@ def store_trades(
22
22
  traded_market: ProcessedTradedMarket | None,
23
23
  keys: APIKeys,
24
24
  agent_name: str,
25
+ web3: Web3 | None = None,
25
26
  ) -> None:
26
27
  if traded_market is None:
27
28
  logger.warning(f"No prediction for market {market_id}, not storing anything.")
28
- return
29
+ return None
29
30
 
30
31
  reasoning = traded_market.answer.reasoning if traded_market.answer.reasoning else ""
31
32
 
@@ -37,9 +38,11 @@ def store_trades(
37
38
  )
38
39
  ipfs_hash_decoded = ipfscidv0_to_byte32(ipfs_hash)
39
40
 
41
+ # tx_hashes must be list of bytes32 (see Solidity contract).
40
42
  tx_hashes = [
41
43
  HexBytes(HexStr(i.id)) for i in traded_market.trades if i.id is not None
42
44
  ]
45
+
43
46
  prediction = ContractPrediction(
44
47
  publisher=keys.bet_from_address,
45
48
  ipfs_hash=ipfs_hash_decoded,
@@ -50,6 +53,7 @@ def store_trades(
50
53
  api_keys=keys,
51
54
  market_address=Web3.to_checksum_address(market_id),
52
55
  prediction=prediction,
56
+ web3=web3,
53
57
  )
54
58
  logger.info(
55
59
  f"Added prediction to market {market_id}. - receipt {tx_receipt['transactionHash'].hex()}."
@@ -424,6 +424,7 @@ class OmenAgentMarket(AgentMarket):
424
424
  traded_market: ProcessedTradedMarket | None,
425
425
  keys: APIKeys,
426
426
  agent_name: str,
427
+ web3: Web3 | None = None,
427
428
  ) -> None:
428
429
  return store_trades(
429
430
  market_id=self.id,
@@ -10,16 +10,15 @@ from web3.constants import ADDRESS_ZERO
10
10
  from prediction_market_agent_tooling.config import RPCConfig
11
11
  from prediction_market_agent_tooling.gtypes import (
12
12
  ChecksumAddress,
13
- CollateralToken,
14
13
  HexAddress,
15
14
  HexBytes,
16
15
  OutcomeStr,
17
- Probability,
18
16
  Web3Wei,
19
17
  )
20
- from prediction_market_agent_tooling.loggers import logger
21
18
  from prediction_market_agent_tooling.markets.data_models import Resolution
22
- from prediction_market_agent_tooling.tools.cow.cow_manager import CowManager
19
+ from prediction_market_agent_tooling.markets.seer.subgraph_data_models import (
20
+ SeerParentMarket,
21
+ )
23
22
  from prediction_market_agent_tooling.tools.datetime_utc import DatetimeUTC
24
23
 
25
24
 
@@ -84,10 +83,6 @@ class SeerOutcomeEnum(str, Enum):
84
83
  raise ValueError(f"Unknown outcome: {self}")
85
84
 
86
85
 
87
- class SeerParentMarket(BaseModel):
88
- id: HexBytes
89
-
90
-
91
86
  SEER_BASE_URL = "https://app.seer.pm"
92
87
 
93
88
 
@@ -110,6 +105,7 @@ class SeerMarket(BaseModel):
110
105
  has_answers: bool | None = Field(alias="hasAnswers")
111
106
  payout_reported: bool = Field(alias="payoutReported")
112
107
  payout_numerators: list[int] = Field(alias="payoutNumerators")
108
+ outcomes_supply: int = Field(alias="outcomesSupply")
113
109
 
114
110
  @property
115
111
  def has_valid_answer(self) -> bool:
@@ -186,64 +182,7 @@ class SeerMarket(BaseModel):
186
182
  def created_time(self) -> DatetimeUTC:
187
183
  return DatetimeUTC.to_datetime_utc(self.block_timestamp)
188
184
 
189
- @property
190
- def current_p_yes(self) -> Probability:
191
- price_data = {}
192
- for idx in range(len(self.outcomes)):
193
- wrapped_token = self.wrapped_tokens[idx]
194
- price = self._get_price_for_token(
195
- token=Web3.to_checksum_address(wrapped_token)
196
- )
197
- price_data[idx] = price
198
-
199
- if sum(price_data.values()) == 0:
200
- logger.warning(
201
- f"Could not get p_yes for market {self.id.hex()}, all price quotes are 0."
202
- )
203
- return Probability(0)
204
-
205
- yes_idx = self.outcome_as_enums[SeerOutcomeEnum.YES]
206
- price_yes = price_data[yes_idx] / sum(price_data.values())
207
- return Probability(price_yes)
208
-
209
- def _get_price_for_token(self, token: ChecksumAddress) -> float:
210
- collateral_exchange_amount = CollateralToken(1).as_wei
211
- try:
212
- quote = CowManager().get_quote(
213
- collateral_token=self.collateral_token_contract_address_checksummed,
214
- buy_token=token,
215
- sell_amount=collateral_exchange_amount,
216
- )
217
- except Exception as e:
218
- logger.warning(f"Could not get quote for {token=}, returning price 0. {e=}")
219
- return 0
220
-
221
- return collateral_exchange_amount.value / float(quote.quote.buyAmount.root)
222
-
223
185
  @property
224
186
  def url(self) -> str:
225
187
  chain_id = RPCConfig().chain_id
226
188
  return urljoin(SEER_BASE_URL, f"markets/{chain_id}/{self.id.hex()}")
227
-
228
-
229
- class SeerToken(BaseModel):
230
- id: HexBytes
231
- name: str
232
- symbol: str
233
-
234
-
235
- class SeerPool(BaseModel):
236
- model_config = ConfigDict(populate_by_name=True)
237
- id: HexBytes
238
- liquidity: int
239
- token0: SeerToken
240
- token1: SeerToken
241
-
242
-
243
- class NewMarketEvent(BaseModel):
244
- market: HexAddress
245
- marketName: str
246
- parentMarket: HexAddress
247
- conditionId: HexBytes
248
- questionId: HexBytes
249
- questionsIds: list[HexBytes]
@@ -0,0 +1,117 @@
1
+ from web3 import Web3
2
+
3
+ from prediction_market_agent_tooling.gtypes import (
4
+ ChecksumAddress,
5
+ CollateralToken,
6
+ Probability,
7
+ )
8
+ from prediction_market_agent_tooling.loggers import logger
9
+ from prediction_market_agent_tooling.markets.seer.data_models import (
10
+ SeerMarket,
11
+ SeerOutcomeEnum,
12
+ )
13
+ from prediction_market_agent_tooling.markets.seer.seer_subgraph_handler import (
14
+ SeerSubgraphHandler,
15
+ )
16
+ from prediction_market_agent_tooling.markets.seer.subgraph_data_models import SeerPool
17
+ from prediction_market_agent_tooling.tools.cow.cow_order import get_quote
18
+ from prediction_market_agent_tooling.tools.hexbytes_custom import HexBytes
19
+
20
+
21
+ class PriceManager:
22
+ def __init__(self, seer_market: SeerMarket, seer_subgraph: SeerSubgraphHandler):
23
+ self.seer_market = seer_market
24
+ self.seer_subgraph = seer_subgraph
25
+
26
+ @staticmethod
27
+ def build(market_id: HexBytes) -> "PriceManager":
28
+ s = SeerSubgraphHandler()
29
+ market = s.get_market_by_id(market_id=market_id)
30
+ return PriceManager(seer_market=market, seer_subgraph=s)
31
+
32
+ def _log_track_price_normalization_diff(
33
+ self, old_price: float, normalized_price: float, max_price_diff: float = 0.05
34
+ ) -> None:
35
+ price_diff_pct = abs(old_price - normalized_price) / old_price
36
+ if price_diff_pct > max_price_diff:
37
+ logger.info(
38
+ f"{price_diff_pct=} larger than {max_price_diff=} for seer market {self.seer_market.id.hex()} "
39
+ )
40
+
41
+ def current_p_yes(self) -> Probability | None:
42
+ # Inspired by https://github.com/seer-pm/demo/blob/ca682153a6b4d4dd3dcc4ad8bdcbe32202fc8fe7/web/src/hooks/useMarketOdds.ts#L15
43
+ price_data: dict[int, CollateralToken | None] = {}
44
+ for idx, wrapped_token in enumerate(self.seer_market.wrapped_tokens):
45
+ price = self.get_price_for_token(
46
+ token=Web3.to_checksum_address(wrapped_token),
47
+ )
48
+
49
+ price_data[idx] = price
50
+
51
+ price_yes = price_data[self.seer_market.outcome_as_enums[SeerOutcomeEnum.YES]]
52
+ price_no = price_data[self.seer_market.outcome_as_enums[SeerOutcomeEnum.NO]]
53
+
54
+ # We only return a probability if we have both price_yes and price_no, since we could place bets
55
+ # in both sides hence we need current probabilities for both outcomes.
56
+ if price_yes is not None and price_no is not None:
57
+ normalized_price_yes = price_yes / (price_yes + price_no)
58
+ self._log_track_price_normalization_diff(
59
+ old_price=price_yes.value, normalized_price=normalized_price_yes
60
+ )
61
+ return Probability(normalized_price_yes)
62
+ else:
63
+ return None
64
+
65
+ def get_price_for_token(
66
+ self,
67
+ token: ChecksumAddress,
68
+ collateral_exchange_amount: CollateralToken | None = None,
69
+ ) -> CollateralToken | None:
70
+ collateral_exchange_amount = (
71
+ collateral_exchange_amount
72
+ if collateral_exchange_amount is not None
73
+ else CollateralToken(1)
74
+ )
75
+
76
+ try:
77
+ quote = get_quote(
78
+ amount_wei=collateral_exchange_amount.as_wei,
79
+ sell_token=self.seer_market.collateral_token_contract_address_checksummed,
80
+ buy_token=token,
81
+ )
82
+
83
+ except Exception as e:
84
+ logger.warning(
85
+ f"Could not get quote for {token=} from Cow, exception {e=}. Falling back to pools. "
86
+ )
87
+ return self.get_token_price_from_pools(token=token)
88
+
89
+ price = collateral_exchange_amount / float(quote.quote.buyAmount.root)
90
+ return price
91
+
92
+ @staticmethod
93
+ def _pool_token0_matches_token(token: ChecksumAddress, pool: SeerPool) -> bool:
94
+ return pool.token0.id.hex().lower() == token.lower()
95
+
96
+ def get_token_price_from_pools(
97
+ self,
98
+ token: ChecksumAddress,
99
+ ) -> CollateralToken | None:
100
+ pool = SeerSubgraphHandler().get_pool_by_token(
101
+ token_address=token,
102
+ collateral_address=self.seer_market.collateral_token_contract_address_checksummed,
103
+ )
104
+
105
+ if not pool:
106
+ logger.warning(f"Could not find a pool for {token=}")
107
+ return None
108
+
109
+ # The mapping below is odd but surprisingly the Algebra subgraph delivers the token1Price
110
+ # for the token0 and the token0Price for the token1 pool.
111
+ # For example, in a outcomeYES (token0)/sDAI pool (token1), token1Price is the price of outcomeYES in units of sDAI.
112
+ price = (
113
+ pool.token1Price
114
+ if self._pool_token0_matches_token(token=token, pool=pool)
115
+ else pool.token0Price
116
+ )
117
+ return price
@@ -1,5 +1,6 @@
1
1
  import typing as t
2
2
 
3
+ from eth_pydantic_types import HexStr
3
4
  from eth_typing import ChecksumAddress
4
5
  from web3 import Web3
5
6
  from web3.types import TxReceipt
@@ -23,30 +24,29 @@ from prediction_market_agent_tooling.markets.agent_market import (
23
24
  ProcessedTradedMarket,
24
25
  SortBy,
25
26
  )
26
- from prediction_market_agent_tooling.markets.blockchain_utils import store_trades
27
27
  from prediction_market_agent_tooling.markets.data_models import ExistingPosition
28
28
  from prediction_market_agent_tooling.markets.market_fees import MarketFees
29
29
  from prediction_market_agent_tooling.markets.omen.omen import OmenAgentMarket
30
30
  from prediction_market_agent_tooling.markets.seer.data_models import (
31
- NewMarketEvent,
32
31
  SeerMarket,
33
32
  SeerOutcomeEnum,
34
33
  )
34
+ from prediction_market_agent_tooling.markets.seer.price_manager import PriceManager
35
35
  from prediction_market_agent_tooling.markets.seer.seer_contracts import (
36
36
  SeerMarketFactory,
37
37
  )
38
38
  from prediction_market_agent_tooling.markets.seer.seer_subgraph_handler import (
39
39
  SeerSubgraphHandler,
40
40
  )
41
+ from prediction_market_agent_tooling.markets.seer.subgraph_data_models import (
42
+ NewMarketEvent,
43
+ )
41
44
  from prediction_market_agent_tooling.tools.contract import (
42
45
  ContractERC20OnGnosisChain,
43
46
  init_collateral_token_contract,
44
47
  to_gnosis_chain_contract,
45
48
  )
46
- from prediction_market_agent_tooling.tools.cow.cow_manager import (
47
- CowManager,
48
- NoLiquidityAvailableOnCowException,
49
- )
49
+ from prediction_market_agent_tooling.tools.cow.cow_order import swap_tokens_waiting
50
50
  from prediction_market_agent_tooling.tools.datetime_utc import DatetimeUTC
51
51
  from prediction_market_agent_tooling.tools.tokens.auto_deposit import (
52
52
  auto_deposit_collateral_token,
@@ -93,13 +93,9 @@ class SeerAgentMarket(AgentMarket):
93
93
  traded_market: ProcessedTradedMarket | None,
94
94
  keys: APIKeys,
95
95
  agent_name: str,
96
+ web3: Web3 | None = None,
96
97
  ) -> None:
97
- return store_trades(
98
- market_id=self.id,
99
- traded_market=traded_market,
100
- keys=keys,
101
- agent_name=agent_name,
102
- )
98
+ pass
103
99
 
104
100
  def get_token_in_usd(self, x: CollateralToken) -> USD:
105
101
  return get_token_in_usd(x, self.collateral_token_contract_address_checksummed)
@@ -109,20 +105,22 @@ class SeerAgentMarket(AgentMarket):
109
105
 
110
106
  def get_buy_token_amount(
111
107
  self, bet_amount: USD | CollateralToken, direction: bool
112
- ) -> OutcomeToken:
108
+ ) -> OutcomeToken | None:
113
109
  """Returns number of outcome tokens returned for a given bet expressed in collateral units."""
114
110
 
115
111
  outcome_token = self.get_wrapped_token_for_outcome(direction)
116
112
  bet_amount_in_tokens = self.get_in_token(bet_amount)
117
- bet_amount_in_wei = bet_amount_in_tokens.as_wei
118
113
 
119
- quote = CowManager().get_quote(
120
- buy_token=outcome_token,
121
- sell_amount=bet_amount_in_wei,
122
- collateral_token=self.collateral_token_contract_address_checksummed,
114
+ p = PriceManager.build(market_id=HexBytes(HexStr(self.id)))
115
+ price = p.get_price_for_token(
116
+ token=outcome_token, collateral_exchange_amount=bet_amount_in_tokens
123
117
  )
124
- sell_amount = OutcomeWei(quote.quote.buyAmount.root).as_outcome_token
125
- return sell_amount
118
+ if not price:
119
+ logger.info(f"Could not get price for token {outcome_token}")
120
+ return None
121
+
122
+ amount_outcome_tokens = bet_amount_in_tokens / price
123
+ return OutcomeToken(amount_outcome_tokens)
126
124
 
127
125
  def get_outcome_str_from_bool(self, outcome: bool) -> OutcomeStr:
128
126
  outcome_translated = SeerOutcomeEnum.from_bool(outcome)
@@ -185,7 +183,17 @@ class SeerAgentMarket(AgentMarket):
185
183
  return OmenAgentMarket.verify_operational_balance(api_keys=api_keys)
186
184
 
187
185
  @staticmethod
188
- def from_data_model(model: SeerMarket) -> "SeerAgentMarket":
186
+ def from_data_model_with_subgraph(
187
+ model: SeerMarket, seer_subgraph: SeerSubgraphHandler
188
+ ) -> t.Optional["SeerAgentMarket"]:
189
+ p = PriceManager(seer_market=model, seer_subgraph=seer_subgraph)
190
+ current_p_yes = p.current_p_yes()
191
+ if not current_p_yes:
192
+ logger.info(
193
+ f"p_yes for market {model.id.hex()} could not be calculated. Skipping."
194
+ )
195
+ return None
196
+
189
197
  return SeerAgentMarket(
190
198
  id=model.id.hex(),
191
199
  question=model.title,
@@ -201,7 +209,7 @@ class SeerAgentMarket(AgentMarket):
201
209
  outcome_token_pool=None,
202
210
  resolution=model.get_resolution_enum(),
203
211
  volume=None,
204
- current_p_yes=model.current_p_yes,
212
+ current_p_yes=current_p_yes,
205
213
  seer_outcomes=model.outcome_as_enums,
206
214
  )
207
215
 
@@ -213,31 +221,31 @@ class SeerAgentMarket(AgentMarket):
213
221
  created_after: t.Optional[DatetimeUTC] = None,
214
222
  excluded_questions: set[str] | None = None,
215
223
  ) -> t.Sequence["SeerAgentMarket"]:
224
+ seer_subgraph = SeerSubgraphHandler()
225
+ markets = seer_subgraph.get_binary_markets(
226
+ limit=limit, sort_by=sort_by, filter_by=filter_by
227
+ )
228
+
229
+ # We exclude the None values below because `from_data_model_with_subgraph` can return None, which
230
+ # represents an invalid market.
216
231
  return [
217
- SeerAgentMarket.from_data_model(m)
218
- for m in SeerSubgraphHandler().get_binary_markets(
219
- limit=limit,
220
- sort_by=sort_by,
221
- filter_by=filter_by,
232
+ market
233
+ for m in markets
234
+ if (
235
+ market := SeerAgentMarket.from_data_model_with_subgraph(
236
+ model=m, seer_subgraph=seer_subgraph
237
+ )
222
238
  )
239
+ is not None
223
240
  ]
224
241
 
225
242
  def has_liquidity_for_outcome(self, outcome: bool) -> bool:
226
243
  outcome_token = self.get_wrapped_token_for_outcome(outcome)
227
- try:
228
- CowManager().get_quote(
229
- collateral_token=self.collateral_token_contract_address_checksummed,
230
- buy_token=outcome_token,
231
- sell_amount=CollateralToken(
232
- 1
233
- ).as_wei, # we take 1 as a baseline value for common trades the agents take.
234
- )
235
- return True
236
- except NoLiquidityAvailableOnCowException:
237
- logger.info(
238
- f"Could not get a quote for {outcome_token=} {outcome=}, returning no liquidity"
239
- )
240
- return False
244
+ pool = SeerSubgraphHandler().get_pool_by_token(
245
+ token_address=outcome_token,
246
+ collateral_address=self.collateral_token_contract_address_checksummed,
247
+ )
248
+ return pool is not None and pool.liquidity > 0
241
249
 
242
250
  def has_liquidity(self) -> bool:
243
251
  # We conservatively define a market as having liquidity if it has liquidity for the `True` outcome token AND the `False` outcome token.
@@ -281,14 +289,54 @@ class SeerAgentMarket(AgentMarket):
281
289
  )
282
290
 
283
291
  outcome_token = self.get_wrapped_token_for_outcome(outcome)
284
- # Sell using token address
285
- order_metadata = CowManager().swap(
286
- amount=amount_in_token,
292
+
293
+ # Sell sDAI using token address
294
+ order_metadata = swap_tokens_waiting(
295
+ amount_wei=amount_wei,
287
296
  sell_token=collateral_contract.address,
288
297
  buy_token=outcome_token,
289
298
  api_keys=api_keys,
290
299
  web3=web3,
291
300
  )
301
+ logger.debug(
302
+ f"Purchased {outcome_token} in exchange for {collateral_contract.address}. Order details {order_metadata}"
303
+ )
304
+
305
+ return order_metadata.uid.root
306
+
307
+ def sell_tokens(
308
+ self,
309
+ outcome: bool,
310
+ amount: USD | OutcomeToken,
311
+ auto_withdraw: bool = True,
312
+ api_keys: APIKeys | None = None,
313
+ web3: Web3 | None = None,
314
+ ) -> str:
315
+ """
316
+ Sells the given number of shares for the given outcome in the given market.
317
+ """
318
+ outcome_token = self.get_wrapped_token_for_outcome(outcome)
319
+ api_keys = api_keys if api_keys is not None else APIKeys()
320
+
321
+ token_amount = (
322
+ amount.as_outcome_wei.as_wei
323
+ if isinstance(amount, OutcomeToken)
324
+ else self.get_in_token(amount).as_wei
325
+ )
326
+
327
+ order_metadata = swap_tokens_waiting(
328
+ amount_wei=token_amount,
329
+ sell_token=outcome_token,
330
+ buy_token=Web3.to_checksum_address(
331
+ self.collateral_token_contract_address_checksummed
332
+ ),
333
+ api_keys=api_keys,
334
+ web3=web3,
335
+ )
336
+
337
+ logger.debug(
338
+ f"Sold {outcome_token} in exchange for {self.collateral_token_contract_address_checksummed}. Order details {order_metadata}"
339
+ )
292
340
 
293
341
  return order_metadata.uid.root
294
342
 
@@ -302,7 +350,7 @@ def seer_create_market_tx(
302
350
  outcomes: t.Sequence[OutcomeStr],
303
351
  auto_deposit: bool,
304
352
  category: str,
305
- min_bond_xdai: xDai,
353
+ min_bond: xDai,
306
354
  web3: Web3 | None = None,
307
355
  ) -> ChecksumAddress:
308
356
  web3 = web3 or SeerMarketFactory.get_web3() # Default to Gnosis web3.
@@ -343,7 +391,7 @@ def seer_create_market_tx(
343
391
  opening_time=opening_time,
344
392
  language=language,
345
393
  category=category,
346
- min_bond=min_bond_xdai,
394
+ min_bond=min_bond,
347
395
  )
348
396
  tx_receipt = factory_contract.create_categorical_market(
349
397
  api_keys=api_keys, params=params, web3=web3
@@ -2,16 +2,16 @@ import os
2
2
  import typing as t
3
3
 
4
4
  from web3 import Web3
5
- from web3.types import TxReceipt
6
5
 
7
6
  from prediction_market_agent_tooling.config import APIKeys
8
7
  from prediction_market_agent_tooling.gtypes import (
9
8
  ABI,
10
9
  ChecksumAddress,
11
10
  OutcomeStr,
11
+ TxReceipt,
12
12
  xDai,
13
13
  )
14
- from prediction_market_agent_tooling.markets.seer.data_models import (
14
+ from prediction_market_agent_tooling.markets.seer.subgraph_data_models import (
15
15
  CreateCategoricalMarketsParams,
16
16
  )
17
17
  from prediction_market_agent_tooling.tools.contract import (
@@ -49,7 +49,7 @@ class SeerMarketFactory(ContractOnGnosisChain):
49
49
  ], # Following usual token names on Seer (YES,NO).
50
50
  min_bond=min_bond.as_xdai_wei.value,
51
51
  opening_time=int(opening_time.timestamp()),
52
- outcomes=outcomes,
52
+ outcomes=list(outcomes),
53
53
  lang=language,
54
54
  category=category,
55
55
  )