prediction-market-agent-tooling 0.62.0.dev490__py3-none-any.whl → 0.62.0.dev491__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.
@@ -788,7 +788,7 @@ def omen_sell_outcome_tx(
788
788
  outcome: str,
789
789
  auto_withdraw: bool,
790
790
  web3: Web3 | None = None,
791
- slippage: float = 0.001,
791
+ slippage: float = 0.01,
792
792
  ) -> str:
793
793
  """
794
794
  Sells the given xDai value of shares corresponding to the given outcome in
@@ -807,7 +807,6 @@ def omen_sell_outcome_tx(
807
807
  else market.get_in_token(amount)
808
808
  )
809
809
  amount_wei = amount_token.as_wei
810
- amount_wei = amount_wei.without_fraction(slippage)
811
810
 
812
811
  logger.info(
813
812
  f"Selling asked {amount.value=} {amount.symbol}, converted to {amount_wei.as_token.value=} {amount_wei.as_token.symbol} for {outcome=} in market {market.url=}."
@@ -23,7 +23,7 @@ def auto_deposit_collateral_token(
23
23
  collateral_amount_wei_or_usd: Wei | USD,
24
24
  api_keys: APIKeys,
25
25
  web3: Web3 | None = None,
26
- slippage: float = 0.01,
26
+ surplus: float = 0.01,
27
27
  ) -> None:
28
28
  collateral_amount_wei = (
29
29
  collateral_amount_wei_or_usd
@@ -32,8 +32,8 @@ def auto_deposit_collateral_token(
32
32
  collateral_amount_wei_or_usd, collateral_token_contract.address
33
33
  ).as_wei
34
34
  )
35
- # Deposit a bit more, to cover any later changes in the price.
36
- collateral_amount_wei = collateral_amount_wei.with_fraction(slippage)
35
+ # Deposit a bit more to cover any small changes in conversions.
36
+ collateral_amount_wei = collateral_amount_wei.with_fraction(surplus)
37
37
 
38
38
  if isinstance(collateral_token_contract, ContractDepositableWrapperERC20BaseClass):
39
39
  # In this case, we can use deposit function directly, no need to go through DEX.
@@ -137,14 +137,11 @@ def auto_deposit_erc20(
137
137
  )
138
138
  if not remaining_to_get_in_collateral_wei:
139
139
  return
140
- # Get of how much of the source token we need to sell in order to fill the remaining collateral amount, with 1% slippage to be sure.
141
- amount_to_sell_wei = (
142
- get_sell_token_amount(
143
- remaining_to_get_in_collateral_wei,
144
- sell_token=KEEPING_ERC20_TOKEN.address,
145
- buy_token=collateral_token_contract.address,
146
- )
147
- * 1.01
140
+ # Get of how much of the source token we need to sell in order to fill the remaining collateral amount.
141
+ amount_to_sell_wei = get_sell_token_amount(
142
+ remaining_to_get_in_collateral_wei,
143
+ sell_token=KEEPING_ERC20_TOKEN.address,
144
+ buy_token=collateral_token_contract.address,
148
145
  )
149
146
  # If we don't have enough of the source token.
150
147
  if amount_to_sell_wei > ContractERC20OnGnosisChain(
@@ -17,11 +17,7 @@ def auto_withdraw_collateral_token(
17
17
  amount_wei: Wei,
18
18
  api_keys: APIKeys,
19
19
  web3: Web3 | None = None,
20
- slippage: float = 0.001,
21
20
  ) -> None:
22
- # Small slippage as exact exchange rate constantly changes and we don't care about small differences.
23
- amount_wei = amount_wei.without_fraction(slippage)
24
-
25
21
  if not amount_wei:
26
22
  logger.warning(
27
23
  f"Amount to withdraw is zero, skipping withdrawal of {collateral_token_contract.symbol_cached(web3)}."
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.62.0.dev490
3
+ Version: 0.62.0.dev491
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.13
@@ -51,7 +51,7 @@ prediction_market_agent_tooling/markets/metaculus/data_models.py,sha256=FaBCTPPe
51
51
  prediction_market_agent_tooling/markets/metaculus/metaculus.py,sha256=86TIx6cavEWc8Cv4KpZxSvwiSw9oFybXE3YB49pg-CA,4377
52
52
  prediction_market_agent_tooling/markets/omen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  prediction_market_agent_tooling/markets/omen/data_models.py,sha256=URvplDcTLeL6vfpkSgi8ln2iEKxt8w5qf6mTZkSyrCo,29189
54
- prediction_market_agent_tooling/markets/omen/omen.py,sha256=L1NaKGkdCVtGVz7RbkBuHaYRyYfuYRthTxmnYWNwgeU,51949
54
+ prediction_market_agent_tooling/markets/omen/omen.py,sha256=_Vt1_w_A6-FHPVgNclwSh2qpABBXXTJ2wKPtcFfrDTQ,51893
55
55
  prediction_market_agent_tooling/markets/omen/omen_constants.py,sha256=D9oflYKafLQiHYtB5sScMHqmXyzM8JP8J0yATmc4SQQ,233
56
56
  prediction_market_agent_tooling/markets/omen/omen_contracts.py,sha256=bCC9A7ZTJxMDJcPbl3jof6HcAGGHv1BrFq3RRWbkQ_c,28739
57
57
  prediction_market_agent_tooling/markets/omen/omen_resolving.py,sha256=Cyi9Ci-Z-K8WCZWVLs9oSuJC6qRobi_CpqDCno_5F-0,10238
@@ -112,16 +112,16 @@ prediction_market_agent_tooling/tools/singleton.py,sha256=CiIELUiI-OeS7U7eeHEt0r
112
112
  prediction_market_agent_tooling/tools/streamlit_user_login.py,sha256=NXEqfjT9Lc9QtliwSGRASIz1opjQ7Btme43H4qJbzgE,3010
113
113
  prediction_market_agent_tooling/tools/tavily/tavily_models.py,sha256=5ldQs1pZe6uJ5eDAuP4OLpzmcqYShlIV67kttNFvGS0,342
114
114
  prediction_market_agent_tooling/tools/tavily/tavily_search.py,sha256=pPs0qZNfJ7G-1ajfz0iaWOBQyiC0TbcShfrW8T39jtg,3859
115
- prediction_market_agent_tooling/tools/tokens/auto_deposit.py,sha256=ZKGJPoRhch7QVDkZ_5HbBM1si-BKiWyrfuePRh51wqo,6777
116
- prediction_market_agent_tooling/tools/tokens/auto_withdraw.py,sha256=nV9jSUt1ydceDj03cTwdyrJs8kFGqz9z6YcvTVUaNg4,2682
115
+ prediction_market_agent_tooling/tools/tokens/auto_deposit.py,sha256=MWIRHYCN-7o2uawEBwnBNhlzme1kLyX_5Q2zg7UIegQ,6700
116
+ prediction_market_agent_tooling/tools/tokens/auto_withdraw.py,sha256=22g0SIVmLlgITpdt3kPhJOw0sU4OPeBuYk_7xCrQr9U,2491
117
117
  prediction_market_agent_tooling/tools/tokens/main_token.py,sha256=1rbwpdCusPgQIVFuo3m00nBZ_b2lCAoFVm67i-YDcEw,812
118
118
  prediction_market_agent_tooling/tools/tokens/token_utils.py,sha256=zwV-jGFkPJu4-IslXOUqnsNQjzh_9CrfkruDQL0dq0c,1381
119
119
  prediction_market_agent_tooling/tools/tokens/usd.py,sha256=l4vPemtF6Zcwh8HNXH3-L5k7OE_XolbklzBsTpFruW8,3116
120
120
  prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
121
121
  prediction_market_agent_tooling/tools/utils.py,sha256=1xsyBBJfiEdSoMlceB2F8o2sCb6Z8-qNz11pEJFrdyE,6566
122
122
  prediction_market_agent_tooling/tools/web3_utils.py,sha256=eYCc1iWAVtqDKUPTwnMUHuYolPdwh_OTiM3-AdRgDp4,12198
123
- prediction_market_agent_tooling-0.62.0.dev490.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
124
- prediction_market_agent_tooling-0.62.0.dev490.dist-info/METADATA,sha256=QXEPne_UD36t4P1ZD9N0bTdv8U0DceB4xBtDnrwjmz4,8696
125
- prediction_market_agent_tooling-0.62.0.dev490.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
126
- prediction_market_agent_tooling-0.62.0.dev490.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
127
- prediction_market_agent_tooling-0.62.0.dev490.dist-info/RECORD,,
123
+ prediction_market_agent_tooling-0.62.0.dev491.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
124
+ prediction_market_agent_tooling-0.62.0.dev491.dist-info/METADATA,sha256=ke5Gwr94EoF5Ng4zCSmSZ82erv0TIiILRsXBE3IcyT8,8696
125
+ prediction_market_agent_tooling-0.62.0.dev491.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
126
+ prediction_market_agent_tooling-0.62.0.dev491.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
127
+ prediction_market_agent_tooling-0.62.0.dev491.dist-info/RECORD,,