@gbozee/ultimate 0.0.2-next.28 → 0.0.2-next.29
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 +95 -4
- package/dist/index.d.ts +31 -20
- package/dist/index.js +95 -4
- package/dist/mcp-server.cjs +15 -4
- package/dist/mcp-server.js +15 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -49897,6 +49897,7 @@ __export(exports_src, {
|
|
|
49897
49897
|
initSqliteDb: () => initSqliteDb,
|
|
49898
49898
|
initApp: () => initApp,
|
|
49899
49899
|
get_app_config_and_max_size: () => get_app_config_and_max_size,
|
|
49900
|
+
getTradeSymbols: () => getTradeSymbols,
|
|
49900
49901
|
getRiskReward: () => getRiskReward,
|
|
49901
49902
|
getOptimumStopAndRisk: () => getOptimumStopAndRisk,
|
|
49902
49903
|
getOptimumHedgeFactor: () => getOptimumHedgeFactor,
|
|
@@ -72476,7 +72477,8 @@ var orderColumns = {
|
|
|
72476
72477
|
opposite_qty: real("opposite_qty"),
|
|
72477
72478
|
avg_entry_price: real("avg_entry_price"),
|
|
72478
72479
|
avg_price: real("avg_price"),
|
|
72479
|
-
avg_qty: real("avg_qty")
|
|
72480
|
+
avg_qty: real("avg_qty"),
|
|
72481
|
+
account_id: text("account_id")
|
|
72480
72482
|
};
|
|
72481
72483
|
var orders = sqliteTable("orders", {
|
|
72482
72484
|
id: text("id").primaryKey(),
|
|
@@ -72732,7 +72734,7 @@ class DrizzlePocketbase {
|
|
|
72732
72734
|
proxy: row.proxies,
|
|
72733
72735
|
symbol_config: row.symbol_configs,
|
|
72734
72736
|
compound_instance: row.compound_instances,
|
|
72735
|
-
short_compound_strategy: row.short_compound_strategy,
|
|
72737
|
+
short_compound_strategy: this.updateShortStrategyView(row.short_compound_strategy),
|
|
72736
72738
|
watch_instance: row.watch_positions
|
|
72737
72739
|
}
|
|
72738
72740
|
}));
|
|
@@ -72796,6 +72798,15 @@ class DrizzlePocketbase {
|
|
|
72796
72798
|
}
|
|
72797
72799
|
return null;
|
|
72798
72800
|
}
|
|
72801
|
+
updateShortStrategyView(xx) {
|
|
72802
|
+
if (xx) {
|
|
72803
|
+
return {
|
|
72804
|
+
...xx,
|
|
72805
|
+
support: xx.support ? JSON.parse(xx.support) : null
|
|
72806
|
+
};
|
|
72807
|
+
}
|
|
72808
|
+
return null;
|
|
72809
|
+
}
|
|
72799
72810
|
async createOrUpdatePositionConfig(db_position, payload) {
|
|
72800
72811
|
let config2 = null;
|
|
72801
72812
|
if (db_position.config) {
|
|
@@ -72926,12 +72937,91 @@ class DrizzlePocketbase {
|
|
|
72926
72937
|
proxy: row.proxies,
|
|
72927
72938
|
symbol_config: row.symbol_configs,
|
|
72928
72939
|
compound_instance: row.compound_instances,
|
|
72929
|
-
short_compound_strategy: row.short_compound_strategy,
|
|
72940
|
+
short_compound_strategy: this.updateShortStrategyView(row.short_compound_strategy),
|
|
72930
72941
|
watch_instance: row.watch_positions
|
|
72931
72942
|
}
|
|
72932
72943
|
}));
|
|
72933
72944
|
}
|
|
72934
72945
|
}
|
|
72946
|
+
async function getTradeSymbols(getApp, _symbol, auth2) {
|
|
72947
|
+
const app = await getApp(auth2);
|
|
72948
|
+
const pb = app.app_db.pb;
|
|
72949
|
+
let symbols = [];
|
|
72950
|
+
let positions = [];
|
|
72951
|
+
let exchange_accounts = [];
|
|
72952
|
+
if (app.app_db.email) {
|
|
72953
|
+
const exchangeAccountResults = await pb.db.select().from(exchangeAccounts).where(eq(lower(exchangeAccounts.email), app.app_db.email.toLowerCase()));
|
|
72954
|
+
exchange_accounts = exchangeAccountResults;
|
|
72955
|
+
const exchange_ids = exchange_accounts.map((ea) => ea.id);
|
|
72956
|
+
if (exchange_ids.length === 0) {
|
|
72957
|
+
return [];
|
|
72958
|
+
}
|
|
72959
|
+
const positionFilters = [
|
|
72960
|
+
sql`${derivedPositionView.p_account} IN (${exchange_ids.join(", ")})`
|
|
72961
|
+
];
|
|
72962
|
+
if (_symbol) {
|
|
72963
|
+
positionFilters.push(eq(lower(derivedPositionView.symbol), _symbol.toLowerCase()));
|
|
72964
|
+
}
|
|
72965
|
+
const positionResults = await pb.db.select().from(derivedPositionView).leftJoin(exchangeAccounts, eq(derivedPositionView.p_account, exchangeAccounts.id)).where(and(...positionFilters));
|
|
72966
|
+
positions = positionResults.map((row) => ({
|
|
72967
|
+
...row.derived_positions_view,
|
|
72968
|
+
expand: {
|
|
72969
|
+
account: row.exchange_accounts
|
|
72970
|
+
},
|
|
72971
|
+
account: row.exchange_accounts?.id
|
|
72972
|
+
}));
|
|
72973
|
+
const raw_symbols = positions.map((p) => p.symbol);
|
|
72974
|
+
const unique_symbols = [...new Set(raw_symbols)];
|
|
72975
|
+
if (unique_symbols.length === 0) {
|
|
72976
|
+
return [];
|
|
72977
|
+
}
|
|
72978
|
+
const symbolFilters = [
|
|
72979
|
+
sql`${symbolConfigs.symbol} IN (${unique_symbols.map((s2) => `'${s2}'`).join(", ")})`
|
|
72980
|
+
];
|
|
72981
|
+
if (_symbol) {
|
|
72982
|
+
symbolFilters.push(eq(lower(symbolConfigs.symbol), _symbol.toLowerCase()));
|
|
72983
|
+
}
|
|
72984
|
+
const symbolResults = await pb.db.select().from(symbolConfigs).where(and(...symbolFilters));
|
|
72985
|
+
symbols = symbolResults;
|
|
72986
|
+
} else {
|
|
72987
|
+
const symbolQuery = _symbol ? pb.db.select().from(symbolConfigs).where(eq(lower(symbolConfigs.symbol), _symbol.toLowerCase())) : pb.db.select().from(symbolConfigs);
|
|
72988
|
+
symbols = await symbolQuery;
|
|
72989
|
+
const positionQuery = pb.db.select().from(derivedPositionView).leftJoin(exchangeAccounts, eq(derivedPositionView.p_account, exchangeAccounts.id));
|
|
72990
|
+
const positionQueryWithFilter = _symbol ? positionQuery.where(eq(lower(derivedPositionView.symbol), _symbol.toLowerCase())) : positionQuery;
|
|
72991
|
+
const positionResults = await positionQueryWithFilter;
|
|
72992
|
+
positions = positionResults.map((row) => ({
|
|
72993
|
+
...row.derived_positions_view,
|
|
72994
|
+
expand: {
|
|
72995
|
+
account: row.exchange_accounts
|
|
72996
|
+
},
|
|
72997
|
+
account: row.exchange_accounts?.id
|
|
72998
|
+
}));
|
|
72999
|
+
const exchangeAccountResults = await pb.db.select().from(exchangeAccounts);
|
|
73000
|
+
exchange_accounts = exchangeAccountResults;
|
|
73001
|
+
}
|
|
73002
|
+
exchange_accounts = exchange_accounts.map((ea) => ({
|
|
73003
|
+
id: ea.id,
|
|
73004
|
+
owner: ea.owner,
|
|
73005
|
+
exchange: ea.exchange
|
|
73006
|
+
}));
|
|
73007
|
+
let symbolsWithCount = [];
|
|
73008
|
+
for (const symbol of symbols) {
|
|
73009
|
+
const matchingPositions = positions.filter((p) => p.symbol === symbol.symbol);
|
|
73010
|
+
const uniqueAccounts = new Set(matchingPositions.map((p) => p.account));
|
|
73011
|
+
const account_ids = Array.from(uniqueAccounts);
|
|
73012
|
+
const account_details = account_ids.map((id) => exchange_accounts.find((ea) => ea.id === id)).filter(Boolean);
|
|
73013
|
+
symbolsWithCount.push({
|
|
73014
|
+
...symbol,
|
|
73015
|
+
exchange_count: uniqueAccounts.size,
|
|
73016
|
+
account_ids: uniqueAccounts,
|
|
73017
|
+
account_details,
|
|
73018
|
+
symbol: symbol.symbol
|
|
73019
|
+
});
|
|
73020
|
+
}
|
|
73021
|
+
symbolsWithCount.sort((a, b) => b.exchange_count - a.exchange_count);
|
|
73022
|
+
const filteredSymbols = symbolsWithCount;
|
|
73023
|
+
return filteredSymbols;
|
|
73024
|
+
}
|
|
72935
73025
|
|
|
72936
73026
|
// src/db/index.ts
|
|
72937
73027
|
async function initSqliteDb({
|
|
@@ -72944,7 +73034,8 @@ async function initSqliteDb({
|
|
|
72944
73034
|
let import_4 = await Promise.resolve().then(() => (init_web2(), exports_web2));
|
|
72945
73035
|
const turso = import_3.createClient({
|
|
72946
73036
|
url: syncUrl,
|
|
72947
|
-
authToken
|
|
73037
|
+
authToken,
|
|
73038
|
+
intMode: "bigint"
|
|
72948
73039
|
});
|
|
72949
73040
|
const db2 = import_4.drizzle(turso);
|
|
72950
73041
|
const client = {
|
package/dist/index.d.ts
CHANGED
|
@@ -2714,6 +2714,28 @@ export declare const orders: import("drizzle-orm/sqlite-core").SQLiteTableWithCo
|
|
|
2714
2714
|
identity: undefined;
|
|
2715
2715
|
generated: undefined;
|
|
2716
2716
|
}, {}, {}>;
|
|
2717
|
+
account_id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2718
|
+
name: "account_id";
|
|
2719
|
+
tableName: "orders";
|
|
2720
|
+
dataType: "string";
|
|
2721
|
+
columnType: "SQLiteText";
|
|
2722
|
+
data: string;
|
|
2723
|
+
driverParam: string;
|
|
2724
|
+
notNull: false;
|
|
2725
|
+
hasDefault: false;
|
|
2726
|
+
isPrimaryKey: false;
|
|
2727
|
+
isAutoincrement: false;
|
|
2728
|
+
hasRuntimeDefault: false;
|
|
2729
|
+
enumValues: [
|
|
2730
|
+
string,
|
|
2731
|
+
...string[]
|
|
2732
|
+
];
|
|
2733
|
+
baseColumn: never;
|
|
2734
|
+
identity: undefined;
|
|
2735
|
+
generated: undefined;
|
|
2736
|
+
}, {}, {
|
|
2737
|
+
length: number;
|
|
2738
|
+
}>;
|
|
2717
2739
|
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
2718
2740
|
name: "id";
|
|
2719
2741
|
tableName: "orders";
|
|
@@ -4322,6 +4344,7 @@ export declare class DrizzlePocketbase {
|
|
|
4322
4344
|
avg_entry_price: number;
|
|
4323
4345
|
avg_price: number;
|
|
4324
4346
|
avg_qty: number;
|
|
4347
|
+
account_id: string;
|
|
4325
4348
|
id: string;
|
|
4326
4349
|
}[]>;
|
|
4327
4350
|
getPositionConfig(payload: {
|
|
@@ -4330,6 +4353,7 @@ export declare class DrizzlePocketbase {
|
|
|
4330
4353
|
account: ExchangeType;
|
|
4331
4354
|
}): Promise<ScheduledTrade | null>;
|
|
4332
4355
|
private updateScheduledTrades;
|
|
4356
|
+
private updateShortStrategyView;
|
|
4333
4357
|
createOrUpdatePositionConfig(db_position: any, payload: {
|
|
4334
4358
|
entry: number;
|
|
4335
4359
|
stop: number;
|
|
@@ -4407,16 +4431,7 @@ export declare class DrizzlePocketbase {
|
|
|
4407
4431
|
loss: number;
|
|
4408
4432
|
record: string;
|
|
4409
4433
|
};
|
|
4410
|
-
short_compound_strategy:
|
|
4411
|
-
id: string;
|
|
4412
|
-
tracking_account: string;
|
|
4413
|
-
support: unknown;
|
|
4414
|
-
following_account: string;
|
|
4415
|
-
resistance: number;
|
|
4416
|
-
kind: "long" | "short";
|
|
4417
|
-
same_side: boolean;
|
|
4418
|
-
paused: boolean;
|
|
4419
|
-
};
|
|
4434
|
+
short_compound_strategy: any;
|
|
4420
4435
|
watch_instance: {
|
|
4421
4436
|
created: string;
|
|
4422
4437
|
updated: string;
|
|
@@ -4464,6 +4479,7 @@ export declare class DrizzlePocketbase {
|
|
|
4464
4479
|
watch_instance: string;
|
|
4465
4480
|
}[]>;
|
|
4466
4481
|
}
|
|
4482
|
+
export declare function getTradeSymbols(getApp: any, _symbol?: string, auth?: any): Promise<any[]>;
|
|
4467
4483
|
declare function encryptObject(obj: any, password: string): string;
|
|
4468
4484
|
declare function decryptObject(encryptedString: string, password: string): any;
|
|
4469
4485
|
declare function initPocketBaseClient(proxy_credentials: {
|
|
@@ -4693,16 +4709,7 @@ export declare class AppDatabase {
|
|
|
4693
4709
|
loss: number;
|
|
4694
4710
|
record: string;
|
|
4695
4711
|
};
|
|
4696
|
-
short_compound_strategy:
|
|
4697
|
-
id: string;
|
|
4698
|
-
tracking_account: string;
|
|
4699
|
-
support: unknown;
|
|
4700
|
-
following_account: string;
|
|
4701
|
-
resistance: number;
|
|
4702
|
-
kind: "long" | "short";
|
|
4703
|
-
same_side: boolean;
|
|
4704
|
-
paused: boolean;
|
|
4705
|
-
};
|
|
4712
|
+
short_compound_strategy: any;
|
|
4706
4713
|
watch_instance: {
|
|
4707
4714
|
created: string;
|
|
4708
4715
|
updated: string;
|
|
@@ -4854,6 +4861,7 @@ export declare class AppDatabase {
|
|
|
4854
4861
|
avg_entry_price: number;
|
|
4855
4862
|
avg_price: number;
|
|
4856
4863
|
avg_qty: number;
|
|
4864
|
+
account_id: string;
|
|
4857
4865
|
id: string;
|
|
4858
4866
|
}[]>;
|
|
4859
4867
|
cancelLimitOrders(payload: {
|
|
@@ -6713,6 +6721,7 @@ export declare class ExchangePosition {
|
|
|
6713
6721
|
avg_entry_price: number;
|
|
6714
6722
|
avg_price: number;
|
|
6715
6723
|
avg_qty: number;
|
|
6724
|
+
account_id: string;
|
|
6716
6725
|
id: string;
|
|
6717
6726
|
}[] | Order[];
|
|
6718
6727
|
}>;
|
|
@@ -7173,6 +7182,7 @@ declare class ExchangeAccount$1 {
|
|
|
7173
7182
|
avg_entry_price: number;
|
|
7174
7183
|
avg_price: number;
|
|
7175
7184
|
avg_qty: number;
|
|
7185
|
+
account_id: string;
|
|
7176
7186
|
id: string;
|
|
7177
7187
|
}[] | Order[]>;
|
|
7178
7188
|
toggleStopBuying(payload: {
|
|
@@ -7459,6 +7469,7 @@ declare class ExchangeAccount$1 {
|
|
|
7459
7469
|
avg_entry_price: number;
|
|
7460
7470
|
avg_price: number;
|
|
7461
7471
|
avg_qty: number;
|
|
7472
|
+
account_id: string;
|
|
7462
7473
|
id: string;
|
|
7463
7474
|
}[] | Order[]>;
|
|
7464
7475
|
windDownSymbol(payload: {
|
package/dist/index.js
CHANGED
|
@@ -72390,7 +72390,8 @@ var orderColumns = {
|
|
|
72390
72390
|
opposite_qty: real("opposite_qty"),
|
|
72391
72391
|
avg_entry_price: real("avg_entry_price"),
|
|
72392
72392
|
avg_price: real("avg_price"),
|
|
72393
|
-
avg_qty: real("avg_qty")
|
|
72393
|
+
avg_qty: real("avg_qty"),
|
|
72394
|
+
account_id: text("account_id")
|
|
72394
72395
|
};
|
|
72395
72396
|
var orders = sqliteTable("orders", {
|
|
72396
72397
|
id: text("id").primaryKey(),
|
|
@@ -72646,7 +72647,7 @@ class DrizzlePocketbase {
|
|
|
72646
72647
|
proxy: row.proxies,
|
|
72647
72648
|
symbol_config: row.symbol_configs,
|
|
72648
72649
|
compound_instance: row.compound_instances,
|
|
72649
|
-
short_compound_strategy: row.short_compound_strategy,
|
|
72650
|
+
short_compound_strategy: this.updateShortStrategyView(row.short_compound_strategy),
|
|
72650
72651
|
watch_instance: row.watch_positions
|
|
72651
72652
|
}
|
|
72652
72653
|
}));
|
|
@@ -72710,6 +72711,15 @@ class DrizzlePocketbase {
|
|
|
72710
72711
|
}
|
|
72711
72712
|
return null;
|
|
72712
72713
|
}
|
|
72714
|
+
updateShortStrategyView(xx) {
|
|
72715
|
+
if (xx) {
|
|
72716
|
+
return {
|
|
72717
|
+
...xx,
|
|
72718
|
+
support: xx.support ? JSON.parse(xx.support) : null
|
|
72719
|
+
};
|
|
72720
|
+
}
|
|
72721
|
+
return null;
|
|
72722
|
+
}
|
|
72713
72723
|
async createOrUpdatePositionConfig(db_position, payload) {
|
|
72714
72724
|
let config2 = null;
|
|
72715
72725
|
if (db_position.config) {
|
|
@@ -72840,12 +72850,91 @@ class DrizzlePocketbase {
|
|
|
72840
72850
|
proxy: row.proxies,
|
|
72841
72851
|
symbol_config: row.symbol_configs,
|
|
72842
72852
|
compound_instance: row.compound_instances,
|
|
72843
|
-
short_compound_strategy: row.short_compound_strategy,
|
|
72853
|
+
short_compound_strategy: this.updateShortStrategyView(row.short_compound_strategy),
|
|
72844
72854
|
watch_instance: row.watch_positions
|
|
72845
72855
|
}
|
|
72846
72856
|
}));
|
|
72847
72857
|
}
|
|
72848
72858
|
}
|
|
72859
|
+
async function getTradeSymbols(getApp, _symbol, auth2) {
|
|
72860
|
+
const app = await getApp(auth2);
|
|
72861
|
+
const pb = app.app_db.pb;
|
|
72862
|
+
let symbols = [];
|
|
72863
|
+
let positions = [];
|
|
72864
|
+
let exchange_accounts = [];
|
|
72865
|
+
if (app.app_db.email) {
|
|
72866
|
+
const exchangeAccountResults = await pb.db.select().from(exchangeAccounts).where(eq(lower(exchangeAccounts.email), app.app_db.email.toLowerCase()));
|
|
72867
|
+
exchange_accounts = exchangeAccountResults;
|
|
72868
|
+
const exchange_ids = exchange_accounts.map((ea) => ea.id);
|
|
72869
|
+
if (exchange_ids.length === 0) {
|
|
72870
|
+
return [];
|
|
72871
|
+
}
|
|
72872
|
+
const positionFilters = [
|
|
72873
|
+
sql`${derivedPositionView.p_account} IN (${exchange_ids.join(", ")})`
|
|
72874
|
+
];
|
|
72875
|
+
if (_symbol) {
|
|
72876
|
+
positionFilters.push(eq(lower(derivedPositionView.symbol), _symbol.toLowerCase()));
|
|
72877
|
+
}
|
|
72878
|
+
const positionResults = await pb.db.select().from(derivedPositionView).leftJoin(exchangeAccounts, eq(derivedPositionView.p_account, exchangeAccounts.id)).where(and(...positionFilters));
|
|
72879
|
+
positions = positionResults.map((row) => ({
|
|
72880
|
+
...row.derived_positions_view,
|
|
72881
|
+
expand: {
|
|
72882
|
+
account: row.exchange_accounts
|
|
72883
|
+
},
|
|
72884
|
+
account: row.exchange_accounts?.id
|
|
72885
|
+
}));
|
|
72886
|
+
const raw_symbols = positions.map((p) => p.symbol);
|
|
72887
|
+
const unique_symbols = [...new Set(raw_symbols)];
|
|
72888
|
+
if (unique_symbols.length === 0) {
|
|
72889
|
+
return [];
|
|
72890
|
+
}
|
|
72891
|
+
const symbolFilters = [
|
|
72892
|
+
sql`${symbolConfigs.symbol} IN (${unique_symbols.map((s2) => `'${s2}'`).join(", ")})`
|
|
72893
|
+
];
|
|
72894
|
+
if (_symbol) {
|
|
72895
|
+
symbolFilters.push(eq(lower(symbolConfigs.symbol), _symbol.toLowerCase()));
|
|
72896
|
+
}
|
|
72897
|
+
const symbolResults = await pb.db.select().from(symbolConfigs).where(and(...symbolFilters));
|
|
72898
|
+
symbols = symbolResults;
|
|
72899
|
+
} else {
|
|
72900
|
+
const symbolQuery = _symbol ? pb.db.select().from(symbolConfigs).where(eq(lower(symbolConfigs.symbol), _symbol.toLowerCase())) : pb.db.select().from(symbolConfigs);
|
|
72901
|
+
symbols = await symbolQuery;
|
|
72902
|
+
const positionQuery = pb.db.select().from(derivedPositionView).leftJoin(exchangeAccounts, eq(derivedPositionView.p_account, exchangeAccounts.id));
|
|
72903
|
+
const positionQueryWithFilter = _symbol ? positionQuery.where(eq(lower(derivedPositionView.symbol), _symbol.toLowerCase())) : positionQuery;
|
|
72904
|
+
const positionResults = await positionQueryWithFilter;
|
|
72905
|
+
positions = positionResults.map((row) => ({
|
|
72906
|
+
...row.derived_positions_view,
|
|
72907
|
+
expand: {
|
|
72908
|
+
account: row.exchange_accounts
|
|
72909
|
+
},
|
|
72910
|
+
account: row.exchange_accounts?.id
|
|
72911
|
+
}));
|
|
72912
|
+
const exchangeAccountResults = await pb.db.select().from(exchangeAccounts);
|
|
72913
|
+
exchange_accounts = exchangeAccountResults;
|
|
72914
|
+
}
|
|
72915
|
+
exchange_accounts = exchange_accounts.map((ea) => ({
|
|
72916
|
+
id: ea.id,
|
|
72917
|
+
owner: ea.owner,
|
|
72918
|
+
exchange: ea.exchange
|
|
72919
|
+
}));
|
|
72920
|
+
let symbolsWithCount = [];
|
|
72921
|
+
for (const symbol of symbols) {
|
|
72922
|
+
const matchingPositions = positions.filter((p) => p.symbol === symbol.symbol);
|
|
72923
|
+
const uniqueAccounts = new Set(matchingPositions.map((p) => p.account));
|
|
72924
|
+
const account_ids = Array.from(uniqueAccounts);
|
|
72925
|
+
const account_details = account_ids.map((id) => exchange_accounts.find((ea) => ea.id === id)).filter(Boolean);
|
|
72926
|
+
symbolsWithCount.push({
|
|
72927
|
+
...symbol,
|
|
72928
|
+
exchange_count: uniqueAccounts.size,
|
|
72929
|
+
account_ids: uniqueAccounts,
|
|
72930
|
+
account_details,
|
|
72931
|
+
symbol: symbol.symbol
|
|
72932
|
+
});
|
|
72933
|
+
}
|
|
72934
|
+
symbolsWithCount.sort((a, b) => b.exchange_count - a.exchange_count);
|
|
72935
|
+
const filteredSymbols = symbolsWithCount;
|
|
72936
|
+
return filteredSymbols;
|
|
72937
|
+
}
|
|
72849
72938
|
|
|
72850
72939
|
// src/db/index.ts
|
|
72851
72940
|
async function initSqliteDb({
|
|
@@ -72858,7 +72947,8 @@ async function initSqliteDb({
|
|
|
72858
72947
|
let import_4 = await Promise.resolve().then(() => (init_web2(), exports_web2));
|
|
72859
72948
|
const turso = import_3.createClient({
|
|
72860
72949
|
url: syncUrl,
|
|
72861
|
-
authToken
|
|
72950
|
+
authToken,
|
|
72951
|
+
intMode: "bigint"
|
|
72862
72952
|
});
|
|
72863
72953
|
const db2 = import_4.drizzle(turso);
|
|
72864
72954
|
const client = {
|
|
@@ -73359,6 +73449,7 @@ export {
|
|
|
73359
73449
|
initSqliteDb,
|
|
73360
73450
|
initApp,
|
|
73361
73451
|
get_app_config_and_max_size,
|
|
73452
|
+
getTradeSymbols,
|
|
73362
73453
|
getRiskReward,
|
|
73363
73454
|
getOptimumStopAndRisk,
|
|
73364
73455
|
getOptimumHedgeFactor,
|
package/dist/mcp-server.cjs
CHANGED
|
@@ -85144,7 +85144,8 @@ var orderColumns = {
|
|
|
85144
85144
|
opposite_qty: real("opposite_qty"),
|
|
85145
85145
|
avg_entry_price: real("avg_entry_price"),
|
|
85146
85146
|
avg_price: real("avg_price"),
|
|
85147
|
-
avg_qty: real("avg_qty")
|
|
85147
|
+
avg_qty: real("avg_qty"),
|
|
85148
|
+
account_id: text("account_id")
|
|
85148
85149
|
};
|
|
85149
85150
|
var orders = sqliteTable("orders", {
|
|
85150
85151
|
id: text("id").primaryKey(),
|
|
@@ -85400,7 +85401,7 @@ class DrizzlePocketbase {
|
|
|
85400
85401
|
proxy: row.proxies,
|
|
85401
85402
|
symbol_config: row.symbol_configs,
|
|
85402
85403
|
compound_instance: row.compound_instances,
|
|
85403
|
-
short_compound_strategy: row.short_compound_strategy,
|
|
85404
|
+
short_compound_strategy: this.updateShortStrategyView(row.short_compound_strategy),
|
|
85404
85405
|
watch_instance: row.watch_positions
|
|
85405
85406
|
}
|
|
85406
85407
|
}));
|
|
@@ -85464,6 +85465,15 @@ class DrizzlePocketbase {
|
|
|
85464
85465
|
}
|
|
85465
85466
|
return null;
|
|
85466
85467
|
}
|
|
85468
|
+
updateShortStrategyView(xx) {
|
|
85469
|
+
if (xx) {
|
|
85470
|
+
return {
|
|
85471
|
+
...xx,
|
|
85472
|
+
support: xx.support ? JSON.parse(xx.support) : null
|
|
85473
|
+
};
|
|
85474
|
+
}
|
|
85475
|
+
return null;
|
|
85476
|
+
}
|
|
85467
85477
|
async createOrUpdatePositionConfig(db_position, payload) {
|
|
85468
85478
|
let config2 = null;
|
|
85469
85479
|
if (db_position.config) {
|
|
@@ -85594,7 +85604,7 @@ class DrizzlePocketbase {
|
|
|
85594
85604
|
proxy: row.proxies,
|
|
85595
85605
|
symbol_config: row.symbol_configs,
|
|
85596
85606
|
compound_instance: row.compound_instances,
|
|
85597
|
-
short_compound_strategy: row.short_compound_strategy,
|
|
85607
|
+
short_compound_strategy: this.updateShortStrategyView(row.short_compound_strategy),
|
|
85598
85608
|
watch_instance: row.watch_positions
|
|
85599
85609
|
}
|
|
85600
85610
|
}));
|
|
@@ -85612,7 +85622,8 @@ async function initSqliteDb({
|
|
|
85612
85622
|
let import_4 = await Promise.resolve().then(() => (init_web2(), exports_web2));
|
|
85613
85623
|
const turso = import_3.createClient({
|
|
85614
85624
|
url: syncUrl,
|
|
85615
|
-
authToken
|
|
85625
|
+
authToken,
|
|
85626
|
+
intMode: "bigint"
|
|
85616
85627
|
});
|
|
85617
85628
|
const db2 = import_4.drizzle(turso);
|
|
85618
85629
|
const client = {
|
package/dist/mcp-server.js
CHANGED
|
@@ -85117,7 +85117,8 @@ var orderColumns = {
|
|
|
85117
85117
|
opposite_qty: real("opposite_qty"),
|
|
85118
85118
|
avg_entry_price: real("avg_entry_price"),
|
|
85119
85119
|
avg_price: real("avg_price"),
|
|
85120
|
-
avg_qty: real("avg_qty")
|
|
85120
|
+
avg_qty: real("avg_qty"),
|
|
85121
|
+
account_id: text("account_id")
|
|
85121
85122
|
};
|
|
85122
85123
|
var orders = sqliteTable("orders", {
|
|
85123
85124
|
id: text("id").primaryKey(),
|
|
@@ -85373,7 +85374,7 @@ class DrizzlePocketbase {
|
|
|
85373
85374
|
proxy: row.proxies,
|
|
85374
85375
|
symbol_config: row.symbol_configs,
|
|
85375
85376
|
compound_instance: row.compound_instances,
|
|
85376
|
-
short_compound_strategy: row.short_compound_strategy,
|
|
85377
|
+
short_compound_strategy: this.updateShortStrategyView(row.short_compound_strategy),
|
|
85377
85378
|
watch_instance: row.watch_positions
|
|
85378
85379
|
}
|
|
85379
85380
|
}));
|
|
@@ -85437,6 +85438,15 @@ class DrizzlePocketbase {
|
|
|
85437
85438
|
}
|
|
85438
85439
|
return null;
|
|
85439
85440
|
}
|
|
85441
|
+
updateShortStrategyView(xx) {
|
|
85442
|
+
if (xx) {
|
|
85443
|
+
return {
|
|
85444
|
+
...xx,
|
|
85445
|
+
support: xx.support ? JSON.parse(xx.support) : null
|
|
85446
|
+
};
|
|
85447
|
+
}
|
|
85448
|
+
return null;
|
|
85449
|
+
}
|
|
85440
85450
|
async createOrUpdatePositionConfig(db_position, payload) {
|
|
85441
85451
|
let config2 = null;
|
|
85442
85452
|
if (db_position.config) {
|
|
@@ -85567,7 +85577,7 @@ class DrizzlePocketbase {
|
|
|
85567
85577
|
proxy: row.proxies,
|
|
85568
85578
|
symbol_config: row.symbol_configs,
|
|
85569
85579
|
compound_instance: row.compound_instances,
|
|
85570
|
-
short_compound_strategy: row.short_compound_strategy,
|
|
85580
|
+
short_compound_strategy: this.updateShortStrategyView(row.short_compound_strategy),
|
|
85571
85581
|
watch_instance: row.watch_positions
|
|
85572
85582
|
}
|
|
85573
85583
|
}));
|
|
@@ -85585,7 +85595,8 @@ async function initSqliteDb({
|
|
|
85585
85595
|
let import_4 = await Promise.resolve().then(() => (init_web2(), exports_web2));
|
|
85586
85596
|
const turso = import_3.createClient({
|
|
85587
85597
|
url: syncUrl,
|
|
85588
|
-
authToken
|
|
85598
|
+
authToken,
|
|
85599
|
+
intMode: "bigint"
|
|
85589
85600
|
});
|
|
85590
85601
|
const db2 = import_4.drizzle(turso);
|
|
85591
85602
|
const client = {
|