Skip to content

Commit

Permalink
Quick fix for mark failed trade
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuh25 committed Nov 15, 2024
1 parent f112ef4 commit a88df73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tradeexecutor/state/trade.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ def mark_success(self,
self.executed_collateral_consumption = executed_collateral_consumption

def mark_failed(self, failed_at: datetime.datetime):
assert self.get_status() == TradeStatus.broadcasted
assert self.get_status() in (TradeStatus.broadcasted, TradeStatus.started), f"Cannot mark trade failed if it is not broadcasted or started. Current status: {self.get_status()}"
assert failed_at.tzinfo is None
self.failed_at = failed_at

Expand Down

0 comments on commit a88df73

Please sign in to comment.