prediction-market-agent-tooling 0.62.0.dev472__py3-none-any.whl → 0.62.0.dev474__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.
- prediction_market_agent_tooling/markets/omen/omen.py +4 -0
- prediction_market_agent_tooling/tools/cow/cow_order.py +11 -1
- {prediction_market_agent_tooling-0.62.0.dev472.dist-info → prediction_market_agent_tooling-0.62.0.dev474.dist-info}/METADATA +1 -1
- {prediction_market_agent_tooling-0.62.0.dev472.dist-info → prediction_market_agent_tooling-0.62.0.dev474.dist-info}/RECORD +7 -7
- {prediction_market_agent_tooling-0.62.0.dev472.dist-info → prediction_market_agent_tooling-0.62.0.dev474.dist-info}/LICENSE +0 -0
- {prediction_market_agent_tooling-0.62.0.dev472.dist-info → prediction_market_agent_tooling-0.62.0.dev474.dist-info}/WHEEL +0 -0
- {prediction_market_agent_tooling-0.62.0.dev472.dist-info → prediction_market_agent_tooling-0.62.0.dev474.dist-info}/entry_points.txt +0 -0
@@ -805,6 +805,10 @@ def omen_sell_outcome_tx(
|
|
805
805
|
amount_wei = amount_token.as_wei
|
806
806
|
amount_wei = amount_wei.without_fraction(slippage)
|
807
807
|
|
808
|
+
logger.info(
|
809
|
+
f"Selling asked {amount.value=} {amount.symbol}, converted to {amount_wei.as_token.value=} (collateral token worth) for {outcome=} in market {market.url=}."
|
810
|
+
)
|
811
|
+
|
808
812
|
# Verify, that markets uses conditional tokens that we expect.
|
809
813
|
if (
|
810
814
|
market_contract.conditionalTokens(web3=web3)
|
@@ -31,6 +31,10 @@ from prediction_market_agent_tooling.tools.contract import ContractERC20OnGnosis
|
|
31
31
|
from prediction_market_agent_tooling.tools.utils import utcnow
|
32
32
|
|
33
33
|
|
34
|
+
class OrderStatusError(Exception):
|
35
|
+
pass
|
36
|
+
|
37
|
+
|
34
38
|
def get_order_book_api(env: Envs, chain: Chain) -> OrderBookApi:
|
35
39
|
chain_id = SupportedChainId(chain.value[0])
|
36
40
|
return OrderBookApi(OrderBookAPIConfigFactory.get_config(env, chain_id))
|
@@ -99,6 +103,12 @@ def get_buy_token_amount(
|
|
99
103
|
return Wei(order_quote.quote.buyAmount.root)
|
100
104
|
|
101
105
|
|
106
|
+
@tenacity.retry(
|
107
|
+
stop=tenacity.stop_after_attempt(3),
|
108
|
+
wait=tenacity.wait_fixed(1),
|
109
|
+
retry=tenacity.retry_if_not_exception_type((TimeoutError, OrderStatusError)),
|
110
|
+
after=lambda x: logger.debug(f"swap_tokens_waiting failed, {x.attempt_number=}."),
|
111
|
+
)
|
102
112
|
def swap_tokens_waiting(
|
103
113
|
amount_wei: Wei,
|
104
114
|
sell_token: ChecksumAddress,
|
@@ -159,7 +169,7 @@ async def swap_tokens_waiting_async(
|
|
159
169
|
OrderStatus.cancelled,
|
160
170
|
OrderStatus.expired,
|
161
171
|
):
|
162
|
-
raise
|
172
|
+
raise OrderStatusError(f"Order {order.uid} failed. {order.url}")
|
163
173
|
|
164
174
|
if utcnow() - start_time > timeout:
|
165
175
|
raise TimeoutError(
|
@@ -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=
|
54
|
+
prediction_market_agent_tooling/markets/omen/omen.py,sha256=TNODbUHsQ8VSXH95OPOGkmZhNulWUIEWQwc7wmtb-m8,51767
|
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
|
@@ -87,7 +87,7 @@ prediction_market_agent_tooling/tools/caches/serializers.py,sha256=vFDx4fsPxclXp
|
|
87
87
|
prediction_market_agent_tooling/tools/contract.py,sha256=PJaC_Mc06vowyHD6f4MNQuEfo-h0H-Lh741YzRuemUk,21018
|
88
88
|
prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
|
89
89
|
prediction_market_agent_tooling/tools/cow/cow_manager.py,sha256=ZX6K0ZKMpcgiDsIrv4wtZAPg-LTozIbvOyQFyVgDpMA,3812
|
90
|
-
prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=
|
90
|
+
prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=4BV9t_RZU07SxwAzjTVkXKoQtm9l-roFHJR_cE8O04A,5837
|
91
91
|
prediction_market_agent_tooling/tools/custom_exceptions.py,sha256=Fh8z1fbwONvP4-j7AmV_PuEcoqb6-QXa9PJ9m7guMcM,93
|
92
92
|
prediction_market_agent_tooling/tools/datetime_utc.py,sha256=8_WackjtjC8zHXrhQFTGQ6e6Fz_6llWoKR4CSFvIv9I,2766
|
93
93
|
prediction_market_agent_tooling/tools/db/db_manager.py,sha256=GtzHH1NLl8HwqC8Z7s6eTlIQXuV0blxfaV2PeQrBnfQ,3013
|
@@ -120,8 +120,8 @@ prediction_market_agent_tooling/tools/tokens/usd.py,sha256=FmQUfrkLvN8cI_6vw9QNh
|
|
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.
|
124
|
-
prediction_market_agent_tooling-0.62.0.
|
125
|
-
prediction_market_agent_tooling-0.62.0.
|
126
|
-
prediction_market_agent_tooling-0.62.0.
|
127
|
-
prediction_market_agent_tooling-0.62.0.
|
123
|
+
prediction_market_agent_tooling-0.62.0.dev474.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
124
|
+
prediction_market_agent_tooling-0.62.0.dev474.dist-info/METADATA,sha256=10VgtMIyKALMPagmYlJ0LKO5htx9XmltcIC8tVLt6Bo,8696
|
125
|
+
prediction_market_agent_tooling-0.62.0.dev474.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
126
|
+
prediction_market_agent_tooling-0.62.0.dev474.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
|
127
|
+
prediction_market_agent_tooling-0.62.0.dev474.dist-info/RECORD,,
|
File without changes
|
File without changes
|