prediction-market-agent-tooling 0.58.4__tar.gz → 0.59.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 (126) hide show
  1. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/PKG-INFO +1 -1
  2. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/deploy/agent.py +13 -2
  3. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/metaculus/data_models.py +1 -1
  4. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/contract.py +1 -169
  5. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/cow/cow_order.py +6 -0
  6. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/pyproject.toml +1 -1
  7. prediction_market_agent_tooling-0.58.4/prediction_market_agent_tooling/abis/agentcommunication.abi.json +0 -224
  8. prediction_market_agent_tooling-0.58.4/prediction_market_agent_tooling/abis/simpletreasury.abi.json +0 -156
  9. prediction_market_agent_tooling-0.58.4/prediction_market_agent_tooling/tools/data_models.py +0 -23
  10. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/LICENSE +0 -0
  11. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/README.md +0 -0
  12. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/debuggingcontract.abi.json +0 -0
  13. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/depositablewrapper_erc20.abi.json +0 -0
  14. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/erc20.abi.json +0 -0
  15. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/erc4626.abi.json +0 -0
  16. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/erc721.abi.json +0 -0
  17. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/omen_agentresultmapping.abi.json +0 -0
  18. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/omen_dxdao.abi.json +0 -0
  19. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/omen_fpmm.abi.json +0 -0
  20. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/omen_fpmm_conditionaltokens.abi.json +0 -0
  21. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/omen_fpmm_factory.abi.json +0 -0
  22. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/omen_kleros.abi.json +0 -0
  23. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/omen_oracle.abi.json +0 -0
  24. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/omen_realitio.abi.json +0 -0
  25. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/omen_thumbnailmapping.abi.json +0 -0
  26. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/ownable.abi.json +0 -0
  27. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/ownable_erc721.abi.json +0 -0
  28. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/proxy.abi.json +0 -0
  29. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/abis/seer_market_factory.abi.json +0 -0
  30. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/benchmark/__init__.py +0 -0
  31. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/benchmark/agents.py +0 -0
  32. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/benchmark/benchmark.py +0 -0
  33. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/benchmark/utils.py +0 -0
  34. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/config.py +0 -0
  35. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/deploy/agent_example.py +0 -0
  36. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/deploy/betting_strategy.py +0 -0
  37. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/deploy/constants.py +0 -0
  38. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/deploy/gcp/deploy.py +0 -0
  39. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/deploy/gcp/kubernetes_models.py +0 -0
  40. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/deploy/gcp/utils.py +0 -0
  41. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/deploy/trade_interval.py +0 -0
  42. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/gtypes.py +0 -0
  43. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/jobs/__init__.py +0 -0
  44. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/jobs/jobs_models.py +0 -0
  45. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/jobs/omen/omen_jobs.py +0 -0
  46. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/loggers.py +0 -0
  47. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/agent_market.py +0 -0
  48. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/base_subgraph_handler.py +0 -0
  49. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/blockchain_utils.py +0 -0
  50. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/categorize.py +0 -0
  51. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/data_models.py +0 -0
  52. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/manifold/__init__.py +0 -0
  53. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/manifold/api.py +0 -0
  54. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/manifold/data_models.py +0 -0
  55. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/manifold/manifold.py +0 -0
  56. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/manifold/utils.py +0 -0
  57. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/market_fees.py +0 -0
  58. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/markets.py +0 -0
  59. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/metaculus/api.py +0 -0
  60. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/metaculus/metaculus.py +0 -0
  61. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/omen/__init__.py +0 -0
  62. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/omen/data_models.py +0 -0
  63. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/omen/omen.py +0 -0
  64. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/omen/omen_constants.py +0 -0
  65. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/omen/omen_contracts.py +0 -0
  66. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/omen/omen_resolving.py +0 -0
  67. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py +0 -0
  68. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/polymarket/api.py +0 -0
  69. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/polymarket/data_models.py +0 -0
  70. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/polymarket/data_models_web.py +0 -0
  71. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/polymarket/polymarket.py +0 -0
  72. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/polymarket/utils.py +0 -0
  73. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/seer/data_models.py +0 -0
  74. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/seer/seer.py +0 -0
  75. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/seer/seer_contracts.py +0 -0
  76. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py +0 -0
  77. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/monitor/financial_metrics/financial_metrics.py +0 -0
  78. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/monitor/markets/manifold.py +0 -0
  79. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/monitor/markets/metaculus.py +0 -0
  80. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/monitor/markets/omen.py +0 -0
  81. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/monitor/markets/polymarket.py +0 -0
  82. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/monitor/monitor.py +0 -0
  83. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/monitor/monitor_app.py +0 -0
  84. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/monitor/monitor_settings.py +0 -0
  85. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/py.typed +0 -0
  86. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/balances.py +0 -0
  87. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py +0 -0
  88. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/betting_strategies/market_moving.py +0 -0
  89. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py +0 -0
  90. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py +0 -0
  91. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/betting_strategies/utils.py +0 -0
  92. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/caches/db_cache.py +0 -0
  93. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/caches/inmemory_cache.py +0 -0
  94. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/caches/serializers.py +0 -0
  95. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/costs.py +0 -0
  96. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/cow/cow_manager.py +0 -0
  97. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/custom_exceptions.py +0 -0
  98. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/datetime_utc.py +0 -0
  99. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/db/db_manager.py +0 -0
  100. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/google_utils.py +0 -0
  101. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/hexbytes_custom.py +0 -0
  102. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/httpx_cached_client.py +0 -0
  103. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/image_gen/image_gen.py +0 -0
  104. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/image_gen/market_thumbnail_gen.py +0 -0
  105. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/ipfs/ipfs_handler.py +0 -0
  106. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/is_invalid.py +0 -0
  107. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/is_predictable.py +0 -0
  108. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/langfuse_.py +0 -0
  109. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/langfuse_client_utils.py +0 -0
  110. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/omen/reality_accuracy.py +0 -0
  111. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/omen/sell_positions.py +0 -0
  112. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/parallelism.py +0 -0
  113. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/relevant_news_analysis/data_models.py +0 -0
  114. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_analysis.py +0 -0
  115. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_cache.py +0 -0
  116. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/safe.py +0 -0
  117. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/singleton.py +0 -0
  118. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/streamlit_user_login.py +0 -0
  119. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/tavily/tavily_models.py +0 -0
  120. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/tavily/tavily_search.py +0 -0
  121. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/tokens/auto_deposit.py +0 -0
  122. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/tokens/auto_withdraw.py +0 -0
  123. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/tokens/main_token.py +0 -0
  124. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/transaction_cache.py +0 -0
  125. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.0}/prediction_market_agent_tooling/tools/utils.py +0 -0
  126. {prediction_market_agent_tooling-0.58.4 → prediction_market_agent_tooling-0.59.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.58.4
3
+ Version: 0.59.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
@@ -361,17 +361,23 @@ class DeployablePredictionAgent(DeployableAgent):
361
361
  if self.have_bet_on_market_since(
362
362
  market, since=self.same_market_trade_interval.get(market=market)
363
363
  ):
364
+ logger.info(
365
+ f"Market already bet on within {self.same_market_trade_interval}."
366
+ )
364
367
  return False
365
368
 
366
369
  # Manifold allows to bet only on markets with probability between 1 and 99.
367
370
  if market_type == MarketType.MANIFOLD and not (1 < market.current_p_yes < 99):
371
+ logger.info("Manifold's market probability not in the range 1-99.")
368
372
  return False
369
373
 
370
374
  # Do as a last check, as it uses paid OpenAI API.
371
375
  if not is_predictable_binary(market.question):
376
+ logger.info("Market question is not predictable.")
372
377
  return False
373
378
 
374
379
  if not self.allow_invalid_questions and is_invalid(market.question):
380
+ logger.info("Market question is invalid.")
375
381
  return False
376
382
 
377
383
  return True
@@ -481,7 +487,10 @@ class DeployablePredictionAgent(DeployableAgent):
481
487
  )
482
488
  processed = 0
483
489
 
484
- for market in available_markets:
490
+ for market_idx, market in enumerate(available_markets):
491
+ logger.info(
492
+ f"Going to process market {market_idx+1} / {len(available_markets)}."
493
+ )
485
494
  self.before_process_market(market_type, market)
486
495
  processed_market = self.process_market(market_type, market)
487
496
  self.after_process_market(market_type, market, processed_market)
@@ -492,7 +501,9 @@ class DeployablePredictionAgent(DeployableAgent):
492
501
  if processed == self.bet_on_n_markets_per_run:
493
502
  break
494
503
 
495
- logger.info("All markets processed.")
504
+ logger.info(
505
+ f"All markets processed. Successfully processed {processed}/{len(available_markets)}."
506
+ )
496
507
 
497
508
  def after_process_markets(self, market_type: MarketType) -> None:
498
509
  """
@@ -20,7 +20,7 @@ class AggregationItem(BaseModel):
20
20
  centers: list[float] | None
21
21
  interval_upper_bounds: list[float] | None
22
22
  means: list[float] | None
23
- histogram: list[float] | None
23
+ histogram: list[list[float]] | None
24
24
 
25
25
 
26
26
  class Aggregation(BaseModel):
@@ -18,16 +18,12 @@ from prediction_market_agent_tooling.gtypes import (
18
18
  TxParams,
19
19
  TxReceipt,
20
20
  Wei,
21
- xDai,
22
21
  )
23
- from prediction_market_agent_tooling.tools.data_models import MessageContainer
24
- from prediction_market_agent_tooling.tools.hexbytes_custom import HexBytes
25
- from prediction_market_agent_tooling.tools.utils import BPS_CONSTANT, DatetimeUTC
22
+ from prediction_market_agent_tooling.tools.utils import DatetimeUTC
26
23
  from prediction_market_agent_tooling.tools.web3_utils import (
27
24
  call_function_on_contract,
28
25
  send_function_on_contract_tx,
29
26
  send_function_on_contract_tx_using_safe,
30
- wei_to_xdai,
31
27
  )
32
28
 
33
29
 
@@ -568,170 +564,6 @@ class DebuggingContract(ContractOnGnosisChain):
568
564
  )
569
565
 
570
566
 
571
- class SimpleTreasuryContract(ContractOnGnosisChain, OwnableContract):
572
- # Contract ABI taken from built https://github.com/gnosis/labs-contracts.
573
- abi: ABI = abi_field_validator(
574
- os.path.join(
575
- os.path.dirname(os.path.realpath(__file__)),
576
- "../abis/simpletreasury.abi.json",
577
- )
578
- )
579
-
580
- address: ChecksumAddress = Web3.to_checksum_address(
581
- "0x624ad0db52e6b18afb4d36b8e79d0c2a74f3fc8a"
582
- )
583
-
584
- def required_nft_balance(self, web3: Web3 | None = None) -> int:
585
- min_num_of_nfts: int = self.call("requiredNFTBalance", web3=web3)
586
- return min_num_of_nfts
587
-
588
- def set_required_nft_balance(
589
- self,
590
- api_keys: APIKeys,
591
- new_required_balance: int,
592
- web3: Web3 | None = None,
593
- ) -> TxReceipt:
594
- return self.send(
595
- api_keys=api_keys,
596
- function_name="setRequiredNFTBalance",
597
- function_params=[new_required_balance],
598
- web3=web3,
599
- )
600
-
601
- def nft_contract(self, web3: Web3 | None = None) -> ContractERC721BaseClass:
602
- nft_contract_address: ChecksumAddress = self.call("nftContract", web3=web3)
603
- contract = ContractERC721BaseClass(address=nft_contract_address)
604
- return contract
605
-
606
- def withdraw(
607
- self,
608
- api_keys: APIKeys,
609
- web3: Web3 | None = None,
610
- ) -> TxReceipt:
611
- return self.send(
612
- api_keys=api_keys,
613
- function_name="withdraw",
614
- web3=web3,
615
- )
616
-
617
-
618
- class AgentCommunicationContract(ContractOnGnosisChain, OwnableContract):
619
- # Contract ABI taken from built https://github.com/gnosis/labs-contracts.
620
- abi: ABI = abi_field_validator(
621
- os.path.join(
622
- os.path.dirname(os.path.realpath(__file__)),
623
- "../abis/agentcommunication.abi.json",
624
- )
625
- )
626
-
627
- address: ChecksumAddress = Web3.to_checksum_address(
628
- "0xe9dd78FF297DbaAbe5D0E45aE554a4B561935DE9"
629
- )
630
-
631
- def minimum_message_value(self, web3: Web3 | None = None) -> xDai:
632
- value: Wei = self.call("minimumValueForSendingMessageInWei", web3=web3)
633
- return wei_to_xdai(value)
634
-
635
- def ratio_given_to_treasury(self, web3: Web3 | None = None) -> float:
636
- bps: int = self.call("pctToTreasuryInBasisPoints", web3=web3)
637
- return bps / BPS_CONSTANT
638
-
639
- def count_unseen_messages(
640
- self,
641
- agent_address: ChecksumAddress,
642
- web3: Web3 | None = None,
643
- ) -> int:
644
- unseen_message_count: int = self.call(
645
- "countMessages", function_params=[agent_address], web3=web3
646
- )
647
- return unseen_message_count
648
-
649
- def get_at_index(
650
- self,
651
- agent_address: ChecksumAddress,
652
- idx: int,
653
- web3: Web3 | None = None,
654
- ) -> MessageContainer:
655
- message_container_raw: t.Tuple[t.Any] = self.call(
656
- "getAtIndex", function_params=[agent_address, idx], web3=web3
657
- )
658
- return MessageContainer.from_tuple(message_container_raw)
659
-
660
- def set_treasury_address(
661
- self,
662
- api_keys: APIKeys,
663
- new_treasury_address: ChecksumAddress,
664
- web3: Web3 | None = None,
665
- ) -> TxReceipt:
666
- return self.send(
667
- api_keys=api_keys,
668
- function_name="setTreasuryAddress",
669
- function_params=[new_treasury_address],
670
- web3=web3,
671
- )
672
-
673
- def set_minimum_value_for_sending_message(
674
- self,
675
- api_keys: APIKeys,
676
- new_minimum_value: Wei,
677
- web3: Web3 | None = None,
678
- ) -> TxReceipt:
679
- return self.send(
680
- api_keys=api_keys,
681
- function_name="adjustMinimumValueForSendingMessage",
682
- function_params=[new_minimum_value],
683
- web3=web3,
684
- )
685
-
686
- def pop_message(
687
- self,
688
- api_keys: APIKeys,
689
- agent_address: ChecksumAddress,
690
- index: int = 0,
691
- web3: Web3 | None = None,
692
- ) -> MessageContainer:
693
- """
694
- Retrieves and removes message at specified index from the agent's message queue.
695
-
696
- This method first retrieves the message at the front of the queue without removing it,
697
- allowing us to return the message content directly. The actual removal of the message
698
- from the queue is performed by sending a transaction to the contract, which executes
699
- the `popMessageAtIndex` function. The transaction receipt is not used to obtain the message
700
- content, as it only contains event data, not the returned struct.
701
- """
702
-
703
- # Peek the element before popping.
704
- message_container = self.get_at_index(
705
- agent_address=agent_address, idx=index, web3=web3
706
- )
707
-
708
- # Next, pop that element and discard the transaction receipt.
709
- self.send(
710
- api_keys=api_keys,
711
- function_name="popMessageAtIndex",
712
- function_params=[agent_address, index],
713
- web3=web3,
714
- )
715
-
716
- return message_container
717
-
718
- def send_message(
719
- self,
720
- api_keys: APIKeys,
721
- agent_address: ChecksumAddress,
722
- message: HexBytes,
723
- amount_wei: Wei,
724
- web3: Web3 | None = None,
725
- ) -> TxReceipt:
726
- return self.send_with_value(
727
- api_keys=api_keys,
728
- function_name="sendMessage",
729
- amount_wei=amount_wei,
730
- function_params=[agent_address, message],
731
- web3=web3,
732
- )
733
-
734
-
735
567
  def contract_implements_function(
736
568
  contract_address: ChecksumAddress,
737
569
  function_name: str,
@@ -2,6 +2,7 @@ import asyncio
2
2
  from datetime import timedelta
3
3
 
4
4
  import httpx
5
+ import tenacity
5
6
  from cowdao_cowpy import swap_tokens
6
7
  from cowdao_cowpy.common.chains import Chain
7
8
  from cowdao_cowpy.common.config import SupportedChainId
@@ -34,6 +35,11 @@ def get_order_book_api(env: Envs, chain: Chain) -> OrderBookApi:
34
35
  return OrderBookApi(OrderBookAPIConfigFactory.get_config(env, chain_id))
35
36
 
36
37
 
38
+ @tenacity.retry(
39
+ stop=tenacity.stop_after_attempt(3),
40
+ wait=tenacity.wait_fixed(1),
41
+ after=lambda x: logger.debug(f"get_buy_token_amount failed, {x.attempt_number=}."),
42
+ )
37
43
  def get_buy_token_amount(
38
44
  amount_wei: Wei,
39
45
  sell_token: ChecksumAddress,
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "prediction-market-agent-tooling"
3
- version = "0.58.4"
3
+ version = "0.59.0"
4
4
  description = "Tools to benchmark, deploy and monitor prediction market agents."
5
5
  authors = ["Gnosis"]
6
6
  readme = "README.md"
@@ -1,224 +0,0 @@
1
- [
2
- {
3
- "inputs": [
4
- {
5
- "internalType": "address payable",
6
- "name": "_treasury",
7
- "type": "address"
8
- },
9
- {
10
- "internalType": "uint256",
11
- "name": "_pctToTreasuryInBasisPoints",
12
- "type": "uint256"
13
- }
14
- ],
15
- "stateMutability": "nonpayable",
16
- "type": "constructor"
17
- },
18
- { "inputs": [], "name": "MessageNotSentByAgent", "type": "error" },
19
- {
20
- "inputs": [
21
- { "internalType": "address", "name": "owner", "type": "address" }
22
- ],
23
- "name": "OwnableInvalidOwner",
24
- "type": "error"
25
- },
26
- {
27
- "inputs": [
28
- { "internalType": "address", "name": "account", "type": "address" }
29
- ],
30
- "name": "OwnableUnauthorizedAccount",
31
- "type": "error"
32
- },
33
- {
34
- "anonymous": false,
35
- "inputs": [
36
- {
37
- "indexed": true,
38
- "internalType": "address",
39
- "name": "sender",
40
- "type": "address"
41
- },
42
- {
43
- "indexed": true,
44
- "internalType": "address",
45
- "name": "agentAddress",
46
- "type": "address"
47
- },
48
- {
49
- "indexed": false,
50
- "internalType": "bytes",
51
- "name": "message",
52
- "type": "bytes"
53
- },
54
- {
55
- "indexed": false,
56
- "internalType": "uint256",
57
- "name": "value",
58
- "type": "uint256"
59
- }
60
- ],
61
- "name": "LogMessage",
62
- "type": "event"
63
- },
64
- {
65
- "anonymous": false,
66
- "inputs": [
67
- {
68
- "indexed": true,
69
- "internalType": "address",
70
- "name": "previousOwner",
71
- "type": "address"
72
- },
73
- {
74
- "indexed": true,
75
- "internalType": "address",
76
- "name": "newOwner",
77
- "type": "address"
78
- }
79
- ],
80
- "name": "OwnershipTransferred",
81
- "type": "event"
82
- },
83
- {
84
- "inputs": [
85
- { "internalType": "uint256", "name": "newValue", "type": "uint256" }
86
- ],
87
- "name": "adjustMinimumValueForSendingMessage",
88
- "outputs": [],
89
- "stateMutability": "nonpayable",
90
- "type": "function"
91
- },
92
- {
93
- "inputs": [
94
- { "internalType": "address", "name": "agentAddress", "type": "address" }
95
- ],
96
- "name": "countMessages",
97
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
98
- "stateMutability": "view",
99
- "type": "function"
100
- },
101
- {
102
- "inputs": [
103
- { "internalType": "address", "name": "agentAddress", "type": "address" },
104
- { "internalType": "uint256", "name": "idx", "type": "uint256" }
105
- ],
106
- "name": "getAtIndex",
107
- "outputs": [
108
- {
109
- "components": [
110
- { "internalType": "address", "name": "sender", "type": "address" },
111
- { "internalType": "address", "name": "recipient", "type": "address" },
112
- { "internalType": "bytes", "name": "message", "type": "bytes" },
113
- { "internalType": "uint256", "name": "value", "type": "uint256" }
114
- ],
115
- "internalType": "struct DoubleEndedStructQueue.MessageContainer",
116
- "name": "",
117
- "type": "tuple"
118
- }
119
- ],
120
- "stateMutability": "view",
121
- "type": "function"
122
- },
123
- {
124
- "inputs": [],
125
- "name": "minimumValueForSendingMessageInWei",
126
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
127
- "stateMutability": "view",
128
- "type": "function"
129
- },
130
- {
131
- "inputs": [],
132
- "name": "owner",
133
- "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
134
- "stateMutability": "view",
135
- "type": "function"
136
- },
137
- {
138
- "inputs": [],
139
- "name": "pctToTreasuryInBasisPoints",
140
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
141
- "stateMutability": "view",
142
- "type": "function"
143
- },
144
- {
145
- "inputs": [
146
- { "internalType": "address", "name": "agentAddress", "type": "address" },
147
- { "internalType": "uint256", "name": "idx", "type": "uint256" }
148
- ],
149
- "name": "popMessageAtIndex",
150
- "outputs": [
151
- {
152
- "components": [
153
- { "internalType": "address", "name": "sender", "type": "address" },
154
- { "internalType": "address", "name": "recipient", "type": "address" },
155
- { "internalType": "bytes", "name": "message", "type": "bytes" },
156
- { "internalType": "uint256", "name": "value", "type": "uint256" }
157
- ],
158
- "internalType": "struct DoubleEndedStructQueue.MessageContainer",
159
- "name": "",
160
- "type": "tuple"
161
- }
162
- ],
163
- "stateMutability": "nonpayable",
164
- "type": "function"
165
- },
166
- {
167
- "inputs": [{ "internalType": "address", "name": "", "type": "address" }],
168
- "name": "queues",
169
- "outputs": [
170
- { "internalType": "uint128", "name": "_begin", "type": "uint128" },
171
- { "internalType": "uint128", "name": "_end", "type": "uint128" }
172
- ],
173
- "stateMutability": "view",
174
- "type": "function"
175
- },
176
- {
177
- "inputs": [],
178
- "name": "renounceOwnership",
179
- "outputs": [],
180
- "stateMutability": "nonpayable",
181
- "type": "function"
182
- },
183
- {
184
- "inputs": [
185
- { "internalType": "address", "name": "agentAddress", "type": "address" },
186
- { "internalType": "bytes", "name": "message", "type": "bytes" }
187
- ],
188
- "name": "sendMessage",
189
- "outputs": [],
190
- "stateMutability": "payable",
191
- "type": "function"
192
- },
193
- {
194
- "inputs": [
195
- {
196
- "internalType": "address payable",
197
- "name": "_treasury",
198
- "type": "address"
199
- }
200
- ],
201
- "name": "setTreasuryAddress",
202
- "outputs": [],
203
- "stateMutability": "nonpayable",
204
- "type": "function"
205
- },
206
- {
207
- "inputs": [
208
- { "internalType": "address", "name": "newOwner", "type": "address" }
209
- ],
210
- "name": "transferOwnership",
211
- "outputs": [],
212
- "stateMutability": "nonpayable",
213
- "type": "function"
214
- },
215
- {
216
- "inputs": [],
217
- "name": "treasury",
218
- "outputs": [
219
- { "internalType": "address payable", "name": "", "type": "address" }
220
- ],
221
- "stateMutability": "view",
222
- "type": "function"
223
- }
224
- ]
@@ -1,156 +0,0 @@
1
- [
2
- {
3
- "inputs": [
4
- {
5
- "internalType": "address",
6
- "name": "_nftContract",
7
- "type": "address"
8
- }
9
- ],
10
- "stateMutability": "nonpayable",
11
- "type": "constructor"
12
- },
13
- {
14
- "inputs": [
15
- {
16
- "internalType": "address",
17
- "name": "owner",
18
- "type": "address"
19
- }
20
- ],
21
- "name": "OwnableInvalidOwner",
22
- "type": "error"
23
- },
24
- {
25
- "inputs": [
26
- {
27
- "internalType": "address",
28
- "name": "account",
29
- "type": "address"
30
- }
31
- ],
32
- "name": "OwnableUnauthorizedAccount",
33
- "type": "error"
34
- },
35
- {
36
- "anonymous": false,
37
- "inputs": [
38
- {
39
- "indexed": true,
40
- "internalType": "address",
41
- "name": "previousOwner",
42
- "type": "address"
43
- },
44
- {
45
- "indexed": true,
46
- "internalType": "address",
47
- "name": "newOwner",
48
- "type": "address"
49
- }
50
- ],
51
- "name": "OwnershipTransferred",
52
- "type": "event"
53
- },
54
- {
55
- "anonymous": false,
56
- "inputs": [
57
- {
58
- "indexed": true,
59
- "internalType": "address",
60
- "name": "holder",
61
- "type": "address"
62
- },
63
- {
64
- "indexed": false,
65
- "internalType": "uint256",
66
- "name": "amount",
67
- "type": "uint256"
68
- }
69
- ],
70
- "name": "WithdrawnByNFTHolder",
71
- "type": "event"
72
- },
73
- {
74
- "inputs": [],
75
- "name": "nftContract",
76
- "outputs": [
77
- {
78
- "internalType": "contract IERC721",
79
- "name": "",
80
- "type": "address"
81
- }
82
- ],
83
- "stateMutability": "view",
84
- "type": "function"
85
- },
86
- {
87
- "inputs": [],
88
- "name": "owner",
89
- "outputs": [
90
- {
91
- "internalType": "address",
92
- "name": "",
93
- "type": "address"
94
- }
95
- ],
96
- "stateMutability": "view",
97
- "type": "function"
98
- },
99
- {
100
- "inputs": [],
101
- "name": "renounceOwnership",
102
- "outputs": [],
103
- "stateMutability": "nonpayable",
104
- "type": "function"
105
- },
106
- {
107
- "inputs": [],
108
- "name": "requiredNFTBalance",
109
- "outputs": [
110
- {
111
- "internalType": "uint256",
112
- "name": "",
113
- "type": "uint256"
114
- }
115
- ],
116
- "stateMutability": "view",
117
- "type": "function"
118
- },
119
- {
120
- "inputs": [
121
- {
122
- "internalType": "uint256",
123
- "name": "_newBalance",
124
- "type": "uint256"
125
- }
126
- ],
127
- "name": "setRequiredNFTBalance",
128
- "outputs": [],
129
- "stateMutability": "nonpayable",
130
- "type": "function"
131
- },
132
- {
133
- "inputs": [
134
- {
135
- "internalType": "address",
136
- "name": "newOwner",
137
- "type": "address"
138
- }
139
- ],
140
- "name": "transferOwnership",
141
- "outputs": [],
142
- "stateMutability": "nonpayable",
143
- "type": "function"
144
- },
145
- {
146
- "inputs": [],
147
- "name": "withdraw",
148
- "outputs": [],
149
- "stateMutability": "nonpayable",
150
- "type": "function"
151
- },
152
- {
153
- "stateMutability": "payable",
154
- "type": "receive"
155
- }
156
- ]
@@ -1,23 +0,0 @@
1
- import typing as t
2
-
3
- from pydantic import BaseModel, ConfigDict, Field
4
-
5
- from prediction_market_agent_tooling.gtypes import ChecksumAddress, HexBytes, Wei
6
-
7
-
8
- # Taken from https://github.com/gnosis/labs-contracts/blob/main/src/NFT/DoubleEndedStructQueue.sol
9
- class MessageContainer(BaseModel):
10
- model_config = ConfigDict(populate_by_name=True)
11
- sender: ChecksumAddress
12
- recipient: ChecksumAddress = Field(alias="agentAddress")
13
- message: HexBytes
14
- value: Wei
15
-
16
- @staticmethod
17
- def from_tuple(values: tuple[t.Any, ...]) -> "MessageContainer":
18
- return MessageContainer(
19
- sender=values[0],
20
- recipient=values[1],
21
- message=HexBytes(values[2]),
22
- value=values[3],
23
- )