@tradejs/infra 2.0.21 → 3.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/dist/{chunk-YVIHTUV5.mjs → chunk-OLB6NQRG.mjs} +1 -1
- package/dist/{chunk-I2J6YDBD.mjs → chunk-ZXU7OYFU.mjs} +65 -38
- package/dist/internal-BuHqoCCV.d.mts +9 -0
- package/dist/internal-q48Torp4.d.ts +9 -0
- package/dist/ml.mjs +3 -3
- package/dist/query-tkHVD4Xo.d.mts +12 -0
- package/dist/query-tkHVD4Xo.d.ts +12 -0
- package/dist/timescale/candles.js +6 -4
- package/dist/timescale/candles.mjs +2 -2
- package/dist/timescale/client.d.mts +3 -2
- package/dist/timescale/client.d.ts +3 -2
- package/dist/timescale/client.js +40 -15
- package/dist/timescale/client.mjs +2 -2
- package/dist/timescale/derivatives.d.mts +4 -2
- package/dist/timescale/derivatives.d.ts +4 -2
- package/dist/timescale/derivatives.js +20 -12
- package/dist/timescale/derivatives.mjs +479 -13
- package/dist/timescale/hyperliquidWhales.d.mts +29 -25
- package/dist/timescale/hyperliquidWhales.d.ts +29 -25
- package/dist/timescale/hyperliquidWhales.js +84 -71
- package/dist/timescale/hyperliquidWhales.mjs +1103 -14
- package/dist/timescale/marketContext.d.mts +15 -11
- package/dist/timescale/marketContext.d.ts +15 -11
- package/dist/timescale/marketContext.js +67 -57
- package/dist/timescale/marketContext.mjs +1259 -28
- package/dist/timescale/spread.js +6 -4
- package/dist/timescale/spread.mjs +105 -5
- package/dist/userSettings.js +3 -316
- package/dist/userSettings.mjs +3 -21
- package/package.json +2 -22
- package/dist/aiEndpoints.d.mts +0 -10
- package/dist/aiEndpoints.d.ts +0 -10
- package/dist/aiEndpoints.js +0 -159
- package/dist/aiEndpoints.mjs +0 -12
- package/dist/aiLanguages.d.mts +0 -11
- package/dist/aiLanguages.d.ts +0 -11
- package/dist/aiLanguages.js +0 -71
- package/dist/aiLanguages.mjs +0 -12
- package/dist/aiModels.d.mts +0 -12
- package/dist/aiModels.d.ts +0 -12
- package/dist/aiModels.js +0 -272
- package/dist/aiModels.mjs +0 -17
- package/dist/chunk-2CZREG43.mjs +0 -112
- package/dist/chunk-CCC7DX2T.mjs +0 -44
- package/dist/chunk-DFMKDB2R.mjs +0 -1285
- package/dist/chunk-DTCLZIBM.mjs +0 -163
- package/dist/chunk-NWXFWTWU.mjs +0 -1114
- package/dist/chunk-SZQB7ER5.mjs +0 -492
- package/dist/chunk-XQ3YBULV.mjs +0 -132
- package/dist/internal-2coHaaos.d.mts +0 -26
- package/dist/internal-2coHaaos.d.ts +0 -26
- package/dist/timescale.d.mts +0 -9
- package/dist/timescale.d.ts +0 -9
- package/dist/timescale.js +0 -4228
- package/dist/timescale.mjs +0 -138
|
@@ -97,42 +97,7 @@ var toMarketFeatureAge = (rowTs, atMs) => {
|
|
|
97
97
|
return Number.isFinite(ageMs) ? ageMs : null;
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
// src/timescale/
|
|
101
|
-
var candlesSchemaReady = false;
|
|
102
|
-
var derivativesSchemaReady = false;
|
|
103
|
-
var spreadSchemaReady = false;
|
|
104
|
-
var binanceMarketSchemaReady = false;
|
|
105
|
-
var hyperliquidWhaleSchemaReady = false;
|
|
106
|
-
var candlesSchemaReadyPromise = null;
|
|
107
|
-
var derivativesSchemaReadyPromise = null;
|
|
108
|
-
var spreadSchemaReadyPromise = null;
|
|
109
|
-
var binanceMarketSchemaReadyPromise = null;
|
|
110
|
-
var hyperliquidWhaleSchemaReadyPromise = null;
|
|
111
|
-
var marketContextSchemaMode = "ensure";
|
|
112
|
-
var verifiedMarketContextSchemas = /* @__PURE__ */ new Set();
|
|
113
|
-
var configureTimescaleMarketContextSchemaMode = (mode) => {
|
|
114
|
-
marketContextSchemaMode = mode;
|
|
115
|
-
verifiedMarketContextSchemas.clear();
|
|
116
|
-
};
|
|
117
|
-
var closeTimescalePool = async () => {
|
|
118
|
-
candlesSchemaReady = false;
|
|
119
|
-
derivativesSchemaReady = false;
|
|
120
|
-
spreadSchemaReady = false;
|
|
121
|
-
binanceMarketSchemaReady = false;
|
|
122
|
-
hyperliquidWhaleSchemaReady = false;
|
|
123
|
-
candlesSchemaReadyPromise = null;
|
|
124
|
-
derivativesSchemaReadyPromise = null;
|
|
125
|
-
spreadSchemaReadyPromise = null;
|
|
126
|
-
binanceMarketSchemaReadyPromise = null;
|
|
127
|
-
hyperliquidWhaleSchemaReadyPromise = null;
|
|
128
|
-
verifiedMarketContextSchemas.clear();
|
|
129
|
-
await closePool();
|
|
130
|
-
};
|
|
131
|
-
var CANDLES_SCHEMA_LOCK_KEY = 61e4;
|
|
132
|
-
var DERIVATIVES_SCHEMA_LOCK_KEY = 610001;
|
|
133
|
-
var SPREAD_SCHEMA_LOCK_KEY = 610002;
|
|
134
|
-
var BINANCE_MARKET_SCHEMA_LOCK_KEY = 610003;
|
|
135
|
-
var HYPERLIQUID_WHALE_SCHEMA_LOCK_KEY = 610004;
|
|
100
|
+
// src/timescale/schema/lifecycle.ts
|
|
136
101
|
var withSchemaLock = async (lockKey, work) => {
|
|
137
102
|
const pool = getPool();
|
|
138
103
|
await pool.query("SELECT pg_advisory_lock($1)", [lockKey]);
|
|
@@ -142,6 +107,15 @@ var withSchemaLock = async (lockKey, work) => {
|
|
|
142
107
|
await pool.query("SELECT pg_advisory_unlock($1)", [lockKey]);
|
|
143
108
|
}
|
|
144
109
|
};
|
|
110
|
+
|
|
111
|
+
// src/timescale/schema/candles.ts
|
|
112
|
+
var candlesSchemaReady = false;
|
|
113
|
+
var candlesSchemaReadyPromise = null;
|
|
114
|
+
var CANDLES_SCHEMA_LOCK_KEY = 61e4;
|
|
115
|
+
var resetCandlesSchemaState = () => {
|
|
116
|
+
candlesSchemaReady = false;
|
|
117
|
+
candlesSchemaReadyPromise = null;
|
|
118
|
+
};
|
|
145
119
|
var ensureCandlesSchema = async () => {
|
|
146
120
|
if (candlesSchemaReady) return;
|
|
147
121
|
if (candlesSchemaReadyPromise) {
|
|
@@ -198,6 +172,15 @@ var ensureCandlesSchema = async () => {
|
|
|
198
172
|
});
|
|
199
173
|
await candlesSchemaReadyPromise;
|
|
200
174
|
};
|
|
175
|
+
|
|
176
|
+
// src/timescale/schema/derivatives.ts
|
|
177
|
+
var derivativesSchemaReady = false;
|
|
178
|
+
var derivativesSchemaReadyPromise = null;
|
|
179
|
+
var DERIVATIVES_SCHEMA_LOCK_KEY = 610001;
|
|
180
|
+
var resetDerivativesSchemaState = () => {
|
|
181
|
+
derivativesSchemaReady = false;
|
|
182
|
+
derivativesSchemaReadyPromise = null;
|
|
183
|
+
};
|
|
201
184
|
var ensureDerivativesSchema = async () => {
|
|
202
185
|
if (derivativesSchemaReady) return;
|
|
203
186
|
if (derivativesSchemaReadyPromise) {
|
|
@@ -285,6 +268,15 @@ var ensureDerivativesSchema = async () => {
|
|
|
285
268
|
});
|
|
286
269
|
await derivativesSchemaReadyPromise;
|
|
287
270
|
};
|
|
271
|
+
|
|
272
|
+
// src/timescale/schema/spread.ts
|
|
273
|
+
var spreadSchemaReady = false;
|
|
274
|
+
var spreadSchemaReadyPromise = null;
|
|
275
|
+
var SPREAD_SCHEMA_LOCK_KEY = 610002;
|
|
276
|
+
var resetSpreadSchemaState = () => {
|
|
277
|
+
spreadSchemaReady = false;
|
|
278
|
+
spreadSchemaReadyPromise = null;
|
|
279
|
+
};
|
|
288
280
|
var ensureSpreadSchema = async () => {
|
|
289
281
|
if (spreadSchemaReady) return;
|
|
290
282
|
if (spreadSchemaReadyPromise) {
|
|
@@ -329,6 +321,15 @@ var ensureSpreadSchema = async () => {
|
|
|
329
321
|
});
|
|
330
322
|
await spreadSchemaReadyPromise;
|
|
331
323
|
};
|
|
324
|
+
|
|
325
|
+
// src/timescale/schema/marketContext.ts
|
|
326
|
+
var binanceMarketSchemaReady = false;
|
|
327
|
+
var binanceMarketSchemaReadyPromise = null;
|
|
328
|
+
var BINANCE_MARKET_SCHEMA_LOCK_KEY = 610003;
|
|
329
|
+
var resetMarketContextSchemaState = () => {
|
|
330
|
+
binanceMarketSchemaReady = false;
|
|
331
|
+
binanceMarketSchemaReadyPromise = null;
|
|
332
|
+
};
|
|
332
333
|
var ensureBinanceMarketSchema = async () => {
|
|
333
334
|
if (binanceMarketSchemaReady) return;
|
|
334
335
|
if (binanceMarketSchemaReadyPromise) {
|
|
@@ -609,6 +610,15 @@ var ensureBinanceMarketSchema = async () => {
|
|
|
609
610
|
});
|
|
610
611
|
await binanceMarketSchemaReadyPromise;
|
|
611
612
|
};
|
|
613
|
+
|
|
614
|
+
// src/timescale/schema/hyperliquidWhales.ts
|
|
615
|
+
var hyperliquidWhaleSchemaReady = false;
|
|
616
|
+
var hyperliquidWhaleSchemaReadyPromise = null;
|
|
617
|
+
var HYPERLIQUID_WHALE_SCHEMA_LOCK_KEY = 610004;
|
|
618
|
+
var resetHyperliquidWhalesSchemaState = () => {
|
|
619
|
+
hyperliquidWhaleSchemaReady = false;
|
|
620
|
+
hyperliquidWhaleSchemaReadyPromise = null;
|
|
621
|
+
};
|
|
612
622
|
var ensureHyperliquidWhaleSchema = async () => {
|
|
613
623
|
if (hyperliquidWhaleSchemaReady) return;
|
|
614
624
|
if (hyperliquidWhaleSchemaReadyPromise) {
|
|
@@ -837,6 +847,23 @@ var ensureHyperliquidWhaleSchema = async () => {
|
|
|
837
847
|
});
|
|
838
848
|
await hyperliquidWhaleSchemaReadyPromise;
|
|
839
849
|
};
|
|
850
|
+
|
|
851
|
+
// src/timescale/internal.ts
|
|
852
|
+
var marketContextSchemaMode = "ensure";
|
|
853
|
+
var verifiedMarketContextSchemas = /* @__PURE__ */ new Set();
|
|
854
|
+
var configureTimescaleMarketContextSchemaMode = (mode) => {
|
|
855
|
+
marketContextSchemaMode = mode;
|
|
856
|
+
verifiedMarketContextSchemas.clear();
|
|
857
|
+
};
|
|
858
|
+
var closeTimescalePool = async () => {
|
|
859
|
+
resetCandlesSchemaState();
|
|
860
|
+
resetDerivativesSchemaState();
|
|
861
|
+
resetSpreadSchemaState();
|
|
862
|
+
resetMarketContextSchemaState();
|
|
863
|
+
resetHyperliquidWhalesSchemaState();
|
|
864
|
+
verifiedMarketContextSchemas.clear();
|
|
865
|
+
await closePool();
|
|
866
|
+
};
|
|
840
867
|
var ensureCoinMarketCapContextSchema = async () => ensureBinanceMarketSchema();
|
|
841
868
|
var ensureMarketContextSchema = async (source) => {
|
|
842
869
|
switch (source) {
|
|
@@ -897,13 +924,13 @@ export {
|
|
|
897
924
|
normalizeCandleSymbol,
|
|
898
925
|
getSafeBulkInsertRows,
|
|
899
926
|
toMarketFeatureAge,
|
|
900
|
-
configureTimescaleMarketContextSchemaMode,
|
|
901
|
-
closeTimescalePool,
|
|
902
927
|
ensureCandlesSchema,
|
|
903
928
|
ensureDerivativesSchema,
|
|
904
929
|
ensureSpreadSchema,
|
|
905
930
|
ensureBinanceMarketSchema,
|
|
906
931
|
ensureHyperliquidWhaleSchema,
|
|
932
|
+
configureTimescaleMarketContextSchemaMode,
|
|
933
|
+
closeTimescalePool,
|
|
907
934
|
ensureCoinMarketCapContextSchema,
|
|
908
935
|
prepareMarketContextSchemaForRead,
|
|
909
936
|
ensureMarketContextSchemas
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './query-tkHVD4Xo.mjs';
|
|
2
|
+
|
|
3
|
+
type TimescaleMarketContextSource = 'binance' | 'coinmarketcap' | 'derivatives' | 'hyperliquidWhales';
|
|
4
|
+
declare const configureTimescaleMarketContextSchemaMode: (mode: "ensure" | "verify") => void;
|
|
5
|
+
declare const closeTimescalePool: () => Promise<void>;
|
|
6
|
+
declare const ensureCoinMarketCapContextSchema: () => Promise<void>;
|
|
7
|
+
declare const ensureMarketContextSchemas: (sources: Iterable<TimescaleMarketContextSource>) => Promise<void>;
|
|
8
|
+
|
|
9
|
+
export { type TimescaleMarketContextSource as T, configureTimescaleMarketContextSchemaMode as a, ensureMarketContextSchemas as b, closeTimescalePool as c, ensureCoinMarketCapContextSchema as e };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './query-tkHVD4Xo.js';
|
|
2
|
+
|
|
3
|
+
type TimescaleMarketContextSource = 'binance' | 'coinmarketcap' | 'derivatives' | 'hyperliquidWhales';
|
|
4
|
+
declare const configureTimescaleMarketContextSchemaMode: (mode: "ensure" | "verify") => void;
|
|
5
|
+
declare const closeTimescalePool: () => Promise<void>;
|
|
6
|
+
declare const ensureCoinMarketCapContextSchema: () => Promise<void>;
|
|
7
|
+
declare const ensureMarketContextSchemas: (sources: Iterable<TimescaleMarketContextSource>) => Promise<void>;
|
|
8
|
+
|
|
9
|
+
export { type TimescaleMarketContextSource as T, configureTimescaleMarketContextSchemaMode as a, ensureMarketContextSchemas as b, closeTimescalePool as c, ensureCoinMarketCapContextSchema as e };
|
package/dist/ml.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
logger
|
|
3
|
-
} from "./chunk-LNFUOXDW.mjs";
|
|
4
1
|
import {
|
|
5
2
|
appendMlDatasetRow,
|
|
6
3
|
closeAllMlDatasetWriters,
|
|
@@ -13,6 +10,9 @@ import {
|
|
|
13
10
|
mergeJsonlFiles,
|
|
14
11
|
toFileToken
|
|
15
12
|
} from "./chunk-RQP5VSTH.mjs";
|
|
13
|
+
import {
|
|
14
|
+
logger
|
|
15
|
+
} from "./chunk-LNFUOXDW.mjs";
|
|
16
16
|
|
|
17
17
|
// src/mlGrpc.ts
|
|
18
18
|
import path from "path";
|
|
@@ -57,10 +57,7 @@ var getPool = () => {
|
|
|
57
57
|
var normalizeCandleProvider = (provider) => String(provider || "").trim().toLowerCase();
|
|
58
58
|
var normalizeCandleSymbol = (symbol) => String(symbol || "").trim().toUpperCase();
|
|
59
59
|
|
|
60
|
-
// src/timescale/
|
|
61
|
-
var candlesSchemaReady = false;
|
|
62
|
-
var candlesSchemaReadyPromise = null;
|
|
63
|
-
var CANDLES_SCHEMA_LOCK_KEY = 61e4;
|
|
60
|
+
// src/timescale/schema/lifecycle.ts
|
|
64
61
|
var withSchemaLock = async (lockKey, work) => {
|
|
65
62
|
const pool = getPool();
|
|
66
63
|
await pool.query("SELECT pg_advisory_lock($1)", [lockKey]);
|
|
@@ -70,6 +67,11 @@ var withSchemaLock = async (lockKey, work) => {
|
|
|
70
67
|
await pool.query("SELECT pg_advisory_unlock($1)", [lockKey]);
|
|
71
68
|
}
|
|
72
69
|
};
|
|
70
|
+
|
|
71
|
+
// src/timescale/schema/candles.ts
|
|
72
|
+
var candlesSchemaReady = false;
|
|
73
|
+
var candlesSchemaReadyPromise = null;
|
|
74
|
+
var CANDLES_SCHEMA_LOCK_KEY = 61e4;
|
|
73
75
|
var ensureCandlesSchema = async () => {
|
|
74
76
|
if (candlesSchemaReady) return;
|
|
75
77
|
if (candlesSchemaReadyPromise) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { T as
|
|
1
|
+
export { T as TimescaleMarketContextSource, c as closeTimescalePool, a as configureTimescaleMarketContextSchemaMode } from '../internal-BuHqoCCV.mjs';
|
|
2
2
|
export { waitForDbReady } from './candles.mjs';
|
|
3
|
-
|
|
3
|
+
export { T as TimescaleMarketContextQueryOptions } from '../query-tkHVD4Xo.mjs';
|
|
4
4
|
import '@tradejs/types';
|
|
5
|
+
import 'pg';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { T as
|
|
1
|
+
export { T as TimescaleMarketContextSource, c as closeTimescalePool, a as configureTimescaleMarketContextSchemaMode } from '../internal-q48Torp4.js';
|
|
2
2
|
export { waitForDbReady } from './candles.js';
|
|
3
|
-
|
|
3
|
+
export { T as TimescaleMarketContextQueryOptions } from '../query-tkHVD4Xo.js';
|
|
4
4
|
import '@tradejs/types';
|
|
5
|
+
import 'pg';
|
package/dist/timescale/client.js
CHANGED
|
@@ -54,17 +54,47 @@ var closePool = async () => {
|
|
|
54
54
|
await pool.end();
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
// src/timescale/
|
|
57
|
+
// src/timescale/schema/candles.ts
|
|
58
58
|
var candlesSchemaReady = false;
|
|
59
|
-
var derivativesSchemaReady = false;
|
|
60
|
-
var spreadSchemaReady = false;
|
|
61
|
-
var binanceMarketSchemaReady = false;
|
|
62
|
-
var hyperliquidWhaleSchemaReady = false;
|
|
63
59
|
var candlesSchemaReadyPromise = null;
|
|
60
|
+
var resetCandlesSchemaState = () => {
|
|
61
|
+
candlesSchemaReady = false;
|
|
62
|
+
candlesSchemaReadyPromise = null;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/timescale/schema/derivatives.ts
|
|
66
|
+
var derivativesSchemaReady = false;
|
|
64
67
|
var derivativesSchemaReadyPromise = null;
|
|
68
|
+
var resetDerivativesSchemaState = () => {
|
|
69
|
+
derivativesSchemaReady = false;
|
|
70
|
+
derivativesSchemaReadyPromise = null;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// src/timescale/schema/spread.ts
|
|
74
|
+
var spreadSchemaReady = false;
|
|
65
75
|
var spreadSchemaReadyPromise = null;
|
|
76
|
+
var resetSpreadSchemaState = () => {
|
|
77
|
+
spreadSchemaReady = false;
|
|
78
|
+
spreadSchemaReadyPromise = null;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// src/timescale/schema/marketContext.ts
|
|
82
|
+
var binanceMarketSchemaReady = false;
|
|
66
83
|
var binanceMarketSchemaReadyPromise = null;
|
|
84
|
+
var resetMarketContextSchemaState = () => {
|
|
85
|
+
binanceMarketSchemaReady = false;
|
|
86
|
+
binanceMarketSchemaReadyPromise = null;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// src/timescale/schema/hyperliquidWhales.ts
|
|
90
|
+
var hyperliquidWhaleSchemaReady = false;
|
|
67
91
|
var hyperliquidWhaleSchemaReadyPromise = null;
|
|
92
|
+
var resetHyperliquidWhalesSchemaState = () => {
|
|
93
|
+
hyperliquidWhaleSchemaReady = false;
|
|
94
|
+
hyperliquidWhaleSchemaReadyPromise = null;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// src/timescale/internal.ts
|
|
68
98
|
var marketContextSchemaMode = "ensure";
|
|
69
99
|
var verifiedMarketContextSchemas = /* @__PURE__ */ new Set();
|
|
70
100
|
var configureTimescaleMarketContextSchemaMode = (mode) => {
|
|
@@ -72,16 +102,11 @@ var configureTimescaleMarketContextSchemaMode = (mode) => {
|
|
|
72
102
|
verifiedMarketContextSchemas.clear();
|
|
73
103
|
};
|
|
74
104
|
var closeTimescalePool = async () => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
candlesSchemaReadyPromise = null;
|
|
81
|
-
derivativesSchemaReadyPromise = null;
|
|
82
|
-
spreadSchemaReadyPromise = null;
|
|
83
|
-
binanceMarketSchemaReadyPromise = null;
|
|
84
|
-
hyperliquidWhaleSchemaReadyPromise = null;
|
|
105
|
+
resetCandlesSchemaState();
|
|
106
|
+
resetDerivativesSchemaState();
|
|
107
|
+
resetSpreadSchemaState();
|
|
108
|
+
resetMarketContextSchemaState();
|
|
109
|
+
resetHyperliquidWhalesSchemaState();
|
|
85
110
|
verifiedMarketContextSchemas.clear();
|
|
86
111
|
await closePool();
|
|
87
112
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
waitForDbReady
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-OLB6NQRG.mjs";
|
|
4
4
|
import {
|
|
5
5
|
closeTimescalePool,
|
|
6
6
|
configureTimescaleMarketContextSchemaMode
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-ZXU7OYFU.mjs";
|
|
8
8
|
export {
|
|
9
9
|
closeTimescalePool,
|
|
10
10
|
configureTimescaleMarketContextSchemaMode,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DerivativesInterval, DerivativesRow } from '@tradejs/types';
|
|
2
|
-
export { T as TimescaleMarketContextQueryOptions
|
|
2
|
+
export { T as TimescaleMarketContextQueryOptions } from '../query-tkHVD4Xo.mjs';
|
|
3
3
|
export { M as MarketFeatureAsOf } from '../values-BrvcmnfM.mjs';
|
|
4
4
|
import 'pg';
|
|
5
5
|
|
|
6
|
+
declare const ensureDerivativesSchema: () => Promise<void>;
|
|
7
|
+
|
|
6
8
|
declare function upsertDerivatives(rows: DerivativesRow[]): Promise<void>;
|
|
7
9
|
declare function getDerivativesRangeForSymbols(symbols: string[], interval: DerivativesInterval, startMs: number, endMs: number): Promise<any[]>;
|
|
8
10
|
declare function getDerivativesDataEdgesForSymbols(symbols: string[], interval: DerivativesInterval): Promise<Map<string, {
|
|
@@ -87,4 +89,4 @@ declare function getDerivativesSummary(hours?: number, limit?: number, symbols?:
|
|
|
87
89
|
}[];
|
|
88
90
|
}>;
|
|
89
91
|
|
|
90
|
-
export { type DerivativesMetricCoverageMetric, applyDerivativesMetricCoverage, getDerivativesBackfillCoverage, getDerivativesDataEdgesForSymbols, getDerivativesMetricCoverage, getDerivativesRangeForSymbols, getDerivativesSummary, getDerivativesWindow, upsertDerivatives, upsertDerivativesBackfillCoverage };
|
|
92
|
+
export { type DerivativesMetricCoverageMetric, applyDerivativesMetricCoverage, ensureDerivativesSchema, getDerivativesBackfillCoverage, getDerivativesDataEdgesForSymbols, getDerivativesMetricCoverage, getDerivativesRangeForSymbols, getDerivativesSummary, getDerivativesWindow, upsertDerivatives, upsertDerivativesBackfillCoverage };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DerivativesInterval, DerivativesRow } from '@tradejs/types';
|
|
2
|
-
export { T as TimescaleMarketContextQueryOptions
|
|
2
|
+
export { T as TimescaleMarketContextQueryOptions } from '../query-tkHVD4Xo.js';
|
|
3
3
|
export { M as MarketFeatureAsOf } from '../values-BrvcmnfM.js';
|
|
4
4
|
import 'pg';
|
|
5
5
|
|
|
6
|
+
declare const ensureDerivativesSchema: () => Promise<void>;
|
|
7
|
+
|
|
6
8
|
declare function upsertDerivatives(rows: DerivativesRow[]): Promise<void>;
|
|
7
9
|
declare function getDerivativesRangeForSymbols(symbols: string[], interval: DerivativesInterval, startMs: number, endMs: number): Promise<any[]>;
|
|
8
10
|
declare function getDerivativesDataEdgesForSymbols(symbols: string[], interval: DerivativesInterval): Promise<Map<string, {
|
|
@@ -87,4 +89,4 @@ declare function getDerivativesSummary(hours?: number, limit?: number, symbols?:
|
|
|
87
89
|
}[];
|
|
88
90
|
}>;
|
|
89
91
|
|
|
90
|
-
export { type DerivativesMetricCoverageMetric, applyDerivativesMetricCoverage, getDerivativesBackfillCoverage, getDerivativesDataEdgesForSymbols, getDerivativesMetricCoverage, getDerivativesRangeForSymbols, getDerivativesSummary, getDerivativesWindow, upsertDerivatives, upsertDerivativesBackfillCoverage };
|
|
92
|
+
export { type DerivativesMetricCoverageMetric, applyDerivativesMetricCoverage, ensureDerivativesSchema, getDerivativesBackfillCoverage, getDerivativesDataEdgesForSymbols, getDerivativesMetricCoverage, getDerivativesRangeForSymbols, getDerivativesSummary, getDerivativesWindow, upsertDerivatives, upsertDerivativesBackfillCoverage };
|
|
@@ -119,18 +119,7 @@ var queryMarketContext = async (text, values, options = {}) => {
|
|
|
119
119
|
// src/timescale/values.ts
|
|
120
120
|
var normalizeCandleSymbol = (symbol) => String(symbol || "").trim().toUpperCase();
|
|
121
121
|
|
|
122
|
-
// src/timescale/
|
|
123
|
-
var derivativesSchemaReady = false;
|
|
124
|
-
var binanceMarketSchemaReady = false;
|
|
125
|
-
var hyperliquidWhaleSchemaReady = false;
|
|
126
|
-
var derivativesSchemaReadyPromise = null;
|
|
127
|
-
var binanceMarketSchemaReadyPromise = null;
|
|
128
|
-
var hyperliquidWhaleSchemaReadyPromise = null;
|
|
129
|
-
var marketContextSchemaMode = "ensure";
|
|
130
|
-
var verifiedMarketContextSchemas = /* @__PURE__ */ new Set();
|
|
131
|
-
var DERIVATIVES_SCHEMA_LOCK_KEY = 610001;
|
|
132
|
-
var BINANCE_MARKET_SCHEMA_LOCK_KEY = 610003;
|
|
133
|
-
var HYPERLIQUID_WHALE_SCHEMA_LOCK_KEY = 610004;
|
|
122
|
+
// src/timescale/schema/lifecycle.ts
|
|
134
123
|
var withSchemaLock = async (lockKey, work) => {
|
|
135
124
|
const pool = getPool();
|
|
136
125
|
await pool.query("SELECT pg_advisory_lock($1)", [lockKey]);
|
|
@@ -140,6 +129,11 @@ var withSchemaLock = async (lockKey, work) => {
|
|
|
140
129
|
await pool.query("SELECT pg_advisory_unlock($1)", [lockKey]);
|
|
141
130
|
}
|
|
142
131
|
};
|
|
132
|
+
|
|
133
|
+
// src/timescale/schema/derivatives.ts
|
|
134
|
+
var derivativesSchemaReady = false;
|
|
135
|
+
var derivativesSchemaReadyPromise = null;
|
|
136
|
+
var DERIVATIVES_SCHEMA_LOCK_KEY = 610001;
|
|
143
137
|
var ensureDerivativesSchema = async () => {
|
|
144
138
|
if (derivativesSchemaReady) return;
|
|
145
139
|
if (derivativesSchemaReadyPromise) {
|
|
@@ -227,6 +221,11 @@ var ensureDerivativesSchema = async () => {
|
|
|
227
221
|
});
|
|
228
222
|
await derivativesSchemaReadyPromise;
|
|
229
223
|
};
|
|
224
|
+
|
|
225
|
+
// src/timescale/schema/marketContext.ts
|
|
226
|
+
var binanceMarketSchemaReady = false;
|
|
227
|
+
var binanceMarketSchemaReadyPromise = null;
|
|
228
|
+
var BINANCE_MARKET_SCHEMA_LOCK_KEY = 610003;
|
|
230
229
|
var ensureBinanceMarketSchema = async () => {
|
|
231
230
|
if (binanceMarketSchemaReady) return;
|
|
232
231
|
if (binanceMarketSchemaReadyPromise) {
|
|
@@ -507,6 +506,11 @@ var ensureBinanceMarketSchema = async () => {
|
|
|
507
506
|
});
|
|
508
507
|
await binanceMarketSchemaReadyPromise;
|
|
509
508
|
};
|
|
509
|
+
|
|
510
|
+
// src/timescale/schema/hyperliquidWhales.ts
|
|
511
|
+
var hyperliquidWhaleSchemaReady = false;
|
|
512
|
+
var hyperliquidWhaleSchemaReadyPromise = null;
|
|
513
|
+
var HYPERLIQUID_WHALE_SCHEMA_LOCK_KEY = 610004;
|
|
510
514
|
var ensureHyperliquidWhaleSchema = async () => {
|
|
511
515
|
if (hyperliquidWhaleSchemaReady) return;
|
|
512
516
|
if (hyperliquidWhaleSchemaReadyPromise) {
|
|
@@ -735,6 +739,10 @@ var ensureHyperliquidWhaleSchema = async () => {
|
|
|
735
739
|
});
|
|
736
740
|
await hyperliquidWhaleSchemaReadyPromise;
|
|
737
741
|
};
|
|
742
|
+
|
|
743
|
+
// src/timescale/internal.ts
|
|
744
|
+
var marketContextSchemaMode = "ensure";
|
|
745
|
+
var verifiedMarketContextSchemas = /* @__PURE__ */ new Set();
|
|
738
746
|
var ensureCoinMarketCapContextSchema = async () => ensureBinanceMarketSchema();
|
|
739
747
|
var ensureMarketContextSchema = async (source) => {
|
|
740
748
|
switch (source) {
|