Skip to content

Commit

Permalink
drift_user.py: fix get_spot_liq_price
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbigz committed Sep 25, 2024
1 parent 5782e91 commit 3e71684
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/driftpy/drift_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,9 @@ def get_spot_liq_price(
return -1

total_collateral = self.get_total_collateral(MarginCategory.MAINTENANCE)
maintenance_margin_requirement = self.get_maintenance_margin_requirement()
maintenance_margin_requirement = self.get_margin_requirement(
MarginCategory.MAINTENANCE, None
)
free_collateral = max(0, total_collateral - maintenance_margin_requirement)

market = self.drift_client.get_spot_market_account(market_index)
Expand Down

0 comments on commit 3e71684

Please sign in to comment.