@gbozee/ultimate 0.0.2-46 → 0.0.2-48

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -54806,8 +54806,8 @@ function build_reduce_config(payload) {
54806
54806
  owner: account.owner,
54807
54807
  exchange: account.exchange,
54808
54808
  not_reduce,
54809
- reduce_ratio_long: long_position?.reduce_ratio || 0.9,
54810
- reduce_ratio_short: short_position?.reduce_ratio || 0.9,
54809
+ reduce_ratio_long: long_position?.reduce_ratio || 0,
54810
+ reduce_ratio_short: short_position?.reduce_ratio || 0,
54811
54811
  use_full_long: long_position?.use_full || false,
54812
54812
  use_full_short: short_position?.use_full || false
54813
54813
  };
@@ -56487,16 +56487,16 @@ class ExchangeAccount {
56487
56487
  }
56488
56488
  });
56489
56489
  if (!kind) {
56490
- await this.updateTargetPnl({
56490
+ await this.updateConfigPnl({
56491
56491
  symbol,
56492
56492
  kind: "long"
56493
56493
  });
56494
- await this.updateTargetPnl({
56494
+ await this.updateConfigPnl({
56495
56495
  symbol,
56496
56496
  kind: "short"
56497
56497
  });
56498
56498
  } else {
56499
- await this.updateTargetPnl({
56499
+ await this.updateConfigPnl({
56500
56500
  symbol,
56501
56501
  kind
56502
56502
  });
@@ -56696,7 +56696,14 @@ class ExchangeAccount {
56696
56696
  if (!focus_position.follow) {
56697
56697
  return "No follow set";
56698
56698
  }
56699
- if (track_position.quantity !== focus_position.quantity && focus_position.quantity < track_position.quantity) {
56699
+ let should_place_order = false;
56700
+ if (focus_position.threshold_qty === 0) {
56701
+ should_place_order = true;
56702
+ }
56703
+ if (focus_position.threshold_qty > 0 && track_position.quantity >= focus_position.threshold_qty) {
56704
+ should_place_order = true;
56705
+ }
56706
+ if (track_position.quantity !== focus_position.quantity && focus_position.quantity < track_position.quantity && should_place_order) {
56700
56707
  const remaining_quantity = Math.abs(track_position.quantity - focus_position.quantity);
56701
56708
  await this.placeMarketOrder({
56702
56709
  symbol,
@@ -57477,7 +57484,7 @@ class ExchangeAccount {
57477
57484
  live_refresh: true,
57478
57485
  update: true
57479
57486
  });
57480
- await this.updateTargetPnl({
57487
+ await this.updateConfigPnl({
57481
57488
  symbol,
57482
57489
  kind
57483
57490
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-46",
4
+ "version": "0.0.2-48",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",