From 82a47fa4aa0e079f2ad07d091254186288d163e3 Mon Sep 17 00:00:00 2001 From: 0xbigz Date: Tue, 3 May 2022 18:05:47 -0400 Subject: [PATCH] fix assert error --- src/driftpy/clearing_house_user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driftpy/clearing_house_user.py b/src/driftpy/clearing_house_user.py index a2166667..a22d8d9a 100644 --- a/src/driftpy/clearing_house_user.py +++ b/src/driftpy/clearing_house_user.py @@ -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 @@ -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: