Skip to content

Commit

Permalink
fix assert error
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbigz committed May 3, 2022
1 parent a7ce216 commit 82a47fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/driftpy/clearing_house_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def get_user_position(self, market_index: int) -> MarketPosition:
)

async def get_unrealised_pnl(self, market_index: int=None):
assert(market_index is None or int(market_index))
assert(market_index is None or int(market_index) >= 0)
positions_account = await self.get_user_positions_account()

pnl = 0
Expand Down Expand Up @@ -124,7 +124,7 @@ async def get_total_position_value(self):
return value

async def get_position_value(self, market_index: int=None):
assert(market_index is None or int(market_index))
assert(market_index is None or int(market_index) >= 0)
positions_account = await self.get_user_positions_account()
value = 0
for position in positions_account.positions:
Expand Down

0 comments on commit 82a47fa

Please sign in to comment.