prediction-market-agent-tooling 0.63.0.dev509__py3-none-any.whl → 0.63.0.dev512__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/blockchain_utils.py +2 -3
- prediction_market_agent_tooling/tools/cow/cow_order.py +7 -1
- {prediction_market_agent_tooling-0.63.0.dev509.dist-info → prediction_market_agent_tooling-0.63.0.dev512.dist-info}/METADATA +1 -1
- {prediction_market_agent_tooling-0.63.0.dev509.dist-info → prediction_market_agent_tooling-0.63.0.dev512.dist-info}/RECORD +7 -7
- {prediction_market_agent_tooling-0.63.0.dev509.dist-info → prediction_market_agent_tooling-0.63.0.dev512.dist-info}/LICENSE +0 -0
- {prediction_market_agent_tooling-0.63.0.dev509.dist-info → prediction_market_agent_tooling-0.63.0.dev512.dist-info}/WHEEL +0 -0
- {prediction_market_agent_tooling-0.63.0.dev509.dist-info → prediction_market_agent_tooling-0.63.0.dev512.dist-info}/entry_points.txt +0 -0
@@ -39,15 +39,14 @@ def store_trades(
|
|
39
39
|
ipfs_hash_decoded = ipfscidv0_to_byte32(ipfs_hash)
|
40
40
|
|
41
41
|
# tx_hashes must be list of bytes32 (see Solidity contract).
|
42
|
-
# For regular tx hashes that's fine, but for other types of IDs we take the first 32 bytes (orderDigest).
|
43
42
|
tx_hashes = [
|
44
|
-
HexBytes(HexStr(
|
43
|
+
HexBytes(HexStr(i.id)) for i in traded_market.trades if i.id is not None
|
45
44
|
]
|
46
45
|
|
47
46
|
prediction = ContractPrediction(
|
48
47
|
publisher=keys.bet_from_address,
|
49
48
|
ipfs_hash=ipfs_hash_decoded,
|
50
|
-
tx_hashes=tx_hashes,
|
49
|
+
tx_hashes=tx_hashes,
|
51
50
|
estimated_probability_bps=int(traded_market.answer.p_yes * BPS_CONSTANT),
|
52
51
|
)
|
53
52
|
tx_receipt = OmenAgentResultMappingContract().add_prediction(
|
@@ -143,6 +143,12 @@ def get_buy_token_amount_else_raise(
|
|
143
143
|
return Wei(order_quote.quote.buyAmount.root)
|
144
144
|
|
145
145
|
|
146
|
+
@tenacity.retry(
|
147
|
+
stop=stop_after_attempt(3),
|
148
|
+
wait=wait_fixed(1),
|
149
|
+
retry=tenacity.retry_if_not_exception_type((TimeoutError, OrderStatusError)),
|
150
|
+
after=lambda x: logger.debug(f"swap_tokens_waiting failed, {x.attempt_number=}."),
|
151
|
+
)
|
146
152
|
def swap_tokens_waiting(
|
147
153
|
amount_wei: Wei,
|
148
154
|
sell_token: ChecksumAddress,
|
@@ -203,7 +209,7 @@ async def swap_tokens_waiting_async(
|
|
203
209
|
OrderStatus.cancelled,
|
204
210
|
OrderStatus.expired,
|
205
211
|
):
|
206
|
-
raise
|
212
|
+
raise OrderStatusError(f"Order {order.uid} failed. {order.url}")
|
207
213
|
|
208
214
|
if utcnow() - start_time > timeout:
|
209
215
|
raise TimeoutError(
|
@@ -36,7 +36,7 @@ prediction_market_agent_tooling/jobs/omen/omen_jobs.py,sha256=Pf6QxPXGyie-2l_wZU
|
|
36
36
|
prediction_market_agent_tooling/loggers.py,sha256=MvCkQSJL2_0yErNatqr81sJlc4aOgPzDp9VNrIhKUcc,4140
|
37
37
|
prediction_market_agent_tooling/markets/agent_market.py,sha256=1NomilM0GCXcRq_1N_cr2AbSK5ONTowFeRbrhc7V5zE,14929
|
38
38
|
prediction_market_agent_tooling/markets/base_subgraph_handler.py,sha256=7RaYO_4qAmQ6ZGM8oPK2-CkiJfKmV9MxM-rJlduaecU,1971
|
39
|
-
prediction_market_agent_tooling/markets/blockchain_utils.py,sha256=
|
39
|
+
prediction_market_agent_tooling/markets/blockchain_utils.py,sha256=qm21scopQ6dfewkoqQF6lWLDGg2BblsKUdC9aG93Hmc,2249
|
40
40
|
prediction_market_agent_tooling/markets/categorize.py,sha256=jsoHWvZk9pU6n17oWSCcCxNNYVwlb_NXsZxKRI7vmsk,1301
|
41
41
|
prediction_market_agent_tooling/markets/data_models.py,sha256=_R9Hr5zwGLpZLPXq0Jo2wZRNRQyOnSi3WVQJZ81syuk,4541
|
42
42
|
prediction_market_agent_tooling/markets/manifold/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -88,7 +88,7 @@ prediction_market_agent_tooling/tools/caches/inmemory_cache.py,sha256=ZW5iI5rmjq
|
|
88
88
|
prediction_market_agent_tooling/tools/caches/serializers.py,sha256=vFDx4fsPxclXp2q0sv27j4al_M_Tj9aR2JJP-xNHQXA,2151
|
89
89
|
prediction_market_agent_tooling/tools/contract.py,sha256=1ZFp_VoqTjM8cqOfAhco2Ht0DTqakjhZpuZUrAXr28Q,21332
|
90
90
|
prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
|
91
|
-
prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=
|
91
|
+
prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=jWBRF5UdXjlWNn3X8BxcMXSuU3fegoZzz-NXB7sSIt8,6959
|
92
92
|
prediction_market_agent_tooling/tools/custom_exceptions.py,sha256=Fh8z1fbwONvP4-j7AmV_PuEcoqb6-QXa9PJ9m7guMcM,93
|
93
93
|
prediction_market_agent_tooling/tools/datetime_utc.py,sha256=8_WackjtjC8zHXrhQFTGQ6e6Fz_6llWoKR4CSFvIv9I,2766
|
94
94
|
prediction_market_agent_tooling/tools/db/db_manager.py,sha256=GtzHH1NLl8HwqC8Z7s6eTlIQXuV0blxfaV2PeQrBnfQ,3013
|
@@ -121,8 +121,8 @@ prediction_market_agent_tooling/tools/tokens/usd.py,sha256=Qq8ofVCCMX-eo8mDlHv4g
|
|
121
121
|
prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
|
122
122
|
prediction_market_agent_tooling/tools/utils.py,sha256=1xsyBBJfiEdSoMlceB2F8o2sCb6Z8-qNz11pEJFrdyE,6566
|
123
123
|
prediction_market_agent_tooling/tools/web3_utils.py,sha256=eYCc1iWAVtqDKUPTwnMUHuYolPdwh_OTiM3-AdRgDp4,12198
|
124
|
-
prediction_market_agent_tooling-0.63.0.
|
125
|
-
prediction_market_agent_tooling-0.63.0.
|
126
|
-
prediction_market_agent_tooling-0.63.0.
|
127
|
-
prediction_market_agent_tooling-0.63.0.
|
128
|
-
prediction_market_agent_tooling-0.63.0.
|
124
|
+
prediction_market_agent_tooling-0.63.0.dev512.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
125
|
+
prediction_market_agent_tooling-0.63.0.dev512.dist-info/METADATA,sha256=KJkbi1uEguo47ndK7U4zdtPRgM0p8PMv3VEs6GqxjCM,8696
|
126
|
+
prediction_market_agent_tooling-0.63.0.dev512.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
127
|
+
prediction_market_agent_tooling-0.63.0.dev512.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
|
128
|
+
prediction_market_agent_tooling-0.63.0.dev512.dist-info/RECORD,,
|
File without changes
|
File without changes
|