@gbozee/ultimate 0.0.2-127 → 0.0.2-129

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
@@ -59960,7 +59960,7 @@ class ExchangeAccount {
59960
59960
  const focus_position = positions.find((k) => {
59961
59961
  let condition = Boolean(k.expand?.account_strategy);
59962
59962
  if (kind) {
59963
- condition = condition && k.kind === kind;
59963
+ condition = k.kind === kind;
59964
59964
  }
59965
59965
  return condition;
59966
59966
  });
@@ -59970,7 +59970,7 @@ class ExchangeAccount {
59970
59970
  const reverse_kind = focus_position.kind === "long" ? "short" : "long";
59971
59971
  const reverse_position = positions.find((k) => k.kind === reverse_kind);
59972
59972
  const strategy2 = focus_position?.expand?.account_strategy;
59973
- const target_pnl = Math.abs(focus_position.take_profit - focus_position.entry) * focus_position.quantity;
59973
+ const target_pnl = Math.abs(focus_position.tp.price - focus_position.entry) * focus_position.quantity;
59974
59974
  return computeProfitDetail({
59975
59975
  focus_position: {
59976
59976
  kind: focus_position.kind,
@@ -60353,6 +60353,7 @@ class App {
60353
60353
  } = payload;
60354
60354
  const main_exchange_account = await this.getExchangeAccount(main_account);
60355
60355
  const reduce_exchange_account = await this.getExchangeAccount(reduce_account);
60356
+ const reverse_kind = kind === "long" ? "short" : "long";
60356
60357
  const reduce_position = await reduce_exchange_account.syncAccount({
60357
60358
  symbol: reduce_account.symbol,
60358
60359
  kind,
@@ -60361,7 +60362,7 @@ class App {
60361
60362
  const result = await main_exchange_account.getSellPriceFromStrategy({
60362
60363
  symbol: main_account.symbol,
60363
60364
  reduce_position,
60364
- kind: main_account.kind
60365
+ kind: main_account.kind || reverse_kind
60365
60366
  });
60366
60367
  if (place) {
60367
60368
  if (cancel_limit) {
package/dist/index.d.ts CHANGED
@@ -124,6 +124,10 @@ export interface PositionsView {
124
124
  follow?: boolean | 1 | 0;
125
125
  current_price?: number;
126
126
  usd_balance?: number;
127
+ tp?: {
128
+ price: number;
129
+ quantity: number;
130
+ };
127
131
  }
128
132
  export interface BullishMarket extends RecordModel {
129
133
  id: string;
package/dist/index.js CHANGED
@@ -59910,7 +59910,7 @@ class ExchangeAccount {
59910
59910
  const focus_position = positions.find((k) => {
59911
59911
  let condition = Boolean(k.expand?.account_strategy);
59912
59912
  if (kind) {
59913
- condition = condition && k.kind === kind;
59913
+ condition = k.kind === kind;
59914
59914
  }
59915
59915
  return condition;
59916
59916
  });
@@ -59920,7 +59920,7 @@ class ExchangeAccount {
59920
59920
  const reverse_kind = focus_position.kind === "long" ? "short" : "long";
59921
59921
  const reverse_position = positions.find((k) => k.kind === reverse_kind);
59922
59922
  const strategy2 = focus_position?.expand?.account_strategy;
59923
- const target_pnl = Math.abs(focus_position.take_profit - focus_position.entry) * focus_position.quantity;
59923
+ const target_pnl = Math.abs(focus_position.tp.price - focus_position.entry) * focus_position.quantity;
59924
59924
  return computeProfitDetail({
59925
59925
  focus_position: {
59926
59926
  kind: focus_position.kind,
@@ -60303,6 +60303,7 @@ class App {
60303
60303
  } = payload;
60304
60304
  const main_exchange_account = await this.getExchangeAccount(main_account);
60305
60305
  const reduce_exchange_account = await this.getExchangeAccount(reduce_account);
60306
+ const reverse_kind = kind === "long" ? "short" : "long";
60306
60307
  const reduce_position = await reduce_exchange_account.syncAccount({
60307
60308
  symbol: reduce_account.symbol,
60308
60309
  kind,
@@ -60311,7 +60312,7 @@ class App {
60311
60312
  const result = await main_exchange_account.getSellPriceFromStrategy({
60312
60313
  symbol: main_account.symbol,
60313
60314
  reduce_position,
60314
- kind: main_account.kind
60315
+ kind: main_account.kind || reverse_kind
60315
60316
  });
60316
60317
  if (place) {
60317
60318
  if (cancel_limit) {
@@ -66638,7 +66638,7 @@ class ExchangeAccount {
66638
66638
  const focus_position = positions.find((k) => {
66639
66639
  let condition = Boolean(k.expand?.account_strategy);
66640
66640
  if (kind) {
66641
- condition = condition && k.kind === kind;
66641
+ condition = k.kind === kind;
66642
66642
  }
66643
66643
  return condition;
66644
66644
  });
@@ -66648,7 +66648,7 @@ class ExchangeAccount {
66648
66648
  const reverse_kind = focus_position.kind === "long" ? "short" : "long";
66649
66649
  const reverse_position = positions.find((k) => k.kind === reverse_kind);
66650
66650
  const strategy2 = focus_position?.expand?.account_strategy;
66651
- const target_pnl = Math.abs(focus_position.take_profit - focus_position.entry) * focus_position.quantity;
66651
+ const target_pnl = Math.abs(focus_position.tp.price - focus_position.entry) * focus_position.quantity;
66652
66652
  return computeProfitDetail({
66653
66653
  focus_position: {
66654
66654
  kind: focus_position.kind,
@@ -67031,6 +67031,7 @@ class App {
67031
67031
  } = payload;
67032
67032
  const main_exchange_account = await this.getExchangeAccount(main_account);
67033
67033
  const reduce_exchange_account = await this.getExchangeAccount(reduce_account);
67034
+ const reverse_kind = kind === "long" ? "short" : "long";
67034
67035
  const reduce_position = await reduce_exchange_account.syncAccount({
67035
67036
  symbol: reduce_account.symbol,
67036
67037
  kind,
@@ -67039,7 +67040,7 @@ class App {
67039
67040
  const result = await main_exchange_account.getSellPriceFromStrategy({
67040
67041
  symbol: main_account.symbol,
67041
67042
  reduce_position,
67042
- kind: main_account.kind
67043
+ kind: main_account.kind || reverse_kind
67043
67044
  });
67044
67045
  if (place) {
67045
67046
  if (cancel_limit) {
@@ -66615,7 +66615,7 @@ class ExchangeAccount {
66615
66615
  const focus_position = positions.find((k) => {
66616
66616
  let condition = Boolean(k.expand?.account_strategy);
66617
66617
  if (kind) {
66618
- condition = condition && k.kind === kind;
66618
+ condition = k.kind === kind;
66619
66619
  }
66620
66620
  return condition;
66621
66621
  });
@@ -66625,7 +66625,7 @@ class ExchangeAccount {
66625
66625
  const reverse_kind = focus_position.kind === "long" ? "short" : "long";
66626
66626
  const reverse_position = positions.find((k) => k.kind === reverse_kind);
66627
66627
  const strategy2 = focus_position?.expand?.account_strategy;
66628
- const target_pnl = Math.abs(focus_position.take_profit - focus_position.entry) * focus_position.quantity;
66628
+ const target_pnl = Math.abs(focus_position.tp.price - focus_position.entry) * focus_position.quantity;
66629
66629
  return computeProfitDetail({
66630
66630
  focus_position: {
66631
66631
  kind: focus_position.kind,
@@ -67008,6 +67008,7 @@ class App {
67008
67008
  } = payload;
67009
67009
  const main_exchange_account = await this.getExchangeAccount(main_account);
67010
67010
  const reduce_exchange_account = await this.getExchangeAccount(reduce_account);
67011
+ const reverse_kind = kind === "long" ? "short" : "long";
67011
67012
  const reduce_position = await reduce_exchange_account.syncAccount({
67012
67013
  symbol: reduce_account.symbol,
67013
67014
  kind,
@@ -67016,7 +67017,7 @@ class App {
67016
67017
  const result = await main_exchange_account.getSellPriceFromStrategy({
67017
67018
  symbol: main_account.symbol,
67018
67019
  reduce_position,
67019
- kind: main_account.kind
67020
+ kind: main_account.kind || reverse_kind
67020
67021
  });
67021
67022
  if (place) {
67022
67023
  if (cancel_limit) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-127",
4
+ "version": "0.0.2-129",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",