prediction-market-agent-tooling 0.63.10.dev565__py3-none-any.whl → 0.64.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -577,7 +577,7 @@ class DeployableTraderAgent(DeployablePredictionAgent):
577
577
 
578
578
  if market.get_trade_balance(api_keys) < min_required_balance_to_trade:
579
579
  raise OutOfFundsError(
580
- f"Minimum required balance {min_required_balance_to_trade} for agent is not met."
580
+ f"Minimum required balance {min_required_balance_to_trade} for agent {api_keys.bet_from_address=} is not met."
581
581
  )
582
582
 
583
583
  def get_betting_strategy(self, market: AgentMarket) -> BettingStrategy:
@@ -0,0 +1,34 @@
1
+ import os
2
+
3
+ from web3 import Web3
4
+
5
+ from prediction_market_agent_tooling.config import APIKeys
6
+ from prediction_market_agent_tooling.gtypes import ABI, HexBytes
7
+ from prediction_market_agent_tooling.tools.contract import (
8
+ ContractOnGnosisChain,
9
+ abi_field_validator,
10
+ )
11
+
12
+
13
+ class CowGPv2SettlementContract(ContractOnGnosisChain):
14
+ # Contract ABI taken from https://github.com/cowprotocol/cow-sdk/blob/main/abi/GPv2Settlement.json.
15
+ abi: ABI = abi_field_validator(
16
+ os.path.join(
17
+ os.path.dirname(os.path.realpath(__file__)),
18
+ "../../abis/gvp2_settlement.abi.json",
19
+ )
20
+ )
21
+
22
+ def setPreSignature(
23
+ self,
24
+ api_keys: APIKeys,
25
+ orderId: HexBytes,
26
+ signed: bool,
27
+ web3: Web3 | None = None,
28
+ ) -> None:
29
+ self.send(
30
+ api_keys=api_keys,
31
+ function_name="setPreSignature",
32
+ function_params=[orderId, signed],
33
+ web3=web3,
34
+ )
@@ -1353,7 +1353,7 @@ def send_keeping_token_to_eoa_xdai(
1353
1353
 
1354
1354
  else:
1355
1355
  raise OutOfFundsError(
1356
- f"Current wxDai balance ({current_balances_eoa=}, {current_balances_betting=}) is less than the required minimum wxDai to withdraw {need_to_withdraw}."
1356
+ f"Current wxDai balance ({current_balances_eoa=} for {api_keys.public_key=}, {current_balances_betting=} for {api_keys.bet_from_address=}) is less than the required minimum wxDai to withdraw {need_to_withdraw}."
1357
1357
  )
1358
1358
 
1359
1359
 
@@ -435,6 +435,24 @@ class WETHContract(ContractERC20OnGnosisChain):
435
435
  )
436
436
 
437
437
 
438
+ class EUReContract(ContractERC20OnGnosisChain):
439
+ address: ChecksumAddress = Web3.to_checksum_address(
440
+ "0xcB444e90D8198415266c6a2724b7900fb12FC56E"
441
+ )
442
+
443
+
444
+ class SAFEContract(ContractERC20OnGnosisChain):
445
+ address: ChecksumAddress = Web3.to_checksum_address(
446
+ "0x4d18815D14fe5c3304e87B3FA18318baa5c23820"
447
+ )
448
+
449
+
450
+ class COWContract(ContractERC20OnGnosisChain):
451
+ address: ChecksumAddress = Web3.to_checksum_address(
452
+ "0x177127622c4A00F3d409B75571e12cB3c8973d3c"
453
+ )
454
+
455
+
438
456
  class WrappedxDaiContract(ContractDepositableWrapperERC20OnGnosisChain):
439
457
  address: ChecksumAddress = WRAPPED_XDAI_CONTRACT_ADDRESS
440
458
 
@@ -893,30 +911,6 @@ class OmenThumbnailMapping(ContractOnGnosisChain):
893
911
  )
894
912
 
895
913
 
896
- class CowGPv2SettlementContract(ContractOnGnosisChain):
897
- # Contract ABI taken from https://github.com/cowprotocol/cow-sdk/blob/main/abi/GPv2Settlement.json.
898
- abi: ABI = abi_field_validator(
899
- os.path.join(
900
- os.path.dirname(os.path.realpath(__file__)),
901
- "../../abis/gvp2_settlement.abi.json",
902
- )
903
- )
904
-
905
- def setPreSignature(
906
- self,
907
- api_keys: APIKeys,
908
- orderId: HexBytes,
909
- signed: bool,
910
- web3: Web3 | None = None,
911
- ) -> None:
912
- self.send(
913
- api_keys=api_keys,
914
- function_name="setPreSignature",
915
- function_params=[orderId, signed],
916
- web3=web3,
917
- )
918
-
919
-
920
914
  class CollateralTokenChoice(str, Enum):
921
915
  wxdai = "wxdai"
922
916
  sdai = "sdai"
@@ -30,7 +30,12 @@ from prediction_market_agent_tooling.markets.omen.data_models import (
30
30
  RealityResponse,
31
31
  )
32
32
  from prediction_market_agent_tooling.markets.omen.omen_contracts import (
33
+ COWContract,
34
+ EUReContract,
35
+ GNOContract,
33
36
  OmenThumbnailMapping,
37
+ SAFEContract,
38
+ WETHContract,
34
39
  WrappedxDaiContract,
35
40
  sDaiContract,
36
41
  )
@@ -51,6 +56,11 @@ from prediction_market_agent_tooling.tools.web3_utils import (
51
56
  SAFE_COLLATERAL_TOKENS = (
52
57
  WrappedxDaiContract(),
53
58
  sDaiContract(),
59
+ GNOContract(),
60
+ WETHContract(),
61
+ EUReContract(),
62
+ SAFEContract(),
63
+ COWContract(),
54
64
  )
55
65
  SAFE_COLLATERAL_TOKENS_ADDRESSES = tuple(
56
66
  contract.address for contract in SAFE_COLLATERAL_TOKENS
@@ -30,7 +30,7 @@ from web3 import Web3
30
30
  from prediction_market_agent_tooling.config import APIKeys
31
31
  from prediction_market_agent_tooling.gtypes import ChecksumAddress, HexBytes, Wei
32
32
  from prediction_market_agent_tooling.loggers import logger
33
- from prediction_market_agent_tooling.markets.omen.omen_contracts import (
33
+ from prediction_market_agent_tooling.markets.omen.cow_contracts import (
34
34
  CowGPv2SettlementContract,
35
35
  )
36
36
  from prediction_market_agent_tooling.tools.contract import ContractERC20OnGnosisChain
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.63.10.dev565
3
+ Version: 0.64.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
@@ -23,7 +23,7 @@ prediction_market_agent_tooling/benchmark/agents.py,sha256=B1-uWdyeN4GGKMWGK_-Cc
23
23
  prediction_market_agent_tooling/benchmark/benchmark.py,sha256=MqTiaaJ3cYiOLUVR7OyImLWxcEya3Rl5JyFYW-K0lwM,17097
24
24
  prediction_market_agent_tooling/benchmark/utils.py,sha256=D0MfUkVZllmvcU0VOurk9tcKT7JTtwwOp-63zuCBVuc,2880
25
25
  prediction_market_agent_tooling/config.py,sha256=QWybGq-DfjlRKG2G4l_4kJEyH3pmUvmcw4n2d2-z3eQ,10183
26
- prediction_market_agent_tooling/deploy/agent.py,sha256=tEYX133rSsZ6b9kx-RtZSHxkdN8LZvn0P6CVz6KOJlc,26531
26
+ prediction_market_agent_tooling/deploy/agent.py,sha256=dobqPUQkaDPhsvMmXwibNKu4hSSTXTvmfa3F46ylLBc,26560
27
27
  prediction_market_agent_tooling/deploy/agent_example.py,sha256=dIIdZashExWk9tOdyDjw87AuUcGyM7jYxNChYrVK2dM,1001
28
28
  prediction_market_agent_tooling/deploy/betting_strategy.py,sha256=p25t7VU7I4hSkSl6SpzI_W55kLbYEySQdBqeschmARY,12918
29
29
  prediction_market_agent_tooling/deploy/constants.py,sha256=M5ty8URipYMGe_G-RzxRydK3AFL6CyvmqCraJUrLBnE,82
@@ -52,12 +52,13 @@ prediction_market_agent_tooling/markets/metaculus/api.py,sha256=4TRPGytQQbSdf42D
52
52
  prediction_market_agent_tooling/markets/metaculus/data_models.py,sha256=FaBCTPPezXbBwZ9p791CiVgQ4vB696xnMbz9XVXmiVI,3267
53
53
  prediction_market_agent_tooling/markets/metaculus/metaculus.py,sha256=86TIx6cavEWc8Cv4KpZxSvwiSw9oFybXE3YB49pg-CA,4377
54
54
  prediction_market_agent_tooling/markets/omen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
+ prediction_market_agent_tooling/markets/omen/cow_contracts.py,sha256=sl1L4cK5nAJwZ2wdhLzqh8p7h_IEValNvLwKUlInKxw,957
55
56
  prediction_market_agent_tooling/markets/omen/data_models.py,sha256=dtWbRy9tpasssQP80ZFYxAc_9pnVD-zUpVjenBqurnA,30221
56
- prediction_market_agent_tooling/markets/omen/omen.py,sha256=Jf2qSJJn0UUISpi24xYRwoVycGuYE42kZ2z1HRGl43w,51927
57
+ prediction_market_agent_tooling/markets/omen/omen.py,sha256=BvTFQ9MZqo9q0wEaE2TzsZ8Q_yPGIZQehehnDIJ3id0,51987
57
58
  prediction_market_agent_tooling/markets/omen/omen_constants.py,sha256=D9oflYKafLQiHYtB5sScMHqmXyzM8JP8J0yATmc4SQQ,233
58
- prediction_market_agent_tooling/markets/omen/omen_contracts.py,sha256=aBhOKild5Ly8SylmvmuEglSbwpJRyod6mkXz41YDuS8,29423
59
+ prediction_market_agent_tooling/markets/omen/omen_contracts.py,sha256=H7jFVLcdbxq6gxWS77YzBFHLnfaItU6MXXVzPzDCkwM,29236
59
60
  prediction_market_agent_tooling/markets/omen/omen_resolving.py,sha256=Cyi9Ci-Z-K8WCZWVLs9oSuJC6qRobi_CpqDCno_5F-0,10238
60
- prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py,sha256=6N6RJ-noC7gkoDBeYdBSXp1QI3u4iftBLu8Dtew9yU4,39017
61
+ prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py,sha256=vwjAsxgBvIxzlYealHJIzEC6Q6hFv6qKssJ8PrsgoFs,39203
61
62
  prediction_market_agent_tooling/markets/polymarket/api.py,sha256=UZ4_TG8ceb9Y-qgsOKs8Qiv8zDt957QkT8IX2c83yqo,4800
62
63
  prediction_market_agent_tooling/markets/polymarket/data_models.py,sha256=utGN-Lhjsa-RHX5WW_jcqgWXtRkEZn0JemwYZkt3Lng,4344
63
64
  prediction_market_agent_tooling/markets/polymarket/data_models_web.py,sha256=LVEsNw2nUx5poiU1m803NNqG5-fs8-MODQRyGLqy4mE,12585
@@ -90,7 +91,7 @@ prediction_market_agent_tooling/tools/caches/inmemory_cache.py,sha256=ZW5iI5rmjq
90
91
  prediction_market_agent_tooling/tools/caches/serializers.py,sha256=vFDx4fsPxclXp2q0sv27j4al_M_Tj9aR2JJP-xNHQXA,2151
91
92
  prediction_market_agent_tooling/tools/contract.py,sha256=1ZFp_VoqTjM8cqOfAhco2Ht0DTqakjhZpuZUrAXr28Q,21332
92
93
  prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
93
- prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=nERAci2yNnpCLvotBl9B8gCOeZR058dCa4YwhUcK0PQ,8798
94
+ prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=gakwBMVD287v4FrgJC-qwpc5zZHu9yLfTzcmhht-BXA,8797
94
95
  prediction_market_agent_tooling/tools/custom_exceptions.py,sha256=Fh8z1fbwONvP4-j7AmV_PuEcoqb6-QXa9PJ9m7guMcM,93
95
96
  prediction_market_agent_tooling/tools/datetime_utc.py,sha256=8_WackjtjC8zHXrhQFTGQ6e6Fz_6llWoKR4CSFvIv9I,2766
96
97
  prediction_market_agent_tooling/tools/db/db_manager.py,sha256=GtzHH1NLl8HwqC8Z7s6eTlIQXuV0blxfaV2PeQrBnfQ,3013
@@ -123,8 +124,8 @@ prediction_market_agent_tooling/tools/tokens/usd.py,sha256=yuW8iPPtcpP4eLH2nORMD
123
124
  prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
124
125
  prediction_market_agent_tooling/tools/utils.py,sha256=AC2a68jwASMWuQi-w8twl8b_M52YwrEJ81abmuEaqMY,6661
125
126
  prediction_market_agent_tooling/tools/web3_utils.py,sha256=zRq-eeBGWt8uUGN9G_WfjmJ0eVvO8aWE9S0Pz_Y6AOA,12342
126
- prediction_market_agent_tooling-0.63.10.dev565.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
127
- prediction_market_agent_tooling-0.63.10.dev565.dist-info/METADATA,sha256=YMqiprzCES9UDZBzP6wIBYJbSO8sWrdYsaMOAaJze8w,8698
128
- prediction_market_agent_tooling-0.63.10.dev565.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
129
- prediction_market_agent_tooling-0.63.10.dev565.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
130
- prediction_market_agent_tooling-0.63.10.dev565.dist-info/RECORD,,
127
+ prediction_market_agent_tooling-0.64.0.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
128
+ prediction_market_agent_tooling-0.64.0.dist-info/METADATA,sha256=KnjNTkpA-CeHrfoyRAXM5nEXMLYvXa-H24R0hBeV1Gk,8690
129
+ prediction_market_agent_tooling-0.64.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
130
+ prediction_market_agent_tooling-0.64.0.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
131
+ prediction_market_agent_tooling-0.64.0.dist-info/RECORD,,