@3rd-eye-labs/openmm 0.0.1
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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/cli/cli.d.ts +3 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +43 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/commands/balance.d.ts +3 -0
- package/dist/cli/commands/balance.d.ts.map +1 -0
- package/dist/cli/commands/balance.js +51 -0
- package/dist/cli/commands/balance.js.map +1 -0
- package/dist/cli/commands/orderbook.d.ts +3 -0
- package/dist/cli/commands/orderbook.d.ts.map +1 -0
- package/dist/cli/commands/orderbook.js +83 -0
- package/dist/cli/commands/orderbook.js.map +1 -0
- package/dist/cli/commands/orders.d.ts +3 -0
- package/dist/cli/commands/orders.d.ts.map +1 -0
- package/dist/cli/commands/orders.js +196 -0
- package/dist/cli/commands/orders.js.map +1 -0
- package/dist/cli/commands/pool-discovery.d.ts +3 -0
- package/dist/cli/commands/pool-discovery.d.ts.map +1 -0
- package/dist/cli/commands/pool-discovery.js +60 -0
- package/dist/cli/commands/pool-discovery.js.map +1 -0
- package/dist/cli/commands/ticker.d.ts +3 -0
- package/dist/cli/commands/ticker.d.ts.map +1 -0
- package/dist/cli/commands/ticker.js +51 -0
- package/dist/cli/commands/ticker.js.map +1 -0
- package/dist/cli/commands/trade.d.ts +3 -0
- package/dist/cli/commands/trade.d.ts.map +1 -0
- package/dist/cli/commands/trade.js +110 -0
- package/dist/cli/commands/trade.js.map +1 -0
- package/dist/cli/commands/trades.d.ts +3 -0
- package/dist/cli/commands/trades.d.ts.map +1 -0
- package/dist/cli/commands/trades.js +73 -0
- package/dist/cli/commands/trades.js.map +1 -0
- package/dist/cli/exchange-factory.d.ts +40 -0
- package/dist/cli/exchange-factory.d.ts.map +1 -0
- package/dist/cli/exchange-factory.js +77 -0
- package/dist/cli/exchange-factory.js.map +1 -0
- package/dist/cli/pool-discovery-core.d.ts +54 -0
- package/dist/cli/pool-discovery-core.d.ts.map +1 -0
- package/dist/cli/pool-discovery-core.js +193 -0
- package/dist/cli/pool-discovery-core.js.map +1 -0
- package/dist/cli/utils/error-handler.d.ts +40 -0
- package/dist/cli/utils/error-handler.d.ts.map +1 -0
- package/dist/cli/utils/error-handler.js +117 -0
- package/dist/cli/utils/error-handler.js.map +1 -0
- package/dist/cli/utils/validation.d.ts +45 -0
- package/dist/cli/utils/validation.d.ts.map +1 -0
- package/dist/cli/utils/validation.js +118 -0
- package/dist/cli/utils/validation.js.map +1 -0
- package/dist/config/environment.d.ts +25 -0
- package/dist/config/environment.d.ts.map +1 -0
- package/dist/config/environment.js +72 -0
- package/dist/config/environment.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +21 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/launcher-config.d.ts +17 -0
- package/dist/config/launcher-config.d.ts.map +1 -0
- package/dist/config/launcher-config.js +14 -0
- package/dist/config/launcher-config.js.map +1 -0
- package/dist/config/price-aggregation.d.ts +49 -0
- package/dist/config/price-aggregation.d.ts.map +1 -0
- package/dist/config/price-aggregation.js +89 -0
- package/dist/config/price-aggregation.js.map +1 -0
- package/dist/core/exchange/base-exchange-connector.d.ts +45 -0
- package/dist/core/exchange/base-exchange-connector.d.ts.map +1 -0
- package/dist/core/exchange/base-exchange-connector.js +43 -0
- package/dist/core/exchange/base-exchange-connector.js.map +1 -0
- package/dist/core/exchange/base-exchange-data-mapper.d.ts +58 -0
- package/dist/core/exchange/base-exchange-data-mapper.d.ts.map +1 -0
- package/dist/core/exchange/base-exchange-data-mapper.js +60 -0
- package/dist/core/exchange/base-exchange-data-mapper.js.map +1 -0
- package/dist/core/price-aggregation/cardano-price-service.d.ts +31 -0
- package/dist/core/price-aggregation/cardano-price-service.d.ts.map +1 -0
- package/dist/core/price-aggregation/cardano-price-service.js +157 -0
- package/dist/core/price-aggregation/cardano-price-service.js.map +1 -0
- package/dist/core/price-aggregation/index.d.ts +11 -0
- package/dist/core/price-aggregation/index.d.ts.map +1 -0
- package/dist/core/price-aggregation/index.js +21 -0
- package/dist/core/price-aggregation/index.js.map +1 -0
- package/dist/core/price-aggregation/iris-api-client.d.ts +16 -0
- package/dist/core/price-aggregation/iris-api-client.d.ts.map +1 -0
- package/dist/core/price-aggregation/iris-api-client.js +62 -0
- package/dist/core/price-aggregation/iris-api-client.js.map +1 -0
- package/dist/core/price-aggregation/iris-pool-discovery.d.ts +37 -0
- package/dist/core/price-aggregation/iris-pool-discovery.d.ts.map +1 -0
- package/dist/core/price-aggregation/iris-pool-discovery.js +123 -0
- package/dist/core/price-aggregation/iris-pool-discovery.js.map +1 -0
- package/dist/core/price-aggregation/price-calculator.d.ts +27 -0
- package/dist/core/price-aggregation/price-calculator.d.ts.map +1 -0
- package/dist/core/price-aggregation/price-calculator.js +84 -0
- package/dist/core/price-aggregation/price-calculator.js.map +1 -0
- package/dist/core/risk-management/risk-manager.d.ts +14 -0
- package/dist/core/risk-management/risk-manager.d.ts.map +1 -0
- package/dist/core/risk-management/risk-manager.js +40 -0
- package/dist/core/risk-management/risk-manager.js.map +1 -0
- package/dist/core/strategy/base-strategy.d.ts +26 -0
- package/dist/core/strategy/base-strategy.d.ts.map +1 -0
- package/dist/core/strategy/base-strategy.js +46 -0
- package/dist/core/strategy/base-strategy.js.map +1 -0
- package/dist/core/strategy/strategy-factory.d.ts +7 -0
- package/dist/core/strategy/strategy-factory.d.ts.map +1 -0
- package/dist/core/strategy/strategy-factory.js +64 -0
- package/dist/core/strategy/strategy-factory.js.map +1 -0
- package/dist/exchanges/mexc/mexc-auth.d.ts +42 -0
- package/dist/exchanges/mexc/mexc-auth.d.ts.map +1 -0
- package/dist/exchanges/mexc/mexc-auth.js +122 -0
- package/dist/exchanges/mexc/mexc-auth.js.map +1 -0
- package/dist/exchanges/mexc/mexc-connector.d.ts +125 -0
- package/dist/exchanges/mexc/mexc-connector.d.ts.map +1 -0
- package/dist/exchanges/mexc/mexc-connector.js +422 -0
- package/dist/exchanges/mexc/mexc-connector.js.map +1 -0
- package/dist/exchanges/mexc/mexc-data-mapper.d.ts +50 -0
- package/dist/exchanges/mexc/mexc-data-mapper.d.ts.map +1 -0
- package/dist/exchanges/mexc/mexc-data-mapper.js +127 -0
- package/dist/exchanges/mexc/mexc-data-mapper.js.map +1 -0
- package/dist/exchanges/mexc/mexc-protobuf-decoder.d.ts +43 -0
- package/dist/exchanges/mexc/mexc-protobuf-decoder.d.ts.map +1 -0
- package/dist/exchanges/mexc/mexc-protobuf-decoder.js +235 -0
- package/dist/exchanges/mexc/mexc-protobuf-decoder.js.map +1 -0
- package/dist/exchanges/mexc/mexc-user-stream.d.ts +81 -0
- package/dist/exchanges/mexc/mexc-user-stream.d.ts.map +1 -0
- package/dist/exchanges/mexc/mexc-user-stream.js +253 -0
- package/dist/exchanges/mexc/mexc-user-stream.js.map +1 -0
- package/dist/exchanges/mexc/mexc-utils.d.ts +31 -0
- package/dist/exchanges/mexc/mexc-utils.d.ts.map +1 -0
- package/dist/exchanges/mexc/mexc-utils.js +186 -0
- package/dist/exchanges/mexc/mexc-utils.js.map +1 -0
- package/dist/exchanges/mexc/mexc-websocket.d.ts +124 -0
- package/dist/exchanges/mexc/mexc-websocket.d.ts.map +1 -0
- package/dist/exchanges/mexc/mexc-websocket.js +496 -0
- package/dist/exchanges/mexc/mexc-websocket.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/strategies/grid/grid-calculator.d.ts +7 -0
- package/dist/strategies/grid/grid-calculator.d.ts.map +1 -0
- package/dist/strategies/grid/grid-calculator.js +34 -0
- package/dist/strategies/grid/grid-calculator.js.map +1 -0
- package/dist/strategies/grid/grid-order-manager.d.ts +23 -0
- package/dist/strategies/grid/grid-order-manager.d.ts.map +1 -0
- package/dist/strategies/grid/grid-order-manager.js +99 -0
- package/dist/strategies/grid/grid-order-manager.js.map +1 -0
- package/dist/strategies/grid/grid-strategy.d.ts +29 -0
- package/dist/strategies/grid/grid-strategy.d.ts.map +1 -0
- package/dist/strategies/grid/grid-strategy.js +185 -0
- package/dist/strategies/grid/grid-strategy.js.map +1 -0
- package/dist/types/account.d.ts +21 -0
- package/dist/types/account.d.ts.map +1 -0
- package/dist/types/account.js +3 -0
- package/dist/types/account.js.map +1 -0
- package/dist/types/exchange.d.ts +67 -0
- package/dist/types/exchange.d.ts.map +1 -0
- package/dist/types/exchange.js +3 -0
- package/dist/types/exchange.js.map +1 -0
- package/dist/types/grid.d.ts +10 -0
- package/dist/types/grid.d.ts.map +1 -0
- package/dist/types/grid.js +3 -0
- package/dist/types/grid.js.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +27 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/iris.d.ts +58 -0
- package/dist/types/iris.d.ts.map +1 -0
- package/dist/types/iris.js +7 -0
- package/dist/types/iris.js.map +1 -0
- package/dist/types/market.d.ts +16 -0
- package/dist/types/market.d.ts.map +1 -0
- package/dist/types/market.js +3 -0
- package/dist/types/market.js.map +1 -0
- package/dist/types/mexc-raw.d.ts +87 -0
- package/dist/types/mexc-raw.d.ts.map +1 -0
- package/dist/types/mexc-raw.js +7 -0
- package/dist/types/mexc-raw.js.map +1 -0
- package/dist/types/mexc.d.ts +57 -0
- package/dist/types/mexc.d.ts.map +1 -0
- package/dist/types/mexc.js +8 -0
- package/dist/types/mexc.js.map +1 -0
- package/dist/types/price.d.ts +37 -0
- package/dist/types/price.d.ts.map +1 -0
- package/dist/types/price.js +7 -0
- package/dist/types/price.js.map +1 -0
- package/dist/types/risk.d.ts +22 -0
- package/dist/types/risk.d.ts.map +1 -0
- package/dist/types/risk.js +6 -0
- package/dist/types/risk.js.map +1 -0
- package/dist/types/strategy.d.ts +46 -0
- package/dist/types/strategy.d.ts.map +1 -0
- package/dist/types/strategy.js +3 -0
- package/dist/types/strategy.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +29 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +108 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/symbol-utils.d.ts +17 -0
- package/dist/utils/symbol-utils.d.ts.map +1 -0
- package/dist/utils/symbol-utils.js +41 -0
- package/dist/utils/symbol-utils.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MEXC Exchange Raw Data Types
|
|
3
|
+
* Represents the actual data structures returned by MEXC API
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* MEXC Raw Order Response
|
|
7
|
+
*/
|
|
8
|
+
export interface MexcRawOrder {
|
|
9
|
+
orderId?: string | number;
|
|
10
|
+
id?: string | number;
|
|
11
|
+
symbol: string;
|
|
12
|
+
status: 'NEW' | 'PARTIALLY_FILLED' | 'FILLED' | 'CANCELED' | 'CANCELLED' | 'REJECTED' | 'EXPIRED';
|
|
13
|
+
type: string;
|
|
14
|
+
side: string;
|
|
15
|
+
origQty?: string;
|
|
16
|
+
quantity?: string;
|
|
17
|
+
executedQty?: string;
|
|
18
|
+
price?: string;
|
|
19
|
+
time?: number;
|
|
20
|
+
updateTime?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* MEXC Raw Balance Response
|
|
24
|
+
*/
|
|
25
|
+
export interface MexcRawBalance {
|
|
26
|
+
asset: string;
|
|
27
|
+
free: string;
|
|
28
|
+
locked: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* MEXC Raw Account Response
|
|
32
|
+
*/
|
|
33
|
+
export interface MexcRawAccount {
|
|
34
|
+
balances: MexcRawBalance[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* MEXC Raw Price Data (for ticker)
|
|
38
|
+
*/
|
|
39
|
+
export interface MexcRawPrice {
|
|
40
|
+
symbol: string;
|
|
41
|
+
price: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* MEXC Raw 24hr Stats (for ticker)
|
|
45
|
+
*/
|
|
46
|
+
export interface MexcRaw24hrStats {
|
|
47
|
+
symbol: string;
|
|
48
|
+
bidPrice?: string;
|
|
49
|
+
askPrice?: string;
|
|
50
|
+
volume?: string;
|
|
51
|
+
priceChange?: string;
|
|
52
|
+
priceChangePercent?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* MEXC Raw Order Book Response
|
|
56
|
+
*/
|
|
57
|
+
export interface MexcRawOrderBook {
|
|
58
|
+
bids: [string, string][];
|
|
59
|
+
asks: [string, string][];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* MEXC Raw Trade Response
|
|
63
|
+
*/
|
|
64
|
+
export interface MexcRawTrade {
|
|
65
|
+
id?: string | number;
|
|
66
|
+
tradeId?: string | number;
|
|
67
|
+
price: string;
|
|
68
|
+
qty?: string;
|
|
69
|
+
quantity?: string;
|
|
70
|
+
time?: number;
|
|
71
|
+
isBuyerMaker?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* MEXC Raw WebSocket User Data Order Update
|
|
75
|
+
* Used for WebSocket user data stream messages
|
|
76
|
+
*/
|
|
77
|
+
export interface MexcRawUserDataOrder {
|
|
78
|
+
i?: string | number;
|
|
79
|
+
c?: string;
|
|
80
|
+
s?: number;
|
|
81
|
+
S?: number;
|
|
82
|
+
v?: string;
|
|
83
|
+
p?: string;
|
|
84
|
+
z?: string;
|
|
85
|
+
symbol?: string;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=mexc-raw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mexc-raw.d.ts","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,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACzB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mexc-raw.js","sourceRoot":"","sources":["../../src/types/mexc-raw.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MEXC Exchange Specific Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for MEXC protobuf messages and exchange-specific data structures
|
|
5
|
+
*/
|
|
6
|
+
import { Order, OrderBook, Ticker, Trade } from './index';
|
|
7
|
+
export interface DecodedMexcOrder {
|
|
8
|
+
orderId: string;
|
|
9
|
+
symbol: string;
|
|
10
|
+
price: number;
|
|
11
|
+
quantity: number;
|
|
12
|
+
side: 'buy' | 'sell';
|
|
13
|
+
status: string;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
channel: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DecodedMexcTickerData {
|
|
18
|
+
bidprice: string;
|
|
19
|
+
askprice: string;
|
|
20
|
+
bidquantity: string;
|
|
21
|
+
askquantity: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DecodedMexcTradesData {
|
|
24
|
+
dealsList: Array<{
|
|
25
|
+
price: string;
|
|
26
|
+
quantity: string;
|
|
27
|
+
time: string;
|
|
28
|
+
tradetype: number;
|
|
29
|
+
}>;
|
|
30
|
+
eventtype: string;
|
|
31
|
+
}
|
|
32
|
+
export interface DecodedMexcMessage {
|
|
33
|
+
type: 'order' | 'ticker' | 'orderbook' | 'trades' | 'unknown';
|
|
34
|
+
raw: string;
|
|
35
|
+
channel: string;
|
|
36
|
+
symbol?: string;
|
|
37
|
+
decoded?: DecodedMexcOrder | DecodedMexcTickerData | DecodedMexcTradesData;
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface MexcSubscription {
|
|
41
|
+
method: 'SUBSCRIPTION' | 'UNSUBSCRIPTION';
|
|
42
|
+
params: string[];
|
|
43
|
+
}
|
|
44
|
+
export type SubscriptionInfo = {
|
|
45
|
+
callback: (data: Ticker) => void;
|
|
46
|
+
type: 'ticker';
|
|
47
|
+
} | {
|
|
48
|
+
callback: (data: OrderBook) => void;
|
|
49
|
+
type: 'orderbook';
|
|
50
|
+
} | {
|
|
51
|
+
callback: (data: Trade) => void;
|
|
52
|
+
type: 'trades';
|
|
53
|
+
} | {
|
|
54
|
+
callback: (data: Order) => void;
|
|
55
|
+
type: 'user_data';
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=mexc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mexc.d.ts","sourceRoot":"","sources":["../../src/types/mexc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,E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IACjC,IAAI,EAAE,QAAQ,CAAC;CAChB,GACD;IACE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACpC,IAAI,EAAE,WAAW,CAAC;CACnB,GACD;IACE,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,IAAI,EAAE,QAAQ,CAAC;CAChB,GACD;IACE,QAAQ,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mexc.js","sourceRoot":"","sources":["../../src/types/mexc.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Price Aggregation Types
|
|
3
|
+
* Universal price service supporting any token pair across multiple exchanges
|
|
4
|
+
*/
|
|
5
|
+
export interface PriceSource {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
exchange: string;
|
|
9
|
+
reliability: number;
|
|
10
|
+
latency: number;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface PriceData {
|
|
14
|
+
symbol: string;
|
|
15
|
+
price: number;
|
|
16
|
+
timestamp: Date;
|
|
17
|
+
source: string;
|
|
18
|
+
volume24h?: number;
|
|
19
|
+
change24h?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface AggregatedPrice {
|
|
22
|
+
symbol: string;
|
|
23
|
+
price: number;
|
|
24
|
+
confidence: number;
|
|
25
|
+
timestamp: Date;
|
|
26
|
+
sources: PriceSource[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Cardano token configuration for price aggregation
|
|
30
|
+
*/
|
|
31
|
+
export interface CardanoTokenConfig {
|
|
32
|
+
symbol: string;
|
|
33
|
+
policyId: string;
|
|
34
|
+
assetName: string;
|
|
35
|
+
minLiquidityThreshold?: number;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=price.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../src/types/price.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price.js","sourceRoot":"","sources":["../../src/types/price.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Risk Management Types
|
|
3
|
+
*/
|
|
4
|
+
export interface RiskManagerConfig {
|
|
5
|
+
maxPositionSize: number;
|
|
6
|
+
safetyReservePercentage: number;
|
|
7
|
+
minConfidence: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Safety reserve configuration for base and quote currencies
|
|
11
|
+
*/
|
|
12
|
+
export interface SafetyReserves {
|
|
13
|
+
base: {
|
|
14
|
+
minimum: number;
|
|
15
|
+
percentage: number;
|
|
16
|
+
};
|
|
17
|
+
quote: {
|
|
18
|
+
minimum: number;
|
|
19
|
+
percentage: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=risk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk.d.ts","sourceRoot":"","sources":["../../src/types/risk.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,iBAAiB;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,MAAM,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE;QACJ,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk.js","sourceRoot":"","sources":["../../src/types/risk.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy types supported by OpenMM
|
|
3
|
+
*/
|
|
4
|
+
export type StrategyType = 'grid';
|
|
5
|
+
/**
|
|
6
|
+
* Strategy execution status
|
|
7
|
+
*/
|
|
8
|
+
export type StrategyStatus = 'idle' | 'running' | 'stopped' | 'error';
|
|
9
|
+
/**
|
|
10
|
+
* Basic strategy configuration
|
|
11
|
+
*/
|
|
12
|
+
export interface StrategyConfig {
|
|
13
|
+
id: string;
|
|
14
|
+
type: StrategyType;
|
|
15
|
+
symbol: string;
|
|
16
|
+
exchange: string;
|
|
17
|
+
accountId: string;
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Grid configuration
|
|
22
|
+
*/
|
|
23
|
+
export interface GridConfig {
|
|
24
|
+
symbol: string;
|
|
25
|
+
gridLevels: number;
|
|
26
|
+
gridSpacing: number;
|
|
27
|
+
orderSize: number;
|
|
28
|
+
minConfidence: number;
|
|
29
|
+
priceDeviationThreshold: number;
|
|
30
|
+
adjustmentDebounce: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Grid strategy specific configuration
|
|
34
|
+
*/
|
|
35
|
+
export interface GridStrategyConfig extends StrategyConfig {
|
|
36
|
+
type: 'grid';
|
|
37
|
+
gridConfig: GridConfig;
|
|
38
|
+
parameters: {
|
|
39
|
+
gridLevels: number;
|
|
40
|
+
gridSpacing: number;
|
|
41
|
+
orderSize: number;
|
|
42
|
+
upperPrice: number;
|
|
43
|
+
lowerPrice: number;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../../src/types/strategy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../src/types/strategy.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logger = exports.createLogger = exports.Logger = void 0;
|
|
4
|
+
var logger_1 = require("./logger");
|
|
5
|
+
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });
|
|
6
|
+
Object.defineProperty(exports, "createLogger", { enumerable: true, get: function () { return logger_1.createLogger; } });
|
|
7
|
+
Object.defineProperty(exports, "logger", { enumerable: true, get: function () { return logger_1.logger; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,mCAA8E;AAArE,gGAAA,MAAM,OAAA;AAAE,sGAAA,YAAY,OAAA;AAAE,gGAAA,MAAM,OAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type LogLevel = 'error' | 'warn' | 'info' | 'debug';
|
|
2
|
+
export interface LogContext {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Minimal Winston-based logger
|
|
7
|
+
* Supports console + optional file logging
|
|
8
|
+
*/
|
|
9
|
+
export declare class Logger {
|
|
10
|
+
private winston;
|
|
11
|
+
constructor(service: string, logFile?: string);
|
|
12
|
+
error(message: string, context?: LogContext): void;
|
|
13
|
+
warn(message: string, context?: LogContext): void;
|
|
14
|
+
info(message: string, context?: LogContext): void;
|
|
15
|
+
debug(message: string, context?: LogContext): void;
|
|
16
|
+
/**
|
|
17
|
+
* Log error objects with stack traces
|
|
18
|
+
*/
|
|
19
|
+
logError(error: Error, context?: LogContext): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create a new logger instance
|
|
23
|
+
*/
|
|
24
|
+
export declare function createLogger(service: string, logFile?: string): Logger;
|
|
25
|
+
/**
|
|
26
|
+
* Default logger instance
|
|
27
|
+
*/
|
|
28
|
+
export declare const logger: Logger;
|
|
29
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;GAGG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,OAAO,CAAiB;gBAEpB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAyC7C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI;IAIlD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI;IAIjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI;IAIjD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI;IAIlD;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI;CAUnD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,QAAyB,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.logger = exports.Logger = void 0;
|
|
37
|
+
exports.createLogger = createLogger;
|
|
38
|
+
const winston = __importStar(require("winston"));
|
|
39
|
+
/**
|
|
40
|
+
* Minimal Winston-based logger
|
|
41
|
+
* Supports console + optional file logging
|
|
42
|
+
*/
|
|
43
|
+
class Logger {
|
|
44
|
+
constructor(service, logFile) {
|
|
45
|
+
const transports = [
|
|
46
|
+
new winston.transports.Console({
|
|
47
|
+
format: winston.format.combine(winston.format.timestamp({ format: 'HH:mm:ss' }), winston.format.colorize(), winston.format.printf(({ timestamp, level, message, service, ...meta }) => {
|
|
48
|
+
const metaStr = Object.keys(meta).length ? ` ${JSON.stringify(meta)}` : '';
|
|
49
|
+
return `${timestamp} [${service}] ${level}: ${message}${metaStr}`;
|
|
50
|
+
}))
|
|
51
|
+
})
|
|
52
|
+
];
|
|
53
|
+
if (logFile) {
|
|
54
|
+
const fileFormat = winston.format.combine(winston.format.timestamp(), winston.format.json());
|
|
55
|
+
transports.push(new winston.transports.File({
|
|
56
|
+
filename: logFile,
|
|
57
|
+
format: fileFormat
|
|
58
|
+
}), new winston.transports.File({
|
|
59
|
+
filename: logFile.replace('.log', '-error.log'),
|
|
60
|
+
level: 'error',
|
|
61
|
+
format: fileFormat
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
this.winston = winston.createLogger({
|
|
65
|
+
level: 'debug',
|
|
66
|
+
defaultMeta: { service },
|
|
67
|
+
transports,
|
|
68
|
+
exitOnError: false
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
error(message, context) {
|
|
72
|
+
this.winston.error(message, context);
|
|
73
|
+
}
|
|
74
|
+
warn(message, context) {
|
|
75
|
+
this.winston.warn(message, context);
|
|
76
|
+
}
|
|
77
|
+
info(message, context) {
|
|
78
|
+
this.winston.info(message, context);
|
|
79
|
+
}
|
|
80
|
+
debug(message, context) {
|
|
81
|
+
this.winston.debug(message, context);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Log error objects with stack traces
|
|
85
|
+
*/
|
|
86
|
+
logError(error, context) {
|
|
87
|
+
this.winston.error('Error occurred', {
|
|
88
|
+
...context,
|
|
89
|
+
error: {
|
|
90
|
+
name: error.name,
|
|
91
|
+
message: error.message,
|
|
92
|
+
stack: error.stack
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.Logger = Logger;
|
|
98
|
+
/**
|
|
99
|
+
* Create a new logger instance
|
|
100
|
+
*/
|
|
101
|
+
function createLogger(service, logFile) {
|
|
102
|
+
return new Logger(service, logFile);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Default logger instance
|
|
106
|
+
*/
|
|
107
|
+
exports.logger = createLogger('openmm');
|
|
108
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,oCAEC;A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|
|
|
1
|
+
/**
|
|
2
|
+
* Symbol Utility Functions
|
|
3
|
+
* Centralizes symbol format conversion logic used across exchanges and strategies
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseSymbol(symbol: string): {
|
|
6
|
+
base: string;
|
|
7
|
+
quote: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Convert symbol to standard format (INDY/USDT)
|
|
11
|
+
*/
|
|
12
|
+
export declare function toStandardFormat(symbol: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Convert symbol to exchange format (INDYUSDT)
|
|
15
|
+
*/
|
|
16
|
+
export declare function toExchangeFormat(symbol: string): string;
|
|
17
|
+
//# sourceMappingURL=symbol-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-utils.d.ts","sourceRoot":"","sources":["../../src/utils/symbol-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAoB3E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGvD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Symbol Utility Functions
|
|
4
|
+
* Centralizes symbol format conversion logic used across exchanges and strategies
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.parseSymbol = parseSymbol;
|
|
8
|
+
exports.toStandardFormat = toStandardFormat;
|
|
9
|
+
exports.toExchangeFormat = toExchangeFormat;
|
|
10
|
+
function parseSymbol(symbol) {
|
|
11
|
+
const symbolUpper = symbol.toUpperCase().trim();
|
|
12
|
+
if (symbolUpper.includes('/')) {
|
|
13
|
+
const [base, quote] = symbolUpper.split('/');
|
|
14
|
+
return { base: base.trim(), quote: quote.trim() };
|
|
15
|
+
}
|
|
16
|
+
const quoteCurrencies = ['USDT', 'USDC', 'BUSD', 'USD', 'BTC', 'ETH', 'BNB'];
|
|
17
|
+
for (const quote of quoteCurrencies) {
|
|
18
|
+
if (symbolUpper.endsWith(quote)) {
|
|
19
|
+
const base = symbolUpper.slice(0, -quote.length);
|
|
20
|
+
if (base.length > 0) {
|
|
21
|
+
return { base, quote };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
throw new Error(`Unable to parse symbol: ${symbol}`);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Convert symbol to standard format (INDY/USDT)
|
|
29
|
+
*/
|
|
30
|
+
function toStandardFormat(symbol) {
|
|
31
|
+
const { base, quote } = parseSymbol(symbol);
|
|
32
|
+
return `${base}/${quote}`;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Convert symbol to exchange format (INDYUSDT)
|
|
36
|
+
*/
|
|
37
|
+
function toExchangeFormat(symbol) {
|
|
38
|
+
const { base, quote } = parseSymbol(symbol);
|
|
39
|
+
return `${base}${quote}`;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=symbol-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-utils.js","sourceRoot":"","sources":["../../src/utils/symbol-utils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,kCAoBC;AAKD,4CAGC;AAKD,4CAGC;AApCD,SAAgB,WAAW,CAAC,MAAc;IACxC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IAEhD,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK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",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"openmm": "dist/cli/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc --project tsconfig.build.json",
|
|
12
|
+
"dev": "ts-node src/index.ts",
|
|
13
|
+
"cli": "ts-node src/cli/cli.ts",
|
|
14
|
+
"test": "jest",
|
|
15
|
+
"test:unit": "jest --testPathIgnorePatterns=integration",
|
|
16
|
+
"test:integration": "jest --testPathPattern=integration --runInBand",
|
|
17
|
+
"test:coverage": "jest --coverage --coverageReporters=html && open coverage/index.html",
|
|
18
|
+
"lint": "eslint src/**/*.ts",
|
|
19
|
+
"start": "node dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"market-making",
|
|
26
|
+
"trading",
|
|
27
|
+
"crypto",
|
|
28
|
+
"exchange"
|
|
29
|
+
],
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"chalk": "^4.1.2",
|
|
34
|
+
"commander": "^14.0.2",
|
|
35
|
+
"dotenv": "^16.6.1",
|
|
36
|
+
"winston": "^3.11.0",
|
|
37
|
+
"ws": "^8.14.2"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@eslint/js": "^9.39.1",
|
|
41
|
+
"@types/commander": "^2.12.0",
|
|
42
|
+
"@types/jest": "^30.0.0",
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"@types/ws": "^8.5.0",
|
|
45
|
+
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
|
46
|
+
"@typescript-eslint/parser": "^8.48.0",
|
|
47
|
+
"eslint": "^9.39.1",
|
|
48
|
+
"jest": "^29.0.0",
|
|
49
|
+
"ts-jest": "^29.0.0",
|
|
50
|
+
"ts-node": "^10.9.0",
|
|
51
|
+
"typescript": "^5.0.0"
|
|
52
|
+
}
|
|
53
|
+
}
|