prediction-market-agent-tooling 0.63.6__tar.gz → 0.63.8__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.63.6 → prediction_market_agent_tooling-0.63.8}/PKG-INFO +1 -1
  2. prediction_market_agent_tooling-0.63.8/prediction_market_agent_tooling/abis/seer_gnosis_router.abi.json +348 -0
  3. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/deploy/agent.py +3 -1
  4. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/markets.py +1 -0
  5. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/omen/data_models.py +12 -17
  6. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/seer/data_models.py +30 -0
  7. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/seer/seer.py +65 -2
  8. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/seer/seer_contracts.py +31 -0
  9. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/cow/cow_order.py +23 -0
  10. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/pyproject.toml +1 -1
  11. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/LICENSE +0 -0
  12. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/README.md +0 -0
  13. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/debuggingcontract.abi.json +0 -0
  14. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/depositablewrapper_erc20.abi.json +0 -0
  15. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/erc20.abi.json +0 -0
  16. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/erc4626.abi.json +0 -0
  17. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/erc721.abi.json +0 -0
  18. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/omen_agentresultmapping.abi.json +0 -0
  19. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/omen_dxdao.abi.json +0 -0
  20. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/omen_fpmm.abi.json +0 -0
  21. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/omen_fpmm_conditionaltokens.abi.json +0 -0
  22. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/omen_fpmm_factory.abi.json +0 -0
  23. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/omen_kleros.abi.json +0 -0
  24. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/omen_oracle.abi.json +0 -0
  25. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/omen_realitio.abi.json +0 -0
  26. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/omen_thumbnailmapping.abi.json +0 -0
  27. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/ownable.abi.json +0 -0
  28. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/ownable_erc721.abi.json +0 -0
  29. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/proxy.abi.json +0 -0
  30. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/abis/seer_market_factory.abi.json +0 -0
  31. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/benchmark/__init__.py +0 -0
  32. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/benchmark/agents.py +0 -0
  33. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/benchmark/benchmark.py +0 -0
  34. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/benchmark/utils.py +0 -0
  35. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/config.py +0 -0
  36. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/deploy/agent_example.py +0 -0
  37. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/deploy/betting_strategy.py +0 -0
  38. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/deploy/constants.py +0 -0
  39. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/deploy/gcp/deploy.py +0 -0
  40. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/deploy/gcp/kubernetes_models.py +0 -0
  41. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/deploy/gcp/utils.py +0 -0
  42. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/deploy/trade_interval.py +0 -0
  43. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/gtypes.py +0 -0
  44. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/jobs/__init__.py +0 -0
  45. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/jobs/jobs_models.py +0 -0
  46. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/jobs/omen/omen_jobs.py +0 -0
  47. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/loggers.py +0 -0
  48. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/agent_market.py +0 -0
  49. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/base_subgraph_handler.py +0 -0
  50. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/blockchain_utils.py +0 -0
  51. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/categorize.py +0 -0
  52. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/data_models.py +0 -0
  53. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/manifold/__init__.py +0 -0
  54. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/manifold/api.py +0 -0
  55. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/manifold/data_models.py +0 -0
  56. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/manifold/manifold.py +0 -0
  57. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/manifold/utils.py +0 -0
  58. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/market_fees.py +0 -0
  59. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/metaculus/api.py +0 -0
  60. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/metaculus/data_models.py +0 -0
  61. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/metaculus/metaculus.py +0 -0
  62. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/omen/__init__.py +0 -0
  63. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/omen/omen.py +0 -0
  64. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/omen/omen_constants.py +0 -0
  65. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/omen/omen_contracts.py +0 -0
  66. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/omen/omen_resolving.py +0 -0
  67. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py +0 -0
  68. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/polymarket/api.py +0 -0
  69. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/polymarket/data_models.py +0 -0
  70. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/polymarket/data_models_web.py +0 -0
  71. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/polymarket/polymarket.py +0 -0
  72. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/polymarket/utils.py +0 -0
  73. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/seer/price_manager.py +0 -0
  74. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/seer/seer_subgraph_handler.py +0 -0
  75. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/markets/seer/subgraph_data_models.py +0 -0
  76. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/monitor/financial_metrics/financial_metrics.py +0 -0
  77. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/monitor/markets/manifold.py +0 -0
  78. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/monitor/markets/metaculus.py +0 -0
  79. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/monitor/markets/omen.py +0 -0
  80. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/monitor/markets/polymarket.py +0 -0
  81. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/monitor/monitor.py +0 -0
  82. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/monitor/monitor_app.py +0 -0
  83. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/monitor/monitor_settings.py +0 -0
  84. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/py.typed +0 -0
  85. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/_generic_value.py +0 -0
  86. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/balances.py +0 -0
  87. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py +0 -0
  88. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/betting_strategies/market_moving.py +0 -0
  89. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py +0 -0
  90. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py +0 -0
  91. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/betting_strategies/utils.py +0 -0
  92. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/caches/db_cache.py +0 -0
  93. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/caches/inmemory_cache.py +0 -0
  94. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/caches/serializers.py +0 -0
  95. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/contract.py +0 -0
  96. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/costs.py +0 -0
  97. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/custom_exceptions.py +0 -0
  98. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/datetime_utc.py +0 -0
  99. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/db/db_manager.py +0 -0
  100. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/google_utils.py +0 -0
  101. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/hexbytes_custom.py +0 -0
  102. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/httpx_cached_client.py +0 -0
  103. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/image_gen/image_gen.py +0 -0
  104. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/image_gen/market_thumbnail_gen.py +0 -0
  105. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/ipfs/ipfs_handler.py +0 -0
  106. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/is_invalid.py +0 -0
  107. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/is_predictable.py +0 -0
  108. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/langfuse_.py +0 -0
  109. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/langfuse_client_utils.py +0 -0
  110. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/omen/reality_accuracy.py +0 -0
  111. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/omen/sell_positions.py +0 -0
  112. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/parallelism.py +0 -0
  113. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/relevant_news_analysis/data_models.py +0 -0
  114. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_analysis.py +0 -0
  115. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/relevant_news_analysis/relevant_news_cache.py +0 -0
  116. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/safe.py +0 -0
  117. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/singleton.py +0 -0
  118. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/streamlit_user_login.py +0 -0
  119. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/tavily/tavily_models.py +0 -0
  120. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/tavily/tavily_search.py +0 -0
  121. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/tokens/auto_deposit.py +0 -0
  122. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/tokens/auto_withdraw.py +0 -0
  123. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/tokens/main_token.py +0 -0
  124. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/tokens/token_utils.py +0 -0
  125. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/tokens/usd.py +0 -0
  126. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/transaction_cache.py +0 -0
  127. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/prediction_market_agent_tooling/tools/utils.py +0 -0
  128. {prediction_market_agent_tooling-0.63.6 → prediction_market_agent_tooling-0.63.8}/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.6
3
+ Version: 0.63.8
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.13
@@ -0,0 +1,348 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "contract IConditionalTokens",
6
+ "name": "_conditionalTokens",
7
+ "type": "address"
8
+ },
9
+ {
10
+ "internalType": "contract IWrapped1155Factory",
11
+ "name": "_wrapped1155Factory",
12
+ "type": "address"
13
+ }
14
+ ],
15
+ "stateMutability": "nonpayable",
16
+ "type": "constructor"
17
+ },
18
+ {
19
+ "inputs": [],
20
+ "name": "conditionalTokens",
21
+ "outputs": [
22
+ {
23
+ "internalType": "contract IConditionalTokens",
24
+ "name": "",
25
+ "type": "address"
26
+ }
27
+ ],
28
+ "stateMutability": "view",
29
+ "type": "function"
30
+ },
31
+ {
32
+ "inputs": [
33
+ {
34
+ "internalType": "contract IERC20",
35
+ "name": "collateralToken",
36
+ "type": "address"
37
+ },
38
+ {
39
+ "internalType": "bytes32",
40
+ "name": "parentCollectionId",
41
+ "type": "bytes32"
42
+ },
43
+ {
44
+ "internalType": "bytes32",
45
+ "name": "conditionId",
46
+ "type": "bytes32"
47
+ },
48
+ {
49
+ "internalType": "uint256",
50
+ "name": "indexSet",
51
+ "type": "uint256"
52
+ }
53
+ ],
54
+ "name": "getTokenId",
55
+ "outputs": [
56
+ {
57
+ "internalType": "uint256",
58
+ "name": "",
59
+ "type": "uint256"
60
+ }
61
+ ],
62
+ "stateMutability": "view",
63
+ "type": "function"
64
+ },
65
+ {
66
+ "inputs": [
67
+ {
68
+ "internalType": "bytes32",
69
+ "name": "conditionId",
70
+ "type": "bytes32"
71
+ }
72
+ ],
73
+ "name": "getWinningOutcomes",
74
+ "outputs": [
75
+ {
76
+ "internalType": "bool[]",
77
+ "name": "",
78
+ "type": "bool[]"
79
+ }
80
+ ],
81
+ "stateMutability": "view",
82
+ "type": "function"
83
+ },
84
+ {
85
+ "inputs": [
86
+ {
87
+ "internalType": "contract IERC20",
88
+ "name": "collateralToken",
89
+ "type": "address"
90
+ },
91
+ {
92
+ "internalType": "contract Market",
93
+ "name": "market",
94
+ "type": "address"
95
+ },
96
+ {
97
+ "internalType": "uint256",
98
+ "name": "amount",
99
+ "type": "uint256"
100
+ }
101
+ ],
102
+ "name": "mergePositions",
103
+ "outputs": [],
104
+ "stateMutability": "nonpayable",
105
+ "type": "function"
106
+ },
107
+ {
108
+ "inputs": [
109
+ {
110
+ "internalType": "contract Market",
111
+ "name": "market",
112
+ "type": "address"
113
+ },
114
+ {
115
+ "internalType": "uint256",
116
+ "name": "amount",
117
+ "type": "uint256"
118
+ }
119
+ ],
120
+ "name": "mergeToBase",
121
+ "outputs": [],
122
+ "stateMutability": "nonpayable",
123
+ "type": "function"
124
+ },
125
+ {
126
+ "inputs": [
127
+ {
128
+ "internalType": "address",
129
+ "name": "",
130
+ "type": "address"
131
+ },
132
+ {
133
+ "internalType": "address",
134
+ "name": "",
135
+ "type": "address"
136
+ },
137
+ {
138
+ "internalType": "uint256[]",
139
+ "name": "",
140
+ "type": "uint256[]"
141
+ },
142
+ {
143
+ "internalType": "uint256[]",
144
+ "name": "",
145
+ "type": "uint256[]"
146
+ },
147
+ {
148
+ "internalType": "bytes",
149
+ "name": "",
150
+ "type": "bytes"
151
+ }
152
+ ],
153
+ "name": "onERC1155BatchReceived",
154
+ "outputs": [
155
+ {
156
+ "internalType": "bytes4",
157
+ "name": "",
158
+ "type": "bytes4"
159
+ }
160
+ ],
161
+ "stateMutability": "nonpayable",
162
+ "type": "function"
163
+ },
164
+ {
165
+ "inputs": [
166
+ {
167
+ "internalType": "address",
168
+ "name": "",
169
+ "type": "address"
170
+ },
171
+ {
172
+ "internalType": "address",
173
+ "name": "",
174
+ "type": "address"
175
+ },
176
+ {
177
+ "internalType": "uint256",
178
+ "name": "",
179
+ "type": "uint256"
180
+ },
181
+ {
182
+ "internalType": "uint256",
183
+ "name": "",
184
+ "type": "uint256"
185
+ },
186
+ {
187
+ "internalType": "bytes",
188
+ "name": "",
189
+ "type": "bytes"
190
+ }
191
+ ],
192
+ "name": "onERC1155Received",
193
+ "outputs": [
194
+ {
195
+ "internalType": "bytes4",
196
+ "name": "",
197
+ "type": "bytes4"
198
+ }
199
+ ],
200
+ "stateMutability": "nonpayable",
201
+ "type": "function"
202
+ },
203
+ {
204
+ "inputs": [
205
+ {
206
+ "internalType": "contract IERC20",
207
+ "name": "collateralToken",
208
+ "type": "address"
209
+ },
210
+ {
211
+ "internalType": "contract Market",
212
+ "name": "market",
213
+ "type": "address"
214
+ },
215
+ {
216
+ "internalType": "uint256[]",
217
+ "name": "outcomeIndexes",
218
+ "type": "uint256[]"
219
+ },
220
+ {
221
+ "internalType": "uint256[]",
222
+ "name": "amounts",
223
+ "type": "uint256[]"
224
+ }
225
+ ],
226
+ "name": "redeemPositions",
227
+ "outputs": [],
228
+ "stateMutability": "nonpayable",
229
+ "type": "function"
230
+ },
231
+ {
232
+ "inputs": [
233
+ {
234
+ "internalType": "contract Market",
235
+ "name": "market",
236
+ "type": "address"
237
+ },
238
+ {
239
+ "internalType": "uint256[]",
240
+ "name": "outcomeIndexes",
241
+ "type": "uint256[]"
242
+ },
243
+ {
244
+ "internalType": "uint256[]",
245
+ "name": "amounts",
246
+ "type": "uint256[]"
247
+ }
248
+ ],
249
+ "name": "redeemToBase",
250
+ "outputs": [],
251
+ "stateMutability": "nonpayable",
252
+ "type": "function"
253
+ },
254
+ {
255
+ "inputs": [],
256
+ "name": "sDAI",
257
+ "outputs": [
258
+ {
259
+ "internalType": "contract IERC20",
260
+ "name": "",
261
+ "type": "address"
262
+ }
263
+ ],
264
+ "stateMutability": "view",
265
+ "type": "function"
266
+ },
267
+ {
268
+ "inputs": [],
269
+ "name": "savingsXDaiAdapter",
270
+ "outputs": [
271
+ {
272
+ "internalType": "contract ISavingsXDaiAdapter",
273
+ "name": "",
274
+ "type": "address"
275
+ }
276
+ ],
277
+ "stateMutability": "view",
278
+ "type": "function"
279
+ },
280
+ {
281
+ "inputs": [
282
+ {
283
+ "internalType": "contract Market",
284
+ "name": "market",
285
+ "type": "address"
286
+ }
287
+ ],
288
+ "name": "splitFromBase",
289
+ "outputs": [],
290
+ "stateMutability": "payable",
291
+ "type": "function"
292
+ },
293
+ {
294
+ "inputs": [
295
+ {
296
+ "internalType": "contract IERC20",
297
+ "name": "collateralToken",
298
+ "type": "address"
299
+ },
300
+ {
301
+ "internalType": "contract Market",
302
+ "name": "market",
303
+ "type": "address"
304
+ },
305
+ {
306
+ "internalType": "uint256",
307
+ "name": "amount",
308
+ "type": "uint256"
309
+ }
310
+ ],
311
+ "name": "splitPosition",
312
+ "outputs": [],
313
+ "stateMutability": "nonpayable",
314
+ "type": "function"
315
+ },
316
+ {
317
+ "inputs": [
318
+ {
319
+ "internalType": "bytes4",
320
+ "name": "interfaceId",
321
+ "type": "bytes4"
322
+ }
323
+ ],
324
+ "name": "supportsInterface",
325
+ "outputs": [
326
+ {
327
+ "internalType": "bool",
328
+ "name": "",
329
+ "type": "bool"
330
+ }
331
+ ],
332
+ "stateMutability": "view",
333
+ "type": "function"
334
+ },
335
+ {
336
+ "inputs": [],
337
+ "name": "wrapped1155Factory",
338
+ "outputs": [
339
+ {
340
+ "internalType": "contract IWrapped1155Factory",
341
+ "name": "",
342
+ "type": "address"
343
+ }
344
+ ],
345
+ "stateMutability": "view",
346
+ "type": "function"
347
+ }
348
+ ]
@@ -439,7 +439,9 @@ class DeployablePredictionAgent(DeployableAgent):
439
439
  verify_market: bool = True,
440
440
  ) -> ProcessedMarket | None:
441
441
  self.update_langfuse_trace_by_market(market_type, market)
442
- logger.info(f"Processing market {market.question=} from {market.url=}.")
442
+ logger.info(
443
+ f"Processing market {market.question=} from {market.url=} with liquidity {market.get_liquidity()}."
444
+ )
443
445
 
444
446
  answer: ProbabilisticAnswer | None
445
447
  if verify_market and not self.verify_market(market_type, market):
@@ -115,6 +115,7 @@ def have_bet_on_market_since(
115
115
  for b in OmenSubgraphHandler().get_bets(
116
116
  better_address=keys.bet_from_address,
117
117
  start_time=start_time,
118
+ market_id=market.market_maker_contract_address_checksummed,
118
119
  )
119
120
  )
120
121
  if isinstance(market, OmenAgentMarket)
@@ -36,7 +36,6 @@ from prediction_market_agent_tooling.tools.utils import (
36
36
  should_not_happen,
37
37
  utcnow,
38
38
  )
39
- from prediction_market_agent_tooling.tools.web3_utils import is_valid_wei
40
39
 
41
40
  OMEN_TRUE_OUTCOME = OutcomeStr("Yes")
42
41
  OMEN_FALSE_OUTCOME = OutcomeStr("No")
@@ -239,22 +238,18 @@ class OmenMarket(BaseModel):
239
238
 
240
239
  @model_validator(mode="after")
241
240
  def _model_validator(self) -> "OmenMarket":
242
- if not all(is_valid_wei(number.value) for number in self.outcomeTokenAmounts):
243
- # Sometimes we receive markets with outcomeTokenAmounts as `model.outcomeTokenAmounts=[OutcomeWei(24662799387878572), OutcomeWei(-24750000000000000)]`, which should be impossible.
244
- # Current huntch is that it's a weird transitional status.
245
- # Try to set them to zeros if market isn't open anymore (that's expected behaviour in such case),
246
- # otherwise raise an error to investigate further.
247
- if not self.is_open or not self.liquidityParameter:
248
- logger.warning(
249
- f"Market {self.url} has invalid {self.outcomeTokenAmounts=}, but isn't open anymore or doesn't have any liquidity ({self.is_open=}, {self.liquidityParameter=}). Setting them to zeros."
250
- )
251
- self.outcomeTokenAmounts = [OutcomeWei(0) for _ in self.outcomes]
252
- self.outcomeTokenMarginalPrices = None
253
-
254
- else:
255
- raise ValueError(
256
- f"Market {self.url} has invalid {self.outcomeTokenAmounts=}: {self.model_dump()=}"
257
- )
241
+ if any(number < 0 for number in self.outcomeTokenAmounts):
242
+ # Sometimes we receive markets with outcomeTokenAmounts as `model.outcomeTokenAmounts=[OutcomeWei(24662799387878572), OutcomeWei(-24750000000000000)]`,
243
+ # which should be impossible.
244
+ # Current huntch is that it's a weird transitional status or bug after withdrawing liquidity.
245
+ # Because so far, it always happened on markets with withdrawn liquidity,
246
+ # so we just set them to zeros, as we expect them to be.
247
+ logger.warning(
248
+ f"Market {self.url} has invalid {self.outcomeTokenAmounts=}. Setting them to zeros."
249
+ )
250
+ self.outcomeTokenAmounts = [OutcomeWei(0) for _ in self.outcomes]
251
+ self.outcomeTokenMarginalPrices = None
252
+ self.liquidityParameter = Wei(0)
258
253
 
259
254
  return self
260
255
 
@@ -13,12 +13,14 @@ from prediction_market_agent_tooling.gtypes import (
13
13
  HexAddress,
14
14
  HexBytes,
15
15
  OutcomeStr,
16
+ OutcomeWei,
16
17
  Web3Wei,
17
18
  )
18
19
  from prediction_market_agent_tooling.markets.data_models import Resolution
19
20
  from prediction_market_agent_tooling.markets.seer.subgraph_data_models import (
20
21
  SeerParentMarket,
21
22
  )
23
+ from prediction_market_agent_tooling.tools.contract import ContractERC20OnGnosisChain
22
24
  from prediction_market_agent_tooling.tools.datetime_utc import DatetimeUTC
23
25
 
24
26
 
@@ -149,6 +151,27 @@ class SeerMarket(BaseModel):
149
151
  return Resolution.YES
150
152
  return Resolution.NO
151
153
 
154
+ def is_redeemable(self, owner: ChecksumAddress, web3: Web3 | None = None) -> bool:
155
+ token_balances = self.get_outcome_token_balances(owner, web3)
156
+ if not self.payout_reported:
157
+ return False
158
+ return any(
159
+ payout and balance > 0
160
+ for payout, balance in zip(self.payout_numerators, token_balances)
161
+ )
162
+
163
+ def get_outcome_token_balances(
164
+ self, owner: ChecksumAddress, web3: Web3 | None = None
165
+ ) -> list[OutcomeWei]:
166
+ return [
167
+ OutcomeWei.from_wei(
168
+ ContractERC20OnGnosisChain(
169
+ address=Web3.to_checksum_address(token)
170
+ ).balanceOf(owner, web3=web3)
171
+ )
172
+ for token in self.wrapped_tokens
173
+ ]
174
+
152
175
  @property
153
176
  def is_binary(self) -> bool:
154
177
  # 3 because Seer has also third, `Invalid` outcome.
@@ -186,3 +209,10 @@ class SeerMarket(BaseModel):
186
209
  def url(self) -> str:
187
210
  chain_id = RPCConfig().chain_id
188
211
  return urljoin(SEER_BASE_URL, f"markets/{chain_id}/{self.id.hex()}")
212
+
213
+
214
+ class RedeemParams(BaseModel):
215
+ model_config = ConfigDict(populate_by_name=True)
216
+ market: ChecksumAddress
217
+ outcome_indices: list[int] = Field(alias="outcomeIndexes")
218
+ amounts: list[OutcomeWei]
@@ -28,11 +28,13 @@ 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
+ RedeemParams,
31
32
  SeerMarket,
32
33
  SeerOutcomeEnum,
33
34
  )
34
35
  from prediction_market_agent_tooling.markets.seer.price_manager import PriceManager
35
36
  from prediction_market_agent_tooling.markets.seer.seer_contracts import (
37
+ GnosisRouter,
36
38
  SeerMarketFactory,
37
39
  )
38
40
  from prediction_market_agent_tooling.markets.seer.seer_subgraph_handler import (
@@ -48,6 +50,7 @@ from prediction_market_agent_tooling.tools.contract import (
48
50
  )
49
51
  from prediction_market_agent_tooling.tools.cow.cow_order import (
50
52
  get_buy_token_amount_else_raise,
53
+ get_trades_by_owner,
51
54
  swap_tokens_waiting,
52
55
  )
53
56
  from prediction_market_agent_tooling.tools.datetime_utc import DatetimeUTC
@@ -202,10 +205,70 @@ class SeerAgentMarket(AgentMarket):
202
205
  def get_user_id(api_keys: APIKeys) -> str:
203
206
  return OmenAgentMarket.get_user_id(api_keys)
204
207
 
208
+ @staticmethod
209
+ def _filter_markets_contained_in_trades(
210
+ api_keys: APIKeys,
211
+ markets: list[SeerMarket],
212
+ ) -> list[SeerMarket]:
213
+ """
214
+ We filter the markets using previous trades by the user so that we don't have to process all Seer markets.
215
+ """
216
+ trades_by_user = get_trades_by_owner(api_keys.bet_from_address)
217
+
218
+ traded_tokens = {t.buyToken for t in trades_by_user}.union(
219
+ [t.sellToken for t in trades_by_user]
220
+ )
221
+ filtered_markets = []
222
+ for market in markets:
223
+ if any(
224
+ [
225
+ Web3.to_checksum_address(wrapped_token) in traded_tokens
226
+ for wrapped_token in market.wrapped_tokens
227
+ ]
228
+ ):
229
+ filtered_markets.append(market)
230
+
231
+ return filtered_markets
232
+
205
233
  @staticmethod
206
234
  def redeem_winnings(api_keys: APIKeys) -> None:
207
- # ToDo - implement me (https://github.com/gnosis/prediction-market-agent-tooling/issues/499)
208
- pass
235
+ web3 = RPCConfig().get_web3()
236
+ subgraph = SeerSubgraphHandler()
237
+
238
+ closed_markets = subgraph.get_binary_markets(
239
+ filter_by=FilterBy.RESOLVED, sort_by=SortBy.NEWEST
240
+ )
241
+ filtered_markets = SeerAgentMarket._filter_markets_contained_in_trades(
242
+ api_keys, closed_markets
243
+ )
244
+
245
+ market_balances = {
246
+ market.id: market.get_outcome_token_balances(
247
+ api_keys.bet_from_address, web3
248
+ )
249
+ for market in filtered_markets
250
+ }
251
+
252
+ markets_to_redeem = [
253
+ market
254
+ for market in filtered_markets
255
+ if market.is_redeemable(owner=api_keys.bet_from_address, web3=web3)
256
+ ]
257
+
258
+ gnosis_router = GnosisRouter()
259
+ for market in markets_to_redeem:
260
+ try:
261
+ params = RedeemParams(
262
+ market=Web3.to_checksum_address(market.id),
263
+ outcome_indices=list(range(len(market.payout_numerators))),
264
+ amounts=market_balances[market.id],
265
+ )
266
+ gnosis_router.redeem_to_base(api_keys, params=params, web3=web3)
267
+ logger.info(f"Redeemed market {market.id.hex()}")
268
+ except Exception as e:
269
+ logger.error(f"Failed to redeem market {market.id.hex()}, {e}")
270
+
271
+ # GnosisRouter withdraws sDai into wxDAI/xDai on its own, so no auto-withdraw needed by us.
209
272
 
210
273
  @staticmethod
211
274
  def verify_operational_balance(api_keys: APIKeys) -> bool:
@@ -11,6 +11,7 @@ from prediction_market_agent_tooling.gtypes import (
11
11
  TxReceipt,
12
12
  xDai,
13
13
  )
14
+ from prediction_market_agent_tooling.markets.seer.data_models import RedeemParams
14
15
  from prediction_market_agent_tooling.markets.seer.subgraph_data_models import (
15
16
  CreateCategoricalMarketsParams,
16
17
  )
@@ -79,3 +80,33 @@ class SeerMarketFactory(ContractOnGnosisChain):
79
80
  web3=web3,
80
81
  )
81
82
  return receipt_tx
83
+
84
+
85
+ class GnosisRouter(ContractOnGnosisChain):
86
+ # https://gnosisscan.io/address/0x83183da839ce8228e31ae41222ead9edbb5cdcf1#code.
87
+ abi: ABI = abi_field_validator(
88
+ os.path.join(
89
+ os.path.dirname(os.path.realpath(__file__)),
90
+ "../../abis/seer_gnosis_router.abi.json",
91
+ )
92
+ )
93
+ address: ChecksumAddress = Web3.to_checksum_address(
94
+ "0xeC9048b59b3467415b1a38F63416407eA0c70fB8"
95
+ )
96
+
97
+ def redeem_to_base(
98
+ self,
99
+ api_keys: APIKeys,
100
+ params: RedeemParams,
101
+ web3: Web3 | None = None,
102
+ ) -> TxReceipt:
103
+ params_dict = params.model_dump(by_alias=True)
104
+ # We explicity set amounts since OutcomeWei gets serialized as dict
105
+ params_dict["amounts"] = [amount.value for amount in params.amounts]
106
+ receipt_tx = self.send(
107
+ api_keys=api_keys,
108
+ function_name="redeemToBase",
109
+ function_params=params_dict,
110
+ web3=web3,
111
+ )
112
+ return receipt_tx
@@ -23,6 +23,7 @@ from cowdao_cowpy.order_book.generated.model import (
23
23
  OrderStatus,
24
24
  TokenAmount,
25
25
  )
26
+ from cowdao_cowpy.subgraph.client import BaseModel
26
27
  from eth_account.signers.local import LocalAccount
27
28
  from tenacity import retry_if_not_exception_type, stop_after_attempt, wait_fixed
28
29
  from web3 import Web3
@@ -34,6 +35,11 @@ from prediction_market_agent_tooling.tools.contract import ContractERC20OnGnosis
34
35
  from prediction_market_agent_tooling.tools.utils import utcnow
35
36
 
36
37
 
38
+ class MinimalisticToken(BaseModel):
39
+ sellToken: ChecksumAddress
40
+ buyToken: ChecksumAddress
41
+
42
+
37
43
  class OrderStatusError(Exception):
38
44
  pass
39
45
 
@@ -221,3 +227,20 @@ async def swap_tokens_waiting_async(
221
227
  )
222
228
 
223
229
  await asyncio.sleep(3.14)
230
+
231
+
232
+ @tenacity.retry(
233
+ stop=stop_after_attempt(3),
234
+ wait=wait_fixed(1),
235
+ after=lambda x: logger.debug(f"get_trades_by_owner failed, {x.attempt_number=}."),
236
+ )
237
+ def get_trades_by_owner(
238
+ owner: ChecksumAddress,
239
+ ) -> list[MinimalisticToken]:
240
+ # Using this until cowpy gets fixed (https://github.com/cowdao-grants/cow-py/issues/35)
241
+ response = httpx.get(
242
+ f"https://api.cow.fi/xdai/api/v1/trades",
243
+ params={"owner": owner},
244
+ )
245
+ response.raise_for_status()
246
+ return [MinimalisticToken.model_validate(i) for i in response.json()]
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "prediction-market-agent-tooling"
3
- version = "0.63.6"
3
+ version = "0.63.8"
4
4
  description = "Tools to benchmark, deploy and monitor prediction market agents."
5
5
  authors = ["Gnosis"]
6
6
  readme = "README.md"