Fixed bug in Account.is_liquidatable - it should have used maintenance health not initial health when deciding an account could be liquidated.

This commit is contained in:
Geoff Taylor 2022-02-01 09:06:46 +00:00
parent 2700c12578
commit c090e7f6dd
1 changed files with 1 additions and 1 deletions

View File

@ -731,7 +731,7 @@ class Account(AddressableAccount):
def is_liquidatable(self, frame: pandas.DataFrame) -> bool: def is_liquidatable(self, frame: pandas.DataFrame) -> bool:
if self.being_liquidated and self.init_health(frame) < 0: if self.being_liquidated and self.init_health(frame) < 0:
return True return True
elif self.init_health(frame) < 0: elif self.maint_health(frame) < 0:
return True return True
return False return False