@gbozee/ultimate 0.0.2-10 → 0.0.2-13

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 (3) hide show
  1. package/dist/index.d.ts +65 -58
  2. package/dist/index.js +3583 -120
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -121,6 +121,10 @@ export interface BaseExchange {
121
121
  symbol: string;
122
122
  leverage: number;
123
123
  }): Promise<any>;
124
+ generateConfig(payload: {
125
+ symbol: string;
126
+ limit?: number;
127
+ }): Promise<any>;
124
128
  }
125
129
  export interface BaseSystemFields {
126
130
  id: string;
@@ -217,6 +221,7 @@ export interface BullishMarket extends RecordModel {
217
221
  export interface WindingDownMarket extends RecordModel {
218
222
  id: string;
219
223
  symbol: string;
224
+ risk_reward: number;
220
225
  }
221
226
  export type ExchangeType = {
222
227
  owner: string;
@@ -323,13 +328,14 @@ export declare class AppDatabase {
323
328
  symbol: string;
324
329
  kind: "long" | "short";
325
330
  account: ExchangeType;
326
- }): Promise<import("pocketbase").RecordModel>;
331
+ }): Promise<ScheduledTrade | null>;
327
332
  getPositionStrategy(account: ExchangeType): Promise<{
328
333
  strategy_instance: Strategy;
329
334
  focus_account: ExchangeAccount;
330
335
  }>;
331
336
  createOrUpdateWindingDownMarket(symbol: string): Promise<import("pocketbase").RecordModel>;
332
- getWindingDownMarkets(): Promise<WindingDownMarket[]>;
337
+ getWindingDownMarkets(symbol?: string): Promise<WindingDownMarket[]>;
338
+ getBullishMarket(symbol: string): Promise<BullishMarket>;
333
339
  getBullishMarkets(options?: {
334
340
  new_markets: Array<{
335
341
  symbol: string;
@@ -354,7 +360,11 @@ export declare class AppDatabase {
354
360
  updated: number;
355
361
  created: number;
356
362
  } | SymbolConfig[]>;
357
- unwindSymbolFromDB(symbol: string): Promise<void>;
363
+ unwindSymbolFromDB(symbol: string): Promise<boolean>;
364
+ hasExistingPosition(symbol: string): Promise<import("pocketbase").RecordModel[]>;
365
+ removeSymbolFromUnwindingMarkets(symbol: string): Promise<boolean>;
366
+ removePosition(position: any): Promise<void>;
367
+ removePositionConfig(position: any): Promise<void>;
358
368
  }
359
369
  export interface CodeNode {
360
370
  minimum_pnl: number;
@@ -426,11 +436,7 @@ declare class ExchangeAccount$1 {
426
436
  update?: boolean;
427
437
  as_view?: boolean;
428
438
  leverage?: number;
429
- }): Promise<(PositionsView & {
430
- expand?: {
431
- config: ScheduledTrade;
432
- };
433
- }) | (PositionsView & {
439
+ }): Promise<PositionsView | (PositionsView & {
434
440
  expand?: {
435
441
  config: ScheduledTrade;
436
442
  };
@@ -441,6 +447,11 @@ declare class ExchangeAccount$1 {
441
447
  kind: "long" | "short";
442
448
  update?: boolean;
443
449
  }): Promise<import("pocketbase").RecordModel[]>;
450
+ toggleStopBuying(payload: {
451
+ symbol: string;
452
+ kind: "long" | "short";
453
+ should_stop?: boolean;
454
+ }): Promise<import("pocketbase").RecordModel>;
444
455
  cancelOrders(payload: {
445
456
  symbol: string;
446
457
  kind: "long" | "short";
@@ -526,7 +537,7 @@ declare class ExchangeAccount$1 {
526
537
  risk: number;
527
538
  profit_percent?: number;
528
539
  };
529
- }): Promise<import("pocketbase").RecordModel>;
540
+ }): Promise<ScheduledTrade>;
530
541
  getCurrentPrice(symbol: string): Promise<any>;
531
542
  getPositionStrategy(): Promise<{
532
543
  strategy_instance: Strategy;
@@ -545,6 +556,49 @@ declare class ExchangeAccount$1 {
545
556
  short: boolean;
546
557
  };
547
558
  }): Promise<any>;
559
+ generate_config_params(payload: {
560
+ entry: number;
561
+ stop: number;
562
+ risk_reward: number;
563
+ risk: number;
564
+ symbol: string;
565
+ }): Promise<{
566
+ place_stop: boolean;
567
+ profit_percent: number;
568
+ entry: number;
569
+ stop: number;
570
+ avg_size: any;
571
+ avg_entry: any;
572
+ risk_reward: number;
573
+ neg_pnl: any;
574
+ risk: number;
575
+ }>;
576
+ extrapolateShortConfig(payload: {
577
+ kind: "long" | "short";
578
+ symbol: string;
579
+ risk_reward?: number;
580
+ }): Promise<{
581
+ place_stop: boolean;
582
+ profit_percent: number;
583
+ entry: number;
584
+ stop: number;
585
+ avg_size: any;
586
+ avg_entry: any;
587
+ risk_reward: number;
588
+ neg_pnl: any;
589
+ risk: number;
590
+ }>;
591
+ triggerTradeFromConfig(payload: {
592
+ symbol: string;
593
+ kind: "long" | "short";
594
+ }): Promise<any>;
595
+ verifyStopLoss(payload: {
596
+ symbol: string;
597
+ kind: "long" | "short";
598
+ revert?: boolean;
599
+ }): Promise<import("pocketbase").RecordModel[]>;
600
+ windDownSymbol(symbol: string, risk_reward?: number): Promise<void>;
601
+ triggerBullishMarket(symbol: string): Promise<any>;
548
602
  }
549
603
  declare class App {
550
604
  private app_db;
@@ -560,11 +614,7 @@ declare class App {
560
614
  kind?: "long" | "short";
561
615
  update?: boolean;
562
616
  as_view?: boolean;
563
- }): Promise<(PositionsView & {
564
- expand?: {
565
- config: ScheduledTrade;
566
- };
567
- }) | (PositionsView & {
617
+ }): Promise<PositionsView | (PositionsView & {
568
618
  expand?: {
569
619
  config: ScheduledTrade;
570
620
  };
@@ -597,34 +647,6 @@ declare class App {
597
647
  message?: undefined;
598
648
  exchange_result?: undefined;
599
649
  }>;
600
- triggerTradeFromConfig(payload: {
601
- account: ExchangeType;
602
- symbol: string;
603
- kind: "long" | "short";
604
- }): Promise<any>;
605
- toggleStopBuying(payload: {
606
- account: ExchangeType;
607
- symbol: string;
608
- kind: "long" | "short";
609
- should_stop?: boolean;
610
- }): Promise<import("pocketbase").RecordModel>;
611
- generate_config_params(exchange_account: ExchangeAccount$1, payload: {
612
- entry: number;
613
- stop: number;
614
- risk_reward: number;
615
- risk: number;
616
- symbol: string;
617
- }): Promise<{
618
- place_stop: boolean;
619
- profit_percent: number;
620
- entry: number;
621
- stop: number;
622
- avg_size: any;
623
- avg_entry: any;
624
- risk_reward: number;
625
- neg_pnl: any;
626
- risk: number;
627
- }>;
628
650
  generateConfig(payload: {
629
651
  account: ExchangeType;
630
652
  symbol: string;
@@ -642,22 +664,6 @@ declare class App {
642
664
  short_db_position: any;
643
665
  balance: any;
644
666
  }>;
645
- extrapolateShortConfig(payload: {
646
- account: ExchangeType;
647
- kind: "long" | "short";
648
- symbol: string;
649
- risk_reward?: number;
650
- }): Promise<PositionsView | {
651
- place_stop: boolean;
652
- profit_percent: number;
653
- entry: number;
654
- stop: number;
655
- avg_size: any;
656
- avg_entry: any;
657
- risk_reward: number;
658
- neg_pnl: any;
659
- risk: number;
660
- }>;
661
667
  verifyStopLoss(payload: {
662
668
  account: ExchangeType;
663
669
  symbol: string;
@@ -690,6 +696,7 @@ declare class App {
690
696
  created: number;
691
697
  }>;
692
698
  updateAllAccountWithSymbols(with_positions?: boolean): Promise<void>;
699
+ windDownSymbol(symbol: string): Promise<boolean>;
693
700
  }
694
701
  export declare function initApp(payload: {
695
702
  db: {