prediction-market-agent-tooling 0.63.0.dev498__tar.gz → 0.63.0.dev500__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 (127) hide show
  1. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/PKG-INFO +1 -1
  2. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/deploy/betting_strategy.py +4 -3
  3. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/seer/data_models.py +1 -4
  4. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/seer/price_manager.py +12 -9
  5. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/seer/seer.py +16 -15
  6. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/seer/seer_contracts.py +3 -3
  7. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py +1 -2
  8. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/seer/subgraph_data_models.py +2 -2
  9. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/cow/cow_order.py +45 -6
  10. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/tokens/token_utils.py +4 -3
  11. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/tokens/usd.py +7 -6
  12. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/pyproject.toml +1 -1
  13. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/LICENSE +0 -0
  14. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/README.md +0 -0
  15. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/debuggingcontract.abi.json +0 -0
  16. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/depositablewrapper_erc20.abi.json +0 -0
  17. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/erc20.abi.json +0 -0
  18. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/erc4626.abi.json +0 -0
  19. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/erc721.abi.json +0 -0
  20. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/omen_agentresultmapping.abi.json +0 -0
  21. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/omen_dxdao.abi.json +0 -0
  22. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/omen_fpmm.abi.json +0 -0
  23. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/omen_fpmm_conditionaltokens.abi.json +0 -0
  24. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/omen_fpmm_factory.abi.json +0 -0
  25. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/omen_kleros.abi.json +0 -0
  26. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/omen_oracle.abi.json +0 -0
  27. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/omen_realitio.abi.json +0 -0
  28. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/omen_thumbnailmapping.abi.json +0 -0
  29. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/ownable.abi.json +0 -0
  30. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/ownable_erc721.abi.json +0 -0
  31. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/proxy.abi.json +0 -0
  32. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/abis/seer_market_factory.abi.json +0 -0
  33. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/benchmark/__init__.py +0 -0
  34. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/benchmark/agents.py +0 -0
  35. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/benchmark/benchmark.py +0 -0
  36. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/benchmark/utils.py +0 -0
  37. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/config.py +0 -0
  38. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/deploy/agent.py +0 -0
  39. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/deploy/agent_example.py +0 -0
  40. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/deploy/constants.py +0 -0
  41. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/deploy/gcp/deploy.py +0 -0
  42. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/deploy/gcp/kubernetes_models.py +0 -0
  43. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/deploy/gcp/utils.py +0 -0
  44. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/deploy/trade_interval.py +0 -0
  45. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/gtypes.py +0 -0
  46. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/jobs/__init__.py +0 -0
  47. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/jobs/jobs_models.py +0 -0
  48. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/jobs/omen/omen_jobs.py +0 -0
  49. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/loggers.py +0 -0
  50. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/agent_market.py +0 -0
  51. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/base_subgraph_handler.py +0 -0
  52. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/blockchain_utils.py +0 -0
  53. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/categorize.py +0 -0
  54. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/data_models.py +0 -0
  55. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/manifold/__init__.py +0 -0
  56. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/manifold/api.py +0 -0
  57. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/manifold/data_models.py +0 -0
  58. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/manifold/manifold.py +0 -0
  59. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/manifold/utils.py +0 -0
  60. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/market_fees.py +0 -0
  61. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/markets.py +0 -0
  62. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/metaculus/api.py +0 -0
  63. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/metaculus/data_models.py +0 -0
  64. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/metaculus/metaculus.py +0 -0
  65. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/omen/__init__.py +0 -0
  66. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/omen/data_models.py +0 -0
  67. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/omen/omen.py +0 -0
  68. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/omen/omen_constants.py +0 -0
  69. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/omen/omen_contracts.py +0 -0
  70. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/omen/omen_resolving.py +0 -0
  71. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py +0 -0
  72. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/polymarket/api.py +0 -0
  73. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/polymarket/data_models.py +0 -0
  74. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/polymarket/data_models_web.py +0 -0
  75. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/polymarket/polymarket.py +0 -0
  76. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/markets/polymarket/utils.py +0 -0
  77. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/monitor/financial_metrics/financial_metrics.py +0 -0
  78. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/monitor/markets/manifold.py +0 -0
  79. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/monitor/markets/metaculus.py +0 -0
  80. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/monitor/markets/omen.py +0 -0
  81. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/monitor/markets/polymarket.py +0 -0
  82. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/monitor/monitor.py +0 -0
  83. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/monitor/monitor_app.py +0 -0
  84. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/monitor/monitor_settings.py +0 -0
  85. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/py.typed +0 -0
  86. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/_generic_value.py +0 -0
  87. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/balances.py +0 -0
  88. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py +0 -0
  89. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/betting_strategies/market_moving.py +0 -0
  90. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py +0 -0
  91. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py +0 -0
  92. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/betting_strategies/utils.py +0 -0
  93. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/caches/db_cache.py +0 -0
  94. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/caches/inmemory_cache.py +0 -0
  95. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/caches/serializers.py +0 -0
  96. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/contract.py +0 -0
  97. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/costs.py +0 -0
  98. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/custom_exceptions.py +0 -0
  99. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/datetime_utc.py +0 -0
  100. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/db/db_manager.py +0 -0
  101. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/google_utils.py +0 -0
  102. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/hexbytes_custom.py +0 -0
  103. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/httpx_cached_client.py +0 -0
  104. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/image_gen/image_gen.py +0 -0
  105. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/image_gen/market_thumbnail_gen.py +0 -0
  106. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/ipfs/ipfs_handler.py +0 -0
  107. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/is_invalid.py +0 -0
  108. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/is_predictable.py +0 -0
  109. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/langfuse_.py +0 -0
  110. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/langfuse_client_utils.py +0 -0
  111. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/omen/reality_accuracy.py +0 -0
  112. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/omen/sell_positions.py +0 -0
  113. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/parallelism.py +0 -0
  114. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/relevant_news_analysis/data_models.py +0 -0
  115. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_analysis.py +0 -0
  116. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_cache.py +0 -0
  117. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/safe.py +0 -0
  118. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/singleton.py +0 -0
  119. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/streamlit_user_login.py +0 -0
  120. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/tavily/tavily_models.py +0 -0
  121. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/tavily/tavily_search.py +0 -0
  122. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/tokens/auto_deposit.py +0 -0
  123. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/tokens/auto_withdraw.py +0 -0
  124. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/tokens/main_token.py +0 -0
  125. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/transaction_cache.py +0 -0
  126. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/prediction_market_agent_tooling/tools/utils.py +0 -0
  127. {prediction_market_agent_tooling-0.63.0.dev498 → prediction_market_agent_tooling-0.63.0.dev500}/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.63.0.dev498
3
+ Version: 0.63.0.dev500
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.13
@@ -54,9 +54,6 @@ class BettingStrategy(ABC):
54
54
  outcome_tokens_to_get = market.get_buy_token_amount(
55
55
  trade.amount, trade.outcome
56
56
  )
57
- outcome_tokens_to_get_in_usd = market.get_token_in_usd(
58
- outcome_tokens_to_get.as_token
59
- )
60
57
 
61
58
  if not outcome_tokens_to_get:
62
59
  logger.info(
@@ -64,6 +61,10 @@ class BettingStrategy(ABC):
64
61
  )
65
62
  continue
66
63
 
64
+ outcome_tokens_to_get_in_usd = market.get_token_in_usd(
65
+ outcome_tokens_to_get.as_token
66
+ )
67
+
67
68
  if outcome_tokens_to_get_in_usd <= trade.amount:
68
69
  raise GuaranteedLossError(
69
70
  f"Trade {trade=} would result in guaranteed loss by getting only {outcome_tokens_to_get=}. Halting execution."
@@ -5,19 +5,16 @@ from urllib.parse import urljoin
5
5
 
6
6
  from pydantic import BaseModel, ConfigDict, Field
7
7
  from web3 import Web3
8
+ from web3.constants import ADDRESS_ZERO
8
9
 
9
10
  from prediction_market_agent_tooling.config import RPCConfig
10
- from prediction_market_agent_tooling.gtypes import ChecksumAddress, HexAddress, HexBytes
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
19
  from prediction_market_agent_tooling.markets.seer.subgraph_data_models import (
23
20
  SeerParentMarket,
@@ -1,11 +1,9 @@
1
- from functools import lru_cache
2
-
3
1
  from web3 import Web3
4
2
 
5
3
  from prediction_market_agent_tooling.gtypes import (
6
4
  ChecksumAddress,
5
+ CollateralToken,
7
6
  Probability,
8
- xdai_type,
9
7
  Wei,
10
8
  )
11
9
  from prediction_market_agent_tooling.loggers import logger
@@ -19,7 +17,7 @@ from prediction_market_agent_tooling.markets.seer.seer_subgraph_handler import (
19
17
  from prediction_market_agent_tooling.markets.seer.subgraph_data_models import SeerPool
20
18
  from prediction_market_agent_tooling.tools.cow.cow_order import get_quote
21
19
  from prediction_market_agent_tooling.tools.hexbytes_custom import HexBytes
22
- from prediction_market_agent_tooling.tools.web3_utils import xdai_to_wei
20
+ from prediction_market_agent_tooling.tools.utils import check_not_none
23
21
 
24
22
 
25
23
  class PriceManager:
@@ -70,12 +68,15 @@ class PriceManager:
70
68
  else:
71
69
  return None
72
70
 
73
- @lru_cache(typed=True)
74
71
  def get_price_for_token(
75
- self,
76
- token: ChecksumAddress,
77
- collateral_exchange_amount: Wei = xdai_to_wei(xdai_type(1)),
72
+ self, token: ChecksumAddress, collateral_exchange_amount: Wei | None = None
78
73
  ) -> float | None:
74
+ collateral_exchange_amount = (
75
+ collateral_exchange_amount
76
+ if collateral_exchange_amount is not None
77
+ else CollateralToken(1).as_wei
78
+ )
79
+
79
80
  try:
80
81
  quote = get_quote(
81
82
  amount_wei=collateral_exchange_amount,
@@ -89,7 +90,9 @@ class PriceManager:
89
90
  )
90
91
  return self.get_token_price_from_pools(token=token)
91
92
 
92
- return collateral_exchange_amount / float(quote.quote.buyAmount.root)
93
+ collateral_exchange_amount = check_not_none(collateral_exchange_amount)
94
+ price = collateral_exchange_amount / float(quote.quote.buyAmount.root)
95
+ return Wei(str(price)).value
93
96
 
94
97
  @staticmethod
95
98
  def _pool_token0_matches_token(token: ChecksumAddress, pool: SeerPool) -> bool:
@@ -13,7 +13,6 @@ from prediction_market_agent_tooling.gtypes import (
13
13
  HexAddress,
14
14
  HexBytes,
15
15
  OutcomeStr,
16
- Wei,
17
16
  OutcomeToken,
18
17
  OutcomeWei,
19
18
  xDai,
@@ -23,8 +22,8 @@ from prediction_market_agent_tooling.markets.agent_market import (
23
22
  AgentMarket,
24
23
  FilterBy,
25
24
  ProcessedMarket,
26
- SortBy,
27
25
  ProcessedTradedMarket,
26
+ SortBy,
28
27
  )
29
28
  from prediction_market_agent_tooling.markets.data_models import ExistingPosition
30
29
  from prediction_market_agent_tooling.markets.market_fees import MarketFees
@@ -43,7 +42,6 @@ from prediction_market_agent_tooling.markets.seer.seer_subgraph_handler import (
43
42
  from prediction_market_agent_tooling.markets.seer.subgraph_data_models import (
44
43
  NewMarketEvent,
45
44
  )
46
- from prediction_market_agent_tooling.tools.balances import get_balances
47
45
  from prediction_market_agent_tooling.tools.contract import (
48
46
  ContractERC20OnGnosisChain,
49
47
  init_collateral_token_contract,
@@ -108,25 +106,23 @@ class SeerAgentMarket(AgentMarket):
108
106
  return get_usd_in_token(x, self.collateral_token_contract_address_checksummed)
109
107
 
110
108
  def get_buy_token_amount(
111
- self, bet_amount: BetAmount, direction: bool
109
+ self, bet_amount: USD | CollateralToken, direction: bool
112
110
  ) -> OutcomeToken | None:
113
111
  """Returns number of outcome tokens returned for a given bet expressed in collateral units."""
114
112
 
115
113
  outcome_token = self.get_wrapped_token_for_outcome(direction)
116
114
  bet_amount_in_tokens = self.get_in_token(bet_amount)
117
- bet_amount_in_wei = bet_amount_in_tokens.as_wei
118
115
 
119
116
  p = PriceManager.build(market_id=HexBytes(HexStr(self.id)))
120
117
  price_in_collateral_units = p.get_price_for_token(
121
- token=outcome_token, collateral_exchange_amount=bet_amount_in_wei
118
+ token=outcome_token, collateral_exchange_amount=bet_amount_in_tokens.as_wei
122
119
  )
123
120
  if not price_in_collateral_units:
124
121
  logger.info(f"Could not get price for token {outcome_token}")
125
122
  return None
126
123
 
127
- buy_amount = bet_amount_in_wei / price_in_collateral_units
128
- sell_amount = OutcomeWei(buy_amount).as_outcome_token
129
- return sell_amount
124
+ amount_outcome_tokens = bet_amount_in_tokens.value / price_in_collateral_units
125
+ return OutcomeToken(amount_outcome_tokens)
130
126
 
131
127
  def get_outcome_str_from_bool(self, outcome: bool) -> OutcomeStr:
132
128
  outcome_translated = SeerOutcomeEnum.from_bool(outcome)
@@ -191,7 +187,7 @@ class SeerAgentMarket(AgentMarket):
191
187
  @staticmethod
192
188
  def from_data_model_with_subgraph(
193
189
  model: SeerMarket, seer_subgraph: SeerSubgraphHandler
194
- ) -> "SeerAgentMarket" | None:
190
+ ) -> t.Optional["SeerAgentMarket"]:
195
191
  p = PriceManager(seer_market=model, seer_subgraph=seer_subgraph)
196
192
  current_p_yes = p.current_p_yes()
197
193
  if not current_p_yes:
@@ -295,11 +291,10 @@ class SeerAgentMarket(AgentMarket):
295
291
  )
296
292
 
297
293
  outcome_token = self.get_wrapped_token_for_outcome(outcome)
298
- amount_to_trade = xdai_type(amount.amount)
299
294
 
300
295
  # Sell sDAI using token address
301
296
  order_metadata = swap_tokens_waiting(
302
- amount_wei=xdai_to_wei(amount_to_trade),
297
+ amount_wei=amount_wei,
303
298
  sell_token=collateral_contract.address,
304
299
  buy_token=outcome_token,
305
300
  api_keys=api_keys,
@@ -321,7 +316,7 @@ class SeerAgentMarket(AgentMarket):
321
316
  def sell_tokens(
322
317
  self,
323
318
  outcome: bool,
324
- amount: TokenAmount,
319
+ amount: USD | OutcomeToken,
325
320
  auto_withdraw: bool = True,
326
321
  api_keys: APIKeys | None = None,
327
322
  web3: Web3 | None = None,
@@ -331,10 +326,16 @@ class SeerAgentMarket(AgentMarket):
331
326
  """
332
327
  outcome_token = self.get_wrapped_token_for_outcome(outcome)
333
328
  api_keys = api_keys if api_keys is not None else APIKeys()
334
- amount_to_trade = xdai_type(amount.amount)
329
+
330
+ ########
331
+ token_amount = (
332
+ amount.as_outcome_wei.as_wei
333
+ if isinstance(amount, OutcomeToken)
334
+ else self.get_in_token(amount).as_wei
335
+ )
335
336
 
336
337
  order_metadata = swap_tokens_waiting(
337
- amount_wei=xdai_to_wei(amount_to_trade),
338
+ amount_wei=token_amount,
338
339
  sell_token=outcome_token,
339
340
  buy_token=Web3.to_checksum_address(
340
341
  self.collateral_token_contract_address_checksummed
@@ -2,13 +2,13 @@ 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
14
  from prediction_market_agent_tooling.markets.seer.subgraph_data_models import (
@@ -47,9 +47,9 @@ class SeerMarketFactory(ContractOnGnosisChain):
47
47
  token_names=[
48
48
  o.upper() for o in outcomes
49
49
  ], # Following usual token names on Seer (YES,NO).
50
- min_bond=min_bond.as_xdai_wei.value,
50
+ min_bond=min_bond.as_xdai_wei.as_wei,
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
  )
@@ -241,8 +241,7 @@ class SeerSubgraphHandler(BaseSubgraphHandler):
241
241
  optional_params["orderDirection"] = "desc"
242
242
 
243
243
  pools_field = self.swapr_algebra_subgraph.Query.pools(
244
- where=unwrap_generic_value({"or": wheres}, **optional_params
245
- )
244
+ where=unwrap_generic_value({"or": wheres}, **optional_params)
246
245
  )
247
246
  fields = self._get_fields_for_pools(pools_field)
248
247
  pools = self.do_query(fields=fields, pydantic_model=SeerPool)
@@ -1,7 +1,7 @@
1
1
  from pydantic import BaseModel, ConfigDict, Field
2
2
  from web3.constants import ADDRESS_ZERO
3
3
 
4
- from prediction_market_agent_tooling.gtypes import HexAddress, HexBytes, Wei
4
+ from prediction_market_agent_tooling.gtypes import HexAddress, HexBytes, OutcomeStr, Wei
5
5
 
6
6
 
7
7
  class SeerToken(BaseModel):
@@ -34,7 +34,7 @@ class CreateCategoricalMarketsParams(BaseModel):
34
34
  model_config = ConfigDict(populate_by_name=True)
35
35
 
36
36
  market_name: str = Field(..., alias="marketName")
37
- outcomes: list[str]
37
+ outcomes: list[OutcomeStr]
38
38
  # Only relevant for scalar markets
39
39
  question_start: str = Field(alias="questionStart", default="")
40
40
  question_end: str = Field(alias="questionEnd", default="")
@@ -15,23 +15,29 @@ from cowdao_cowpy.order_book.generated.model import (
15
15
  Address,
16
16
  OrderMetaData,
17
17
  OrderQuoteRequest,
18
+ OrderQuoteResponse,
18
19
  OrderQuoteSide1,
20
+ OrderQuoteSide3,
21
+ OrderQuoteSideKindBuy,
19
22
  OrderQuoteSideKindSell,
20
23
  OrderStatus,
21
24
  TokenAmount,
22
- OrderQuoteResponse,
23
25
  )
24
26
  from eth_account.signers.local import LocalAccount
25
- from tenacity import stop_after_attempt, wait_fixed, retry_if_not_exception_type
27
+ from tenacity import retry_if_not_exception_type, stop_after_attempt, wait_fixed
26
28
  from web3 import Web3
27
29
 
28
30
  from prediction_market_agent_tooling.config import APIKeys
29
- from prediction_market_agent_tooling.gtypes import ChecksumAddress, Wei, wei_type
31
+ from prediction_market_agent_tooling.gtypes import ChecksumAddress, Wei
30
32
  from prediction_market_agent_tooling.loggers import logger
31
33
  from prediction_market_agent_tooling.tools.contract import ContractERC20OnGnosisChain
32
34
  from prediction_market_agent_tooling.tools.utils import utcnow
33
35
 
34
36
 
37
+ class OrderStatusError(Exception):
38
+ pass
39
+
40
+
35
41
  class NoLiquidityAvailableOnCowException(Exception):
36
42
  """Custom exception for handling case where no liquidity available."""
37
43
 
@@ -41,9 +47,42 @@ def get_order_book_api(env: Envs, chain: Chain) -> OrderBookApi:
41
47
  return OrderBookApi(OrderBookAPIConfigFactory.get_config(env, chain_id))
42
48
 
43
49
 
50
+ @tenacity.retry(
51
+ stop=tenacity.stop_after_attempt(3),
52
+ wait=tenacity.wait_fixed(1),
53
+ after=lambda x: logger.debug(f"get_sell_token_amount failed, {x.attempt_number=}."),
54
+ )
55
+ def get_sell_token_amount(
56
+ buy_amount: Wei,
57
+ sell_token: ChecksumAddress,
58
+ buy_token: ChecksumAddress,
59
+ chain: Chain = Chain.GNOSIS,
60
+ env: Envs = "prod",
61
+ ) -> Wei:
62
+ """
63
+ Calculate how much of the sell_token is needed to obtain a specified amount of buy_token.
64
+ """
65
+ order_book_api = get_order_book_api(env, chain)
66
+ order_quote_request = OrderQuoteRequest(
67
+ sellToken=Address(sell_token),
68
+ buyToken=Address(buy_token),
69
+ from_=Address(
70
+ "0x1234567890abcdef1234567890abcdef12345678"
71
+ ), # Just random address, doesn't matter.
72
+ )
73
+ order_side = OrderQuoteSide3(
74
+ kind=OrderQuoteSideKindBuy.buy,
75
+ buyAmountAfterFee=TokenAmount(str(buy_amount)),
76
+ )
77
+ order_quote = asyncio.run(
78
+ order_book_api.post_quote(order_quote_request, order_side)
79
+ )
80
+ return Wei(order_quote.quote.sellAmount.root)
81
+
82
+
44
83
  @tenacity.retry(
45
84
  stop=stop_after_attempt(3),
46
- wait=wait_fixed(2),
85
+ wait=wait_fixed(1),
47
86
  retry=retry_if_not_exception_type(NoLiquidityAvailableOnCowException),
48
87
  )
49
88
  def get_quote(
@@ -101,7 +140,7 @@ def get_buy_token_amount_else_raise(
101
140
  chain=chain,
102
141
  env=env,
103
142
  )
104
- return wei_type(order_quote.quote.buyAmount.root)
143
+ return Wei(order_quote.quote.buyAmount.root)
105
144
 
106
145
 
107
146
  def swap_tokens_waiting(
@@ -141,7 +180,7 @@ async def swap_tokens_waiting_async(
141
180
  timeout: timedelta = timedelta(seconds=60),
142
181
  ) -> OrderMetaData:
143
182
  order = await swap_tokens(
144
- amount=amount_wei,
183
+ amount=amount_wei.value,
145
184
  sell_token=sell_token,
146
185
  buy_token=buy_token,
147
186
  account=account,
@@ -1,4 +1,3 @@
1
- from eth_typing.evm import ChecksumAddress
2
1
  from web3 import Web3
3
2
 
4
3
  from prediction_market_agent_tooling.gtypes import ChecksumAddress, Wei
@@ -7,7 +6,9 @@ from prediction_market_agent_tooling.tools.contract import (
7
6
  init_collateral_token_contract,
8
7
  to_gnosis_chain_contract,
9
8
  )
10
- from prediction_market_agent_tooling.tools.cow.cow_order import get_buy_token_amount
9
+ from prediction_market_agent_tooling.tools.cow.cow_order import (
10
+ get_buy_token_amount_else_raise,
11
+ )
11
12
 
12
13
 
13
14
  def convert_to_another_token(
@@ -39,7 +40,7 @@ def convert_to_another_token(
39
40
  return from_token_contract.convertToAssets(amount)
40
41
 
41
42
  else:
42
- return get_buy_token_amount(
43
+ return get_buy_token_amount_else_raise(
43
44
  amount,
44
45
  from_token,
45
46
  to_token,
@@ -1,5 +1,4 @@
1
1
  from cachetools import TTLCache, cached
2
- from eth_typing.evm import ChecksumAddress
3
2
 
4
3
  from prediction_market_agent_tooling.gtypes import (
5
4
  USD,
@@ -12,7 +11,9 @@ from prediction_market_agent_tooling.markets.omen.omen_constants import (
12
11
  WRAPPED_XDAI_CONTRACT_ADDRESS,
13
12
  )
14
13
  from prediction_market_agent_tooling.tools.contract import ContractERC4626OnGnosisChain
15
- from prediction_market_agent_tooling.tools.cow.cow_order import get_buy_token_amount
14
+ from prediction_market_agent_tooling.tools.cow.cow_order import (
15
+ get_buy_token_amount_else_raise,
16
+ )
16
17
 
17
18
 
18
19
  def get_usd_in_xdai(amount: USD) -> xDai:
@@ -48,8 +49,8 @@ def get_single_token_to_usd_rate(token_address: ChecksumAddress) -> USD:
48
49
  .convertToAssets(CollateralToken(1).as_wei)
49
50
  .as_token.value
50
51
  )
51
- in_wei = get_buy_token_amount(
52
- sell_amount=CollateralToken(1).as_wei,
52
+ in_wei = get_buy_token_amount_else_raise(
53
+ amount_wei=CollateralToken(1).as_wei,
53
54
  sell_token=token_address,
54
55
  buy_token=WRAPPED_XDAI_CONTRACT_ADDRESS,
55
56
  )
@@ -70,8 +71,8 @@ def get_single_usd_to_token_rate(token_address: ChecksumAddress) -> CollateralTo
70
71
  .convertToShares(CollateralToken(1).as_wei)
71
72
  .as_token.value
72
73
  )
73
- in_wei = get_buy_token_amount(
74
- sell_amount=CollateralToken(1).as_wei,
74
+ in_wei = get_buy_token_amount_else_raise(
75
+ amount_wei=CollateralToken(1).as_wei,
75
76
  sell_token=WRAPPED_XDAI_CONTRACT_ADDRESS,
76
77
  buy_token=token_address,
77
78
  )
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "prediction-market-agent-tooling"
3
- version = "0.63.0.dev498"
3
+ version = "0.63.0.dev500"
4
4
  description = "Tools to benchmark, deploy and monitor prediction market agents."
5
5
  authors = ["Gnosis"]
6
6
  readme = "README.md"