Increase retry attempts for hedge order placement and improve logging for order prices

This commit is contained in:
Nawaz Haider
2026-01-03 16:59:06 +06:00
parent 75c1c20316
commit 556dc430e8
+6 -7
View File
@@ -38,19 +38,18 @@ async def place_anchor_and_hedge(
anchor_order_id = await place_limit_order(anchor_token_id, price, size, expire=True)
if PLACE_OPPOSITE_ORDER and anchor_order_id:
for _ in range(10 * 100):
for _ in range(70 * 100):
if in_memory_db_contains_item(anchor_order_id):
hedge_order_id = await place_limit_order(
hedge_token_id, 1 - price - PROFIT_MARGIN, size
)
logger.info(
f"Order prices: {round(price, 2)} and {round(1 - price - PROFIT_MARGIN, 2)}"
)
break
await asyncio.sleep(0.01)
logger.info(f"Order prices: {price} and {1 - price - PROFIT_MARGIN}")
await asyncio.sleep(0.1)
else:
logger.info(f"Order price: {price}")
if anchor_order_id and not in_memory_db_contains_item(anchor_order_id):
logger.info(f"Order price: {price} [Canceled before hedge placement]")
decrement_trades()