Skip to content

Commit

Permalink
[PFT-1423] Fix canBeSettled comparison operators (#72)
Browse files Browse the repository at this point in the history
* Fix canBeSettled function comparison operator

* 1.0.10
  • Loading branch information
sudeepb02 authored Aug 1, 2024
1 parent c1ca1e3 commit 6ea2cb0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@parifi/sdk",
"version": "1.0.9",
"version": "1.0.10",
"description": "Parifi SDK with common utility functions",
"files": [
"dist",
Expand Down
4 changes: 2 additions & 2 deletions src/core/order-manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ export const canBeSettled = (
// If its a limit order, check if the limit price is reached, either above or below
// depending on the triggerAbove flag
if (
(triggerAbove && normalizedMarketPrice < expectedPrice) ||
(!triggerAbove && normalizedMarketPrice > expectedPrice)
(triggerAbove && normalizedMarketPrice.lessThan(expectedPrice)) ||
(!triggerAbove && normalizedMarketPrice.greaterThan(expectedPrice))
) {
console.log('Order cannot be settled because of Trigger price');
return false;
Expand Down
3 changes: 1 addition & 2 deletions test/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const TEST_POSITION_ID3 = '0xe85f118865dfdae84a450360d6e0c3e601218f312a0a
export const TEST_POSITION_ID4 = '0xa1f496b9eecc3e711a3cc741ba3d34abfdebdb73e6fb3ff5ef187196350177dc';
export const TEST_OPEN_POSITION = '0xa9a3ba329fce666f22682ad894a0031c2cb44d62451a1a52b67df0857175b547';


export const TEST_USER_ID1 = '0x850cf0ff7b0bf01255ddfce1d3dc4e1cbfeaf5af';
export const TEST_USER_ID2 = '0xc1f0bece556740a73f125ea147e50df2563e1930';
export const TEST_USER_ID3 = '0x5c2ef2fe205b23d136d3f175e8d3c497739ded9b';
Expand All @@ -22,7 +21,7 @@ export const TEST_MARKET_ID2 = '0xe33d34b772e09eed4d2a620ab1885c3b662d1d4a9f48a8
export const TEST_VAULT_ID1 = '0xd979e6d8a05ef11b185d2df3d76175eecae522af';
export const TEST_VAULT_ID2 = '0xbf11ac635fe97430b5333018778d0d746f67c989';

export const TEST_SETTLE_ORDER_ID = '0xb3beb3c6feb764cd106a802e8e16e7be881aeb688643ccfd02c3df4fb164a5c5';
export const TEST_SETTLE_ORDER_ID = '0xfafdcfb0f2cfd1be004404823022748072f9d128310627111b8aa1c4ab09935c';
export const TEST_LIQUIDATE_POS_ID = '0xa4a5c1bb7a5fceb4c22586808907e2db387d4736be80ac31db79a2f98b9fd087';

export const TEST_PRICE_ID_1 = '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace';
Expand Down

0 comments on commit 6ea2cb0

Please sign in to comment.