Refactor place_limit_order to remove expiration handling and simplify order placement

This commit is contained in:
Nawaz Haider
2026-01-06 18:56:29 +06:00
parent bf1c3515c0
commit 1de0ebd22e
+3 -11
View File
@@ -44,26 +44,18 @@ async def place_anchor_and_hedge(
)
async def place_limit_order(token_id: str, price: float, size: int, expire=False):
async def place_limit_order(token_id: str, price: float, size: int):
client = get_client()
expiration = 0
if expire:
one_minute = 60
desired_seconds = 5
expiration = int(time.time()) + one_minute + desired_seconds
try:
try:
order_args = OrderArgs(
token_id=token_id,
price=price,
size=size,
side=BUY,
expiration=expiration,
)
signed_order = client.create_order(order_args)
response = client.post_order(
signed_order, OrderType.GTD if expire else OrderType.GTC
)
response = client.post_order(signed_order)
logger.info(
f"Placed limit order: Token ID={token_id}, Price={price}, Size={size}, ID={response['orderID']}"
)