@gbozee/ultimate 0.0.2-102 → 0.0.2-103

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.d.ts CHANGED
@@ -84,6 +84,7 @@ export interface AccountStrategy extends BaseSystemFields {
84
84
  max_reward_factor?: number;
85
85
  follow?: boolean;
86
86
  risk_reward?: number;
87
+ dynamic?: boolean;
87
88
  }
88
89
  interface Proxy$1 extends BaseSystemFields {
89
90
  ip_address?: string;
@@ -134,6 +135,73 @@ export interface WindingDownMarket extends RecordModel {
134
135
  symbol: string;
135
136
  risk_reward: number;
136
137
  }
138
+ export interface BotInstance extends BaseSystemFields {
139
+ asset: string;
140
+ main_account?: string;
141
+ secondary_account?: string;
142
+ main_symbol: string;
143
+ secondary_symbol?: string;
144
+ direction?: "long" | "short";
145
+ budget?: number;
146
+ settings?: Record<string, any>;
147
+ user?: string;
148
+ }
149
+ export interface BotState extends BaseSystemFields {
150
+ bot: string;
151
+ running?: boolean;
152
+ status?: "main-trading" | "hedge-mode";
153
+ spot_quantity?: number;
154
+ exchange_details?: Record<string, any>;
155
+ completed?: boolean;
156
+ }
157
+ export interface BotOrderHistory extends BaseSystemFields {
158
+ field: string;
159
+ symbol: string;
160
+ pnl?: number;
161
+ kind?: "long" | "short";
162
+ type?: "future" | "spot";
163
+ }
164
+ export interface BotPositionData {
165
+ entry: number;
166
+ quantity: number;
167
+ tp: {
168
+ price: number;
169
+ quantity: number;
170
+ pnl: number;
171
+ };
172
+ current_price: number;
173
+ balance: number;
174
+ kind: "long" | "short";
175
+ next_order: number;
176
+ last_order: number;
177
+ avg: {
178
+ price: number;
179
+ quantity: number;
180
+ };
181
+ sl: {
182
+ price: number;
183
+ quantity: number;
184
+ pnl: number;
185
+ };
186
+ }
187
+ export interface BotView extends RecordModel {
188
+ id: string;
189
+ direction?: "long" | "short";
190
+ budget?: number;
191
+ main_symbol?: string;
192
+ main_long_position?: BotPositionData;
193
+ main_short_position?: BotPositionData;
194
+ secondary_symbol?: string;
195
+ secondary_long_position?: BotPositionData;
196
+ secondary_short_position?: BotPositionData;
197
+ main_account?: string;
198
+ secondary_account?: string;
199
+ settings?: Record<string, any>;
200
+ main_long_strategy?: string;
201
+ main_short_strategy?: string;
202
+ secondary_long_strategy?: string;
203
+ secondary_short_strategy?: string;
204
+ }
137
205
  export type GlobalConfig = {
138
206
  profit_percent: number;
139
207
  symbol: string;
@@ -533,6 +601,26 @@ export declare class AppDatabase {
533
601
  symbol: string;
534
602
  account: ExchangeType;
535
603
  }): Promise<AccountStrategy>;
604
+ getBotViewInstance(payload: {
605
+ asset: string;
606
+ main_account: ExchangeType;
607
+ }): Promise<BotView | null>;
608
+ getBotInstance(payload: {
609
+ asset: string;
610
+ main_account: ExchangeType;
611
+ }): Promise<BotInstance | null>;
612
+ getBotState(payload: {
613
+ asset: string;
614
+ main_account: ExchangeType;
615
+ running?: boolean;
616
+ }): Promise<BotState[]>;
617
+ getBotOrderHistories(payload: {
618
+ asset: string;
619
+ main_account: ExchangeType;
620
+ symbol?: string;
621
+ kind?: "long" | "short";
622
+ type?: "future" | "spot";
623
+ }): Promise<BotOrderHistory[]>;
536
624
  createOrUpdateWindingDownMarket(payload: {
537
625
  symbol: string;
538
626
  risk_reward?: number;
@@ -1241,6 +1329,12 @@ export declare function generateGapTp(payload: {
1241
1329
  gap: number;
1242
1330
  gap_loss: number;
1243
1331
  };
1332
+ export declare function determineRewardFactor(payload: {
1333
+ quantity: number;
1334
+ avg_qty: number;
1335
+ minimum_pnl: number;
1336
+ risk: number;
1337
+ }): number;
1244
1338
  declare class ExchangePosition {
1245
1339
  exchange: BaseExchange;
1246
1340
  exchange_account: ExchangeAccount$1;