From 991c86f7e67659e5320551f45fa5b52d10a8cf3c Mon Sep 17 00:00:00 2001 From: tom-Kc Date: Sat, 8 Jul 2017 00:20:57 +0700 Subject: [PATCH] fixed function marketSideEquals this function is not used but I think the comparisons were off --- src/common/models.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/models.ts b/src/common/models.ts index 2d1ed8586..9c5b34f74 100644 --- a/src/common/models.ts +++ b/src/common/models.ts @@ -33,7 +33,7 @@ export class GatewayMarketTrade implements ITimestamped { export function marketSideEquals(t: MarketSide, other: MarketSide, tol?: number) { tol = tol || 1e-4; if (other == null) return false; - return Math.abs(t.price - other.price) > tol && Math.abs(t.size - other.size) > tol; + return Math.abs(t.price - other.price) < tol && Math.abs(t.size - other.size) < tol; } export class Market implements ITimestamped { @@ -352,4 +352,4 @@ export class TargetBasePositionValue { export class CancelAllOrdersRequest { constructor() {} -} \ No newline at end of file +}