@gainsnetwork/sdk 0.2.57-rc1 → 0.2.58-rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,6 @@ import { Fee, LiquidationParams, Trade, TradeInfo, TradeInitialAccFees } from ".
3
3
  import { ContractsVersion } from "../contracts/types";
4
4
  export type GetPnlContext = GetBorrowingFeeContext & {
5
5
  fee: Fee | undefined;
6
- maxGainP: number | undefined;
7
6
  collateralPriceUsd: number | undefined;
8
7
  contractsVersion: ContractsVersion | undefined;
9
8
  feeMultiplier: number | undefined;
package/lib/trade/pnl.js CHANGED
@@ -9,12 +9,10 @@ const getPnl = (price, trade, tradeInfo, initialAccFees, liquidationParams, useF
9
9
  }
10
10
  const posCollat = trade.collateralAmount;
11
11
  const { openPrice, leverage } = trade;
12
- const { maxGainP, fee } = context;
13
- const maxGain = maxGainP === undefined ? Infinity : (maxGainP / 100) * posCollat;
12
+ const { fee } = context;
14
13
  let pnlCollat = trade.long
15
14
  ? ((price - openPrice) / openPrice) * leverage * posCollat
16
15
  : ((openPrice - price) / openPrice) * leverage * posCollat;
17
- pnlCollat = pnlCollat > maxGain ? maxGain : pnlCollat;
18
16
  if (useFees) {
19
17
  pnlCollat -= (0, fees_1.getBorrowingFee)(posCollat * trade.leverage, trade.pairIndex, trade.long, initialAccFees, context);
20
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gainsnetwork/sdk",
3
- "version": "0.2.57-rc1",
3
+ "version": "0.2.58-rc1",
4
4
  "description": "Gains Network SDK",
5
5
  "main": "./lib/index.js",
6
6
  "files": [