Skip to content

Commit a7d26e6

Browse files
committed
fix: fixed the position liquidation price calculation in the liquidable positions example script
1 parent 65f0426 commit a7d26e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/chain_client/10_SearchLiquidablePositions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from pyinjective.core.network import Network
66

77
def adjusted_margin(quantity: Decimal, margin: Decimal, is_long: bool, cumulative_funding_entry: Decimal, cumulative_funding: Decimal) -> Decimal:
8-
unrealized_funding_payment = (cumulative_funding - cumulative_funding_entry) * quantity * (1 if is_long else -1)
8+
unrealized_funding_payment = (cumulative_funding - cumulative_funding_entry) * quantity * (-1 if is_long else 1)
99
return margin + unrealized_funding_payment
1010

1111
async def main() -> None:

0 commit comments

Comments
 (0)