@gbozee/ultimate 0.0.2-103 → 0.0.2-105

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.
@@ -1794,6 +1794,7 @@ function computeProfitDetail(payload) {
1794
1794
  loss = Math.abs(reduce_position.entry - sell_price) * reduce_position.quantity;
1795
1795
  const ratio = pnl / loss;
1796
1796
  quantity = to_f(reduce_position.quantity * ratio, decimal_places);
1797
+ expected_loss = to_f(Math.abs(reduce_position.entry - sell_price) * quantity, "%.2f");
1797
1798
  }
1798
1799
  if (reverse_position) {
1799
1800
  expected_loss = Math.abs(reverse_position.avg_price - sell_price) * reverse_position.avg_qty;
package/dist/index.cjs CHANGED
@@ -52004,7 +52004,7 @@ class AppDatabase {
52004
52004
  async getBotViewInstance(payload) {
52005
52005
  const { asset, main_account } = payload;
52006
52006
  const bot_instances = await this.pb.collection("bot_view").getFullList({
52007
- filter: `main_symbol:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
52007
+ filter: `asset:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
52008
52008
  expand: "main_account,secondary_account,main_long_strategy,main_short_strategy,secondary_long_strategy,secondary_short_strategy"
52009
52009
  });
52010
52010
  if (bot_instances.length > 0) {
@@ -52017,6 +52017,17 @@ class AppDatabase {
52017
52017
  secondary_long_strategy,
52018
52018
  secondary_short_strategy
52019
52019
  } = instance.expand;
52020
+ const update_boolean = (value) => {
52021
+ if (!value) {
52022
+ return value;
52023
+ }
52024
+ return {
52025
+ ...value,
52026
+ follow: Boolean(value.follow),
52027
+ place_tp: Boolean(value.place_tp),
52028
+ pause_tp: Boolean(value.pause_tp)
52029
+ };
52030
+ };
52020
52031
  return {
52021
52032
  ...instance,
52022
52033
  main: {
@@ -52029,6 +52040,10 @@ class AppDatabase {
52029
52040
  position: {
52030
52041
  long: instance.main_long_position,
52031
52042
  short: instance.main_short_position
52043
+ },
52044
+ config: {
52045
+ long: update_boolean(instance.main_long_config),
52046
+ short: update_boolean(instance.main_short_config)
52032
52047
  }
52033
52048
  },
52034
52049
  secondary: {
@@ -52041,6 +52056,10 @@ class AppDatabase {
52041
52056
  position: {
52042
52057
  long: instance.secondary_long_position,
52043
52058
  short: instance.secondary_short_position
52059
+ },
52060
+ config: {
52061
+ long: update_boolean(instance.secondary_long_config),
52062
+ short: update_boolean(instance.secondary_short_config)
52044
52063
  }
52045
52064
  }
52046
52065
  };
@@ -53967,6 +53986,7 @@ function computeProfitDetail(payload) {
53967
53986
  loss = Math.abs(reduce_position.entry - sell_price) * reduce_position.quantity;
53968
53987
  const ratio = pnl / loss;
53969
53988
  quantity = to_f2(reduce_position.quantity * ratio, decimal_places);
53989
+ expected_loss = to_f2(Math.abs(reduce_position.entry - sell_price) * quantity, "%.2f");
53970
53990
  }
53971
53991
  if (reverse_position) {
53972
53992
  expected_loss = Math.abs(reverse_position.avg_price - sell_price) * reverse_position.avg_qty;
package/dist/index.js CHANGED
@@ -51956,7 +51956,7 @@ class AppDatabase {
51956
51956
  async getBotViewInstance(payload) {
51957
51957
  const { asset, main_account } = payload;
51958
51958
  const bot_instances = await this.pb.collection("bot_view").getFullList({
51959
- filter: `main_symbol:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
51959
+ filter: `asset:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
51960
51960
  expand: "main_account,secondary_account,main_long_strategy,main_short_strategy,secondary_long_strategy,secondary_short_strategy"
51961
51961
  });
51962
51962
  if (bot_instances.length > 0) {
@@ -51969,6 +51969,17 @@ class AppDatabase {
51969
51969
  secondary_long_strategy,
51970
51970
  secondary_short_strategy
51971
51971
  } = instance.expand;
51972
+ const update_boolean = (value) => {
51973
+ if (!value) {
51974
+ return value;
51975
+ }
51976
+ return {
51977
+ ...value,
51978
+ follow: Boolean(value.follow),
51979
+ place_tp: Boolean(value.place_tp),
51980
+ pause_tp: Boolean(value.pause_tp)
51981
+ };
51982
+ };
51972
51983
  return {
51973
51984
  ...instance,
51974
51985
  main: {
@@ -51981,6 +51992,10 @@ class AppDatabase {
51981
51992
  position: {
51982
51993
  long: instance.main_long_position,
51983
51994
  short: instance.main_short_position
51995
+ },
51996
+ config: {
51997
+ long: update_boolean(instance.main_long_config),
51998
+ short: update_boolean(instance.main_short_config)
51984
51999
  }
51985
52000
  },
51986
52001
  secondary: {
@@ -51993,6 +52008,10 @@ class AppDatabase {
51993
52008
  position: {
51994
52009
  long: instance.secondary_long_position,
51995
52010
  short: instance.secondary_short_position
52011
+ },
52012
+ config: {
52013
+ long: update_boolean(instance.secondary_long_config),
52014
+ short: update_boolean(instance.secondary_short_config)
51996
52015
  }
51997
52016
  }
51998
52017
  };
@@ -53919,6 +53938,7 @@ function computeProfitDetail(payload) {
53919
53938
  loss = Math.abs(reduce_position.entry - sell_price) * reduce_position.quantity;
53920
53939
  const ratio = pnl / loss;
53921
53940
  quantity = to_f2(reduce_position.quantity * ratio, decimal_places);
53941
+ expected_loss = to_f2(Math.abs(reduce_position.entry - sell_price) * quantity, "%.2f");
53922
53942
  }
53923
53943
  if (reverse_position) {
53924
53944
  expected_loss = Math.abs(reverse_position.avg_price - sell_price) * reverse_position.avg_qty;
@@ -58712,7 +58712,7 @@ class AppDatabase {
58712
58712
  async getBotViewInstance(payload) {
58713
58713
  const { asset, main_account } = payload;
58714
58714
  const bot_instances = await this.pb.collection("bot_view").getFullList({
58715
- filter: `main_symbol:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
58715
+ filter: `asset:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
58716
58716
  expand: "main_account,secondary_account,main_long_strategy,main_short_strategy,secondary_long_strategy,secondary_short_strategy"
58717
58717
  });
58718
58718
  if (bot_instances.length > 0) {
@@ -58725,6 +58725,17 @@ class AppDatabase {
58725
58725
  secondary_long_strategy,
58726
58726
  secondary_short_strategy
58727
58727
  } = instance.expand;
58728
+ const update_boolean = (value) => {
58729
+ if (!value) {
58730
+ return value;
58731
+ }
58732
+ return {
58733
+ ...value,
58734
+ follow: Boolean(value.follow),
58735
+ place_tp: Boolean(value.place_tp),
58736
+ pause_tp: Boolean(value.pause_tp)
58737
+ };
58738
+ };
58728
58739
  return {
58729
58740
  ...instance,
58730
58741
  main: {
@@ -58737,6 +58748,10 @@ class AppDatabase {
58737
58748
  position: {
58738
58749
  long: instance.main_long_position,
58739
58750
  short: instance.main_short_position
58751
+ },
58752
+ config: {
58753
+ long: update_boolean(instance.main_long_config),
58754
+ short: update_boolean(instance.main_short_config)
58740
58755
  }
58741
58756
  },
58742
58757
  secondary: {
@@ -58749,6 +58764,10 @@ class AppDatabase {
58749
58764
  position: {
58750
58765
  long: instance.secondary_long_position,
58751
58766
  short: instance.secondary_short_position
58767
+ },
58768
+ config: {
58769
+ long: update_boolean(instance.secondary_long_config),
58770
+ short: update_boolean(instance.secondary_short_config)
58752
58771
  }
58753
58772
  }
58754
58773
  };
@@ -60655,6 +60674,7 @@ function computeProfitDetail(payload) {
60655
60674
  loss = Math.abs(reduce_position.entry - sell_price) * reduce_position.quantity;
60656
60675
  const ratio = pnl / loss;
60657
60676
  quantity = to_f2(reduce_position.quantity * ratio, decimal_places);
60677
+ expected_loss = to_f2(Math.abs(reduce_position.entry - sell_price) * quantity, "%.2f");
60658
60678
  }
60659
60679
  if (reverse_position) {
60660
60680
  expected_loss = Math.abs(reverse_position.avg_price - sell_price) * reverse_position.avg_qty;
@@ -58689,7 +58689,7 @@ class AppDatabase {
58689
58689
  async getBotViewInstance(payload) {
58690
58690
  const { asset, main_account } = payload;
58691
58691
  const bot_instances = await this.pb.collection("bot_view").getFullList({
58692
- filter: `main_symbol:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
58692
+ filter: `asset:lower="${asset.toLowerCase()}" && main_account.owner:lower="${main_account.owner.toLowerCase()}" && main_account.exchange:lower="${main_account.exchange.toLowerCase()}"`,
58693
58693
  expand: "main_account,secondary_account,main_long_strategy,main_short_strategy,secondary_long_strategy,secondary_short_strategy"
58694
58694
  });
58695
58695
  if (bot_instances.length > 0) {
@@ -58702,6 +58702,17 @@ class AppDatabase {
58702
58702
  secondary_long_strategy,
58703
58703
  secondary_short_strategy
58704
58704
  } = instance.expand;
58705
+ const update_boolean = (value) => {
58706
+ if (!value) {
58707
+ return value;
58708
+ }
58709
+ return {
58710
+ ...value,
58711
+ follow: Boolean(value.follow),
58712
+ place_tp: Boolean(value.place_tp),
58713
+ pause_tp: Boolean(value.pause_tp)
58714
+ };
58715
+ };
58705
58716
  return {
58706
58717
  ...instance,
58707
58718
  main: {
@@ -58714,6 +58725,10 @@ class AppDatabase {
58714
58725
  position: {
58715
58726
  long: instance.main_long_position,
58716
58727
  short: instance.main_short_position
58728
+ },
58729
+ config: {
58730
+ long: update_boolean(instance.main_long_config),
58731
+ short: update_boolean(instance.main_short_config)
58717
58732
  }
58718
58733
  },
58719
58734
  secondary: {
@@ -58726,6 +58741,10 @@ class AppDatabase {
58726
58741
  position: {
58727
58742
  long: instance.secondary_long_position,
58728
58743
  short: instance.secondary_short_position
58744
+ },
58745
+ config: {
58746
+ long: update_boolean(instance.secondary_long_config),
58747
+ short: update_boolean(instance.secondary_short_config)
58729
58748
  }
58730
58749
  }
58731
58750
  };
@@ -60632,6 +60651,7 @@ function computeProfitDetail(payload) {
60632
60651
  loss = Math.abs(reduce_position.entry - sell_price) * reduce_position.quantity;
60633
60652
  const ratio = pnl / loss;
60634
60653
  quantity = to_f2(reduce_position.quantity * ratio, decimal_places);
60654
+ expected_loss = to_f2(Math.abs(reduce_position.entry - sell_price) * quantity, "%.2f");
60635
60655
  }
60636
60656
  if (reverse_position) {
60637
60657
  expected_loss = Math.abs(reverse_position.avg_price - sell_price) * reverse_position.avg_qty;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-103",
4
+ "version": "0.0.2-105",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",