@gbozee/ultimate 0.0.2-62 → 0.0.2-64

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/dist/index.cjs CHANGED
@@ -55678,7 +55678,9 @@ function build_reduce_config(payload) {
55678
55678
  short_minimum_pnl = 0.0001,
55679
55679
  long_minimum_pnl = 0.0001,
55680
55680
  not_reduce = false,
55681
- _positions
55681
+ _positions,
55682
+ long_config,
55683
+ short_config
55682
55684
  } = payload;
55683
55685
  const long_position = _positions.find((x) => x.kind === "long");
55684
55686
  const short_position = _positions.find((x) => x.kind === "short");
@@ -55693,10 +55695,10 @@ function build_reduce_config(payload) {
55693
55695
  owner: account.owner,
55694
55696
  exchange: account.exchange,
55695
55697
  not_reduce,
55696
- reduce_ratio_long: long_position?.reduce_ratio || 0,
55697
- reduce_ratio_short: short_position?.reduce_ratio || 0,
55698
- use_full_long: long_position?.use_full || false,
55699
- use_full_short: short_position?.use_full || false
55698
+ reduce_ratio_long: long_config?.reduce_ratio || 0,
55699
+ reduce_ratio_short: short_config?.reduce_ratio || 0,
55700
+ use_full_long: long_config?.use_full || long_position?.use_full || false,
55701
+ use_full_short: short_config?.use_full || short_position?.use_full || false
55700
55702
  };
55701
55703
  }
55702
55704
  function calculate_avg_entry2(kind, {
@@ -56432,7 +56434,7 @@ class ExchangeAccount {
56432
56434
  symbol,
56433
56435
  long_position: active_account.position.long,
56434
56436
  short_position: active_account.position.short,
56435
- usd_balance: active_account.usd_balance || 0
56437
+ usd_balance: active_account.balance || 0
56436
56438
  });
56437
56439
  await this.syncOrders({
56438
56440
  symbol,
@@ -56941,7 +56943,9 @@ class ExchangeAccount {
56941
56943
  const config2 = build_reduce_config({
56942
56944
  account: this.instance,
56943
56945
  symbol: payload.symbol,
56944
- _positions: positions
56946
+ _positions: positions,
56947
+ long_config,
56948
+ short_config
56945
56949
  });
56946
56950
  let long_target_pnl = payload.kind == "long" ? payload.target_pnl : 0;
56947
56951
  let short_target_pnl = payload.kind == "short" ? payload.target_pnl : 0;
package/dist/index.js CHANGED
@@ -55636,7 +55636,9 @@ function build_reduce_config(payload) {
55636
55636
  short_minimum_pnl = 0.0001,
55637
55637
  long_minimum_pnl = 0.0001,
55638
55638
  not_reduce = false,
55639
- _positions
55639
+ _positions,
55640
+ long_config,
55641
+ short_config
55640
55642
  } = payload;
55641
55643
  const long_position = _positions.find((x) => x.kind === "long");
55642
55644
  const short_position = _positions.find((x) => x.kind === "short");
@@ -55651,10 +55653,10 @@ function build_reduce_config(payload) {
55651
55653
  owner: account.owner,
55652
55654
  exchange: account.exchange,
55653
55655
  not_reduce,
55654
- reduce_ratio_long: long_position?.reduce_ratio || 0,
55655
- reduce_ratio_short: short_position?.reduce_ratio || 0,
55656
- use_full_long: long_position?.use_full || false,
55657
- use_full_short: short_position?.use_full || false
55656
+ reduce_ratio_long: long_config?.reduce_ratio || 0,
55657
+ reduce_ratio_short: short_config?.reduce_ratio || 0,
55658
+ use_full_long: long_config?.use_full || long_position?.use_full || false,
55659
+ use_full_short: short_config?.use_full || short_position?.use_full || false
55658
55660
  };
55659
55661
  }
55660
55662
  function calculate_avg_entry2(kind, {
@@ -56390,7 +56392,7 @@ class ExchangeAccount {
56390
56392
  symbol,
56391
56393
  long_position: active_account.position.long,
56392
56394
  short_position: active_account.position.short,
56393
- usd_balance: active_account.usd_balance || 0
56395
+ usd_balance: active_account.balance || 0
56394
56396
  });
56395
56397
  await this.syncOrders({
56396
56398
  symbol,
@@ -56899,7 +56901,9 @@ class ExchangeAccount {
56899
56901
  const config2 = build_reduce_config({
56900
56902
  account: this.instance,
56901
56903
  symbol: payload.symbol,
56902
- _positions: positions
56904
+ _positions: positions,
56905
+ long_config,
56906
+ short_config
56903
56907
  });
56904
56908
  let long_target_pnl = payload.kind == "long" ? payload.target_pnl : 0;
56905
56909
  let short_target_pnl = payload.kind == "short" ? payload.target_pnl : 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-62",
4
+ "version": "0.0.2-64",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",