Skip to content

Commit

Permalink
Refine Polymarket execution
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Sep 27, 2024
1 parent 734c97d commit d1664de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions nautilus_trader/adapters/polymarket/common/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ class PolymarketEventType(Enum):

@unique
class PolymarketOrderStatus(Enum):
# Order was invalid
INVALID = "INVALID"

# Order placed and live
LIVE = "LIVE"

Expand Down
8 changes: 4 additions & 4 deletions nautilus_trader/adapters/polymarket/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ async def _cancel_order(self, command: CancelOrder) -> None:
instrument_id=order.instrument_id,
client_order_id=order.client_order_id,
venue_order_id=order.venue_order_id,
reason=reason,
reason=str(reason),
ts_event=self._clock.timestamp_ns(),
)

Expand Down Expand Up @@ -602,7 +602,7 @@ async def _batch_cancel_orders(self, command: BatchCancelOrders) -> None:
instrument_id=command.instrument_id,
client_order_id=client_order_id,
venue_order_id=venue_order_id,
reason=reason,
reason=str(reason),
ts_event=self._clock.timestamp_ns(),
)

Expand Down Expand Up @@ -641,7 +641,7 @@ async def _cancel_all_orders(self, command: CancelAllOrders) -> None:
instrument_id=command.instrument_id,
client_order_id=client_order_id,
venue_order_id=venue_order_id,
reason=reason,
reason=str(reason),
ts_event=self._clock.timestamp_ns(),
)

Expand Down Expand Up @@ -719,7 +719,7 @@ async def _submit_order(self, command: SubmitOrder) -> None:
strategy_id=order.strategy_id,
instrument_id=order.instrument_id,
client_order_id=order.client_order_id,
reason=retry_manager.message,
reason=str(retry_manager.message),
ts_event=self._clock.timestamp_ns(),
)
else:
Expand Down

0 comments on commit d1664de

Please sign in to comment.