@drift-labs/sdk 2.36.1-beta.3 → 2.36.1-beta.4

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.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.36.1-beta.3
1
+ 2.36.1-beta.4
package/lib/user.js CHANGED
@@ -1089,7 +1089,9 @@ class User {
1089
1089
  .div(numericConstants_1.BASE_PRECISION);
1090
1090
  }
1091
1091
  if (!orderBaseAssetAmount.eq(numericConstants_1.ZERO)) {
1092
- freeCollateralDelta = freeCollateralDelta.sub(marginRatioQuotePrecision);
1092
+ freeCollateralDelta = freeCollateralDelta.sub(marginRatioQuotePrecision
1093
+ .mul(orderBaseAssetAmount.abs())
1094
+ .div(numericConstants_1.BASE_PRECISION));
1093
1095
  }
1094
1096
  return freeCollateralDelta;
1095
1097
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drift-labs/sdk",
3
- "version": "2.36.1-beta.3",
3
+ "version": "2.36.1-beta.4",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "author": "crispheaney",
package/src/user.ts CHANGED
@@ -1974,7 +1974,11 @@ export class User {
1974
1974
  }
1975
1975
 
1976
1976
  if (!orderBaseAssetAmount.eq(ZERO)) {
1977
- freeCollateralDelta = freeCollateralDelta.sub(marginRatioQuotePrecision);
1977
+ freeCollateralDelta = freeCollateralDelta.sub(
1978
+ marginRatioQuotePrecision
1979
+ .mul(orderBaseAssetAmount.abs())
1980
+ .div(BASE_PRECISION)
1981
+ );
1978
1982
  }
1979
1983
 
1980
1984
  return freeCollateralDelta;