@gbozee/ultimate 0.0.2-185 → 0.0.2-187

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.
@@ -455,6 +455,7 @@ export interface CompoundInstance extends BaseSystemFields {
455
455
  position?: string;
456
456
  risk?: number;
457
457
  hedged?: boolean;
458
+ loss?: number;
458
459
  expand?: {
459
460
  ref?: Compounder;
460
461
  };
package/dist/index.cjs CHANGED
@@ -54711,7 +54711,8 @@ class AppDatabase {
54711
54711
  "support",
54712
54712
  "resistance",
54713
54713
  "symbol_config",
54714
- "anchor"
54714
+ "anchor",
54715
+ "watch_instance"
54715
54716
  ];
54716
54717
  return fields.join(", ");
54717
54718
  }
@@ -58722,6 +58723,7 @@ class BaseExchange {
58722
58723
  is_limit: true,
58723
58724
  price_places: payload.price_places,
58724
58725
  decimal_places: payload.decimal_places,
58726
+ hedge: payload.hedge,
58725
58727
  current_price
58726
58728
  });
58727
58729
  }
@@ -58835,6 +58837,7 @@ class BaseExchange {
58835
58837
  kind: payload.kind,
58836
58838
  cancel: true,
58837
58839
  is_limit: true,
58840
+ hedge: payload.hedge,
58838
58841
  price_places: payload.price_places,
58839
58842
  decimal_places: payload.decimal_places,
58840
58843
  current_price
@@ -59485,6 +59488,11 @@ async function placeStopOrder(client, payload) {
59485
59488
  stop: payload.final_stop,
59486
59489
  is_market: !payload.is_limit
59487
59490
  };
59491
+ if (payload.hedge) {
59492
+ let reverse_kind = payload.kind === "long" ? "short" : "long";
59493
+ order.kind = reverse_kind;
59494
+ order.is_market = false;
59495
+ }
59488
59496
  return createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
59489
59497
  }
59490
59498
  async function getOpenOrders(client, symbol, type) {
@@ -61305,7 +61313,8 @@ class ExchangePosition {
61305
61313
  raw: payload.raw,
61306
61314
  use_current,
61307
61315
  stop_percent: config2.stop_percent || 100,
61308
- distribution: config2.distribution
61316
+ distribution: config2.distribution,
61317
+ hedge: payload.hedge
61309
61318
  });
61310
61319
  }
61311
61320
  }
@@ -61402,6 +61411,7 @@ class ExchangePosition {
61402
61411
  stop: payload.stop,
61403
61412
  price_places: app_config.price_places,
61404
61413
  decimal_places: app_config.decimal_places,
61414
+ hedge: payload.hedge,
61405
61415
  place: true
61406
61416
  });
61407
61417
  return result;
@@ -61582,7 +61592,8 @@ class ExchangePosition {
61582
61592
  ignore_config,
61583
61593
  risky,
61584
61594
  limit = true,
61585
- target_pnl
61595
+ target_pnl,
61596
+ hedge
61586
61597
  } = payload;
61587
61598
  if (cancel) {
61588
61599
  await this.cancelOrders({
@@ -61606,7 +61617,8 @@ class ExchangePosition {
61606
61617
  stop,
61607
61618
  ignore_config,
61608
61619
  risky,
61609
- place
61620
+ place,
61621
+ hedge
61610
61622
  });
61611
61623
  }
61612
61624
  await this.updateConfigPnl();
@@ -62327,7 +62339,8 @@ class ExchangeAccount {
62327
62339
  async initializePositions(payload) {
62328
62340
  const raw_positions = await this.syncAccount({
62329
62341
  update: payload.update,
62330
- symbol: payload.symbol
62342
+ symbol: payload.symbol,
62343
+ live_refresh: payload.update
62331
62344
  });
62332
62345
  const positions = await this.syncAccount({
62333
62346
  symbol: payload.symbol,
package/dist/index.d.ts CHANGED
@@ -191,6 +191,7 @@ export interface CompoundInstance extends BaseSystemFields {
191
191
  position?: string;
192
192
  risk?: number;
193
193
  hedged?: boolean;
194
+ loss?: number;
194
195
  expand?: {
195
196
  ref?: Compounder;
196
197
  };
@@ -415,6 +416,7 @@ declare abstract class BaseExchange {
415
416
  stop: number;
416
417
  price_places?: string;
417
418
  decimal_places?: string;
419
+ hedge?: boolean;
418
420
  place?: boolean;
419
421
  }): Promise<any>;
420
422
  bulkPlaceLimitOrders(payload: {
@@ -499,6 +501,7 @@ declare abstract class BaseExchange {
499
501
  cancel?: boolean;
500
502
  is_limit?: boolean;
501
503
  current_price: number;
504
+ hedge?: boolean;
502
505
  }): Promise<any>;
503
506
  placeStopOrder(payload: {
504
507
  symbol: string;
@@ -507,6 +510,7 @@ declare abstract class BaseExchange {
507
510
  kind: "long" | "short";
508
511
  price_places?: string;
509
512
  decimal_places?: string;
513
+ hedge?: boolean;
510
514
  }): Promise<any>;
511
515
  abstract setLeverage(payload: {
512
516
  symbol: string;
@@ -1969,6 +1973,7 @@ export declare class ExchangePosition {
1969
1973
  use_current?: boolean;
1970
1974
  ignore_config?: boolean;
1971
1975
  risky?: boolean;
1976
+ hedge?: boolean;
1972
1977
  }): Promise<any>;
1973
1978
  placeSharedOrder(action: "place_limit_orders" | "place_stop_orders" | "place_tp_orders" | "dangerous_entry_orders", payload: {
1974
1979
  entry: number;
@@ -1981,6 +1986,7 @@ export declare class ExchangePosition {
1981
1986
  use_current?: boolean;
1982
1987
  stop_percent?: number;
1983
1988
  distribution?: GetEntriesParams["distribution"];
1989
+ hedge?: boolean;
1984
1990
  }): Promise<any>;
1985
1991
  buildAppConfig(payload: {
1986
1992
  entry: number;
@@ -2057,6 +2063,7 @@ export declare class ExchangePosition {
2057
2063
  ignore_config?: boolean;
2058
2064
  risky?: boolean;
2059
2065
  target_pnl?: number;
2066
+ hedge?: boolean;
2060
2067
  }): Promise<any>;
2061
2068
  placeStopLimit(payload: {
2062
2069
  place?: boolean;
package/dist/index.js CHANGED
@@ -54649,7 +54649,8 @@ class AppDatabase {
54649
54649
  "support",
54650
54650
  "resistance",
54651
54651
  "symbol_config",
54652
- "anchor"
54652
+ "anchor",
54653
+ "watch_instance"
54653
54654
  ];
54654
54655
  return fields.join(", ");
54655
54656
  }
@@ -58660,6 +58661,7 @@ class BaseExchange {
58660
58661
  is_limit: true,
58661
58662
  price_places: payload.price_places,
58662
58663
  decimal_places: payload.decimal_places,
58664
+ hedge: payload.hedge,
58663
58665
  current_price
58664
58666
  });
58665
58667
  }
@@ -58773,6 +58775,7 @@ class BaseExchange {
58773
58775
  kind: payload.kind,
58774
58776
  cancel: true,
58775
58777
  is_limit: true,
58778
+ hedge: payload.hedge,
58776
58779
  price_places: payload.price_places,
58777
58780
  decimal_places: payload.decimal_places,
58778
58781
  current_price
@@ -59423,6 +59426,11 @@ async function placeStopOrder(client, payload) {
59423
59426
  stop: payload.final_stop,
59424
59427
  is_market: !payload.is_limit
59425
59428
  };
59429
+ if (payload.hedge) {
59430
+ let reverse_kind = payload.kind === "long" ? "short" : "long";
59431
+ order.kind = reverse_kind;
59432
+ order.is_market = false;
59433
+ }
59426
59434
  return createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
59427
59435
  }
59428
59436
  async function getOpenOrders(client, symbol, type) {
@@ -61243,7 +61251,8 @@ class ExchangePosition {
61243
61251
  raw: payload.raw,
61244
61252
  use_current,
61245
61253
  stop_percent: config2.stop_percent || 100,
61246
- distribution: config2.distribution
61254
+ distribution: config2.distribution,
61255
+ hedge: payload.hedge
61247
61256
  });
61248
61257
  }
61249
61258
  }
@@ -61340,6 +61349,7 @@ class ExchangePosition {
61340
61349
  stop: payload.stop,
61341
61350
  price_places: app_config.price_places,
61342
61351
  decimal_places: app_config.decimal_places,
61352
+ hedge: payload.hedge,
61343
61353
  place: true
61344
61354
  });
61345
61355
  return result;
@@ -61520,7 +61530,8 @@ class ExchangePosition {
61520
61530
  ignore_config,
61521
61531
  risky,
61522
61532
  limit = true,
61523
- target_pnl
61533
+ target_pnl,
61534
+ hedge
61524
61535
  } = payload;
61525
61536
  if (cancel) {
61526
61537
  await this.cancelOrders({
@@ -61544,7 +61555,8 @@ class ExchangePosition {
61544
61555
  stop,
61545
61556
  ignore_config,
61546
61557
  risky,
61547
- place
61558
+ place,
61559
+ hedge
61548
61560
  });
61549
61561
  }
61550
61562
  await this.updateConfigPnl();
@@ -62265,7 +62277,8 @@ class ExchangeAccount {
62265
62277
  async initializePositions(payload) {
62266
62278
  const raw_positions = await this.syncAccount({
62267
62279
  update: payload.update,
62268
- symbol: payload.symbol
62280
+ symbol: payload.symbol,
62281
+ live_refresh: payload.update
62269
62282
  });
62270
62283
  const positions = await this.syncAccount({
62271
62284
  symbol: payload.symbol,
@@ -61405,7 +61405,8 @@ class AppDatabase {
61405
61405
  "support",
61406
61406
  "resistance",
61407
61407
  "symbol_config",
61408
- "anchor"
61408
+ "anchor",
61409
+ "watch_instance"
61409
61410
  ];
61410
61411
  return fields.join(", ");
61411
61412
  }
@@ -65298,6 +65299,7 @@ class BaseExchange {
65298
65299
  is_limit: true,
65299
65300
  price_places: payload.price_places,
65300
65301
  decimal_places: payload.decimal_places,
65302
+ hedge: payload.hedge,
65301
65303
  current_price
65302
65304
  });
65303
65305
  }
@@ -65411,6 +65413,7 @@ class BaseExchange {
65411
65413
  kind: payload.kind,
65412
65414
  cancel: true,
65413
65415
  is_limit: true,
65416
+ hedge: payload.hedge,
65414
65417
  price_places: payload.price_places,
65415
65418
  decimal_places: payload.decimal_places,
65416
65419
  current_price
@@ -66061,6 +66064,11 @@ async function placeStopOrder(client, payload) {
66061
66064
  stop: payload.final_stop,
66062
66065
  is_market: !payload.is_limit
66063
66066
  };
66067
+ if (payload.hedge) {
66068
+ let reverse_kind = payload.kind === "long" ? "short" : "long";
66069
+ order.kind = reverse_kind;
66070
+ order.is_market = false;
66071
+ }
66064
66072
  return createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
66065
66073
  }
66066
66074
  async function getOpenOrders(client, symbol, type) {
@@ -67881,7 +67889,8 @@ class ExchangePosition {
67881
67889
  raw: payload.raw,
67882
67890
  use_current,
67883
67891
  stop_percent: config2.stop_percent || 100,
67884
- distribution: config2.distribution
67892
+ distribution: config2.distribution,
67893
+ hedge: payload.hedge
67885
67894
  });
67886
67895
  }
67887
67896
  }
@@ -67978,6 +67987,7 @@ class ExchangePosition {
67978
67987
  stop: payload.stop,
67979
67988
  price_places: app_config.price_places,
67980
67989
  decimal_places: app_config.decimal_places,
67990
+ hedge: payload.hedge,
67981
67991
  place: true
67982
67992
  });
67983
67993
  return result;
@@ -68158,7 +68168,8 @@ class ExchangePosition {
68158
68168
  ignore_config,
68159
68169
  risky,
68160
68170
  limit = true,
68161
- target_pnl
68171
+ target_pnl,
68172
+ hedge
68162
68173
  } = payload;
68163
68174
  if (cancel) {
68164
68175
  await this.cancelOrders({
@@ -68182,7 +68193,8 @@ class ExchangePosition {
68182
68193
  stop,
68183
68194
  ignore_config,
68184
68195
  risky,
68185
- place
68196
+ place,
68197
+ hedge
68186
68198
  });
68187
68199
  }
68188
68200
  await this.updateConfigPnl();
@@ -68903,7 +68915,8 @@ class ExchangeAccount {
68903
68915
  async initializePositions(payload) {
68904
68916
  const raw_positions = await this.syncAccount({
68905
68917
  update: payload.update,
68906
- symbol: payload.symbol
68918
+ symbol: payload.symbol,
68919
+ live_refresh: payload.update
68907
68920
  });
68908
68921
  const positions = await this.syncAccount({
68909
68922
  symbol: payload.symbol,
@@ -61378,7 +61378,8 @@ class AppDatabase {
61378
61378
  "support",
61379
61379
  "resistance",
61380
61380
  "symbol_config",
61381
- "anchor"
61381
+ "anchor",
61382
+ "watch_instance"
61382
61383
  ];
61383
61384
  return fields.join(", ");
61384
61385
  }
@@ -65271,6 +65272,7 @@ class BaseExchange {
65271
65272
  is_limit: true,
65272
65273
  price_places: payload.price_places,
65273
65274
  decimal_places: payload.decimal_places,
65275
+ hedge: payload.hedge,
65274
65276
  current_price
65275
65277
  });
65276
65278
  }
@@ -65384,6 +65386,7 @@ class BaseExchange {
65384
65386
  kind: payload.kind,
65385
65387
  cancel: true,
65386
65388
  is_limit: true,
65389
+ hedge: payload.hedge,
65387
65390
  price_places: payload.price_places,
65388
65391
  decimal_places: payload.decimal_places,
65389
65392
  current_price
@@ -66034,6 +66037,11 @@ async function placeStopOrder(client, payload) {
66034
66037
  stop: payload.final_stop,
66035
66038
  is_market: !payload.is_limit
66036
66039
  };
66040
+ if (payload.hedge) {
66041
+ let reverse_kind = payload.kind === "long" ? "short" : "long";
66042
+ order.kind = reverse_kind;
66043
+ order.is_market = false;
66044
+ }
66037
66045
  return createLimitPurchaseOrdersParallel(client, symbol, price_places, decimal_places, [order]);
66038
66046
  }
66039
66047
  async function getOpenOrders(client, symbol, type) {
@@ -67854,7 +67862,8 @@ class ExchangePosition {
67854
67862
  raw: payload.raw,
67855
67863
  use_current,
67856
67864
  stop_percent: config2.stop_percent || 100,
67857
- distribution: config2.distribution
67865
+ distribution: config2.distribution,
67866
+ hedge: payload.hedge
67858
67867
  });
67859
67868
  }
67860
67869
  }
@@ -67951,6 +67960,7 @@ class ExchangePosition {
67951
67960
  stop: payload.stop,
67952
67961
  price_places: app_config.price_places,
67953
67962
  decimal_places: app_config.decimal_places,
67963
+ hedge: payload.hedge,
67954
67964
  place: true
67955
67965
  });
67956
67966
  return result;
@@ -68131,7 +68141,8 @@ class ExchangePosition {
68131
68141
  ignore_config,
68132
68142
  risky,
68133
68143
  limit = true,
68134
- target_pnl
68144
+ target_pnl,
68145
+ hedge
68135
68146
  } = payload;
68136
68147
  if (cancel) {
68137
68148
  await this.cancelOrders({
@@ -68155,7 +68166,8 @@ class ExchangePosition {
68155
68166
  stop,
68156
68167
  ignore_config,
68157
68168
  risky,
68158
- place
68169
+ place,
68170
+ hedge
68159
68171
  });
68160
68172
  }
68161
68173
  await this.updateConfigPnl();
@@ -68876,7 +68888,8 @@ class ExchangeAccount {
68876
68888
  async initializePositions(payload) {
68877
68889
  const raw_positions = await this.syncAccount({
68878
68890
  update: payload.update,
68879
- symbol: payload.symbol
68891
+ symbol: payload.symbol,
68892
+ live_refresh: payload.update
68880
68893
  });
68881
68894
  const positions = await this.syncAccount({
68882
68895
  symbol: payload.symbol,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gbozee/ultimate",
3
3
  "type": "module",
4
- "version": "0.0.2-185",
4
+ "version": "0.0.2-187",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",