This page documents the core TypeScript types used throughoutDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tripolskypetr/pump-anomaly/llms.txt
Use this file to discover all available pages before exploring further.
pump-anomaly. These are the contracts that govern detector configuration, training grid search, viability assessment, reliability scoring, statistical certification, exit parameter resolution, and replay simulation. All types are exported from the package and available for use in custom tooling, analytics scripts, and orchestration layers.
Direction
"long" = bullish position (expect price to rise); "short" = bearish position (expect price to fall). Used throughout: in ParserItem, PumpVerdict, TradeSignal, ExitParams cell keys, and the exit tensor. The library is fully symmetric — long-trap and short-trap (short squeeze and long cascade) are mirrors of the same mechanism with separate tensor cells.
DetectorMode
"matrix"— entry requires a synchronous burst across independent author clusters. Filters out single-actor manipulation (N channels of the same operator collapse to 1 cluster and do not fire)."single"— every post is an entry candidate; the trained exit decides the outcome. Used as a fallback when correlation data is insufficient."auto"(default) — uses matrix mode only when the author correlation passes the viability check; otherwise falls back to single. The actual mode chosen is reported inmodel.modeandresult.usedMode.
DEFAULT_CONFIG
The default detector configuration used when no explicit config is passed topredict() or PumpMatrix.fit().
DetectorConfig Fields
Multiplier applied to the self-tuned lag τ to define the burst-detection sliding window (
windowMs = windowK × τ). Larger values catch slower bursts but increase false positives. Default 3; grid searches [2, 3, 5].Minimum number of independent author clusters that must all signal the same
(symbol, direction) within the burst window for a matrix entry. Channels belonging to the same operator count as one cluster. Default 2; grid searches [2, 3].Minimum sliding-window Jaccard similarity for a channel pair to be considered structurally close (pass the coarse sieve). Default
0.3; grid searches [0.3, 0.4].Minimum peak sharpness (fraction of cross-correlation mass within the peak window) required for a directed lag edge to be kept. Low values → noisy edges accepted; high values → only sharp peaks kept. Default
0.5; grid searches [0.4, 0.5].Hard ceiling on the burst synchrony window in milliseconds, regardless of
windowK × τ. Default 3 600 000 (1 hour).Entry-selection mode. See DetectorMode. Default
"auto".Override thresholds for the matrix viability check in
"auto" mode. Fields not specified fall back to DEFAULT_VIABILITY.Length of the rolling stationarity window in milliseconds. Statistics (τ, author matrix, Jaccard) are computed only over the most recent
stationarityWindowMs of data ending at the current anchor timestamp — guarding against regime drift on long horizons where channel relationships evolve. Infinity (default) uses the full history.TrainGrid
TrainGrid defines the search space for PumpMatrix.fit(). Every field is an array of candidate values; the trainer evaluates all combinations using time-series K-fold cross-validation and selects the most conservative configuration within one standard error of the best CV score (Breiman 1-SE rule).
DEFAULT_GRID Values and What Each Axis Controls
| Axis | Default values | Controls |
|---|---|---|
windowK | [2, 3, 5] | Burst window multiplier (windowMs = windowK × τ) |
minClusters | [2, 3] | Minimum independent author clusters for a matrix signal |
jaccardThreshold | [0.3, 0.4] | Coarse-sieve channel-proximity cutoff |
lagPeakThreshold | [0.4, 0.5] | Minimum lag-correlation peak sharpness |
trailingTake | [0.5, 1.0, 2.0] | Trailing-take pullback % from peak PnL |
hardStop | [1.0, 2.0, 3.0] | Hard-stop % below entry (long) / above entry (short) |
stalenessSinceProfit | [0.5, 1.0, 2.0] | Profit % threshold that arms the peak-staleness exit |
stalenessSinceMinutes | [60, 120, 240] | Minutes without a new peak before a staleness exit fires |
staleMinutes | [60, 240, 720] | Position life-cap in minutes (empirical impact horizon) |
volZThreshold | [1.5, 2.5] | Volume z-score threshold separating calm from anomalous regime |
squeezePolicy | ["none","tighten","veto","invert"] | Reaction policy when cascade pressure exceeds threshold |
squeezeThreshold | [0.55, 0.7] | Squeeze-pressure fraction that triggers the policy |
volBaselineWindow | [20] | Number of candles before entry used as the volume baseline |
cascadeWindowMinutes | [15, 30, 60] | Cascade-detection window in minutes (independent of staleMinutes) |
stationarityWindowMs | [7d, 14d, 28d, 56d] | Rolling stationarity window for author-matrix statistics |
Partial<TrainGrid> via TrainOptions.grid to override only the axes you want to constrain or widen.
ViabilityConfig and DEFAULT_VIABILITY
Thresholds used by the viability check in"auto" mode to decide whether the author correlation is trustworthy enough to use matrix mode. All conditions must hold simultaneously.
The minimum number of shared
(symbol, direction) events between any pair of channels for their overlap to be considered non-random. Below this threshold the correlation is likely a coincidence. Default 3.The minimum fraction of cross-correlation mass that must fall within the peak window for a directed lag edge to be considered “strong” (non-random timing alignment). Default
0.6.The minimum number of strong directed edges (passing
minPeakShare) required in the graph. Zero strong edges means no reliable leader–follower relationship was found. Default 1.The minimum number of independent author clusters required if no multi-channel cluster (sibling pair) was found. Ensures the graph is non-trivial: either siblings exist, or there are at least
minStructure separate clusters. Default 2.ViabilityReport
Returned byassessViability() and embedded in PredictionResult.viability. Explains exactly why auto mode chose matrix or fell back to single.
Whether the author matrix passed all viability criteria.
false → auto falls back to single mode.Total number of distinct channels in the current event table.
The maximum number of shared events found between any channel pair. Compared against
minSharedEvents.Number of directed lag edges whose
peakShare ≥ minPeakShare. Compared against minStrongEdges.Number of author clusters that contain more than one channel (confirmed sibling pairs).
Total number of distinct author clusters found. Compared against
minStructure when multiChannelClusters === 0.Human-readable explanation of why the viability verdict was reached. Examples:
"auto → matrix: 3 strong edges, overlap 5, clusters >1: 2" or "auto → single: мало общих событий (макс 2 < 3) — перекрытие шумовое".ReliabilityConfig
Thresholds that control when the model is considered reliably trained. Configurable viaTrainOptions.reliability.
Shrinkage parameter for the support score:
support = N / (N + supportK). At N = supportK the support contribution is exactly 0.5. Higher values demand more trades before the model is considered well-supported. Default 30.The minimum
confidence score (product of support × stability × significance, each in [0, 1]) required for reliable to be true. Default 0.6.The minimum total number of labeled trades across all folds for
reliable to be true, regardless of the confidence score. Prevents a high-confidence result on a trivially small sample. Default 40.Reliability object carries the individual axis scores:
Overall trust score in
[0, 1]: support × stability × significance.true when confidence ≥ confidenceThreshold AND totalN ≥ minN.Volume axis:
N / (N + supportK). Grows from 0 toward 1 as more trades are seen.Fold-consistency axis: fraction of folds with a positive mean return, weighted by low coefficient of variation across folds.
Statistical-significance axis: how many standard errors the mean return is above zero, passed through a saturating sigmoid.
Total number of labeled trades summed across all folds.
Certification
The statistical certificate produced bycertifyStrategy() and accessible on the model via model.certification. certified: true only when the selected configuration’s edge survives all five barriers simultaneously. certified: false means the model should not trade — the evidence suggests the edge is a brute-force search artifact rather than a real repeatable pattern.
true only if all five barriers pass. false with reasons[] populated explains specifically which barriers failed.Deflated Sharpe Ratio (López de Prado 2014). Probability that the true Sharpe exceeds the expected-maximum Sharpe of a random search over
N trials, adjusted for skewness, kurtosis, and sample length. Must be ≥ 0.95 to pass.Probability of Backtest Overfitting via Combinatorially-Symmetric CV (CSCV). Fraction of IS/OOS splits where the in-sample-best configuration fell in the bottom half of out-of-sample ranks. → 0.5 = pure overfit; → 0 = edge transfers OOS. Must be ≤ 0.10 to pass.
White’s Reality Check / Hansen SPA p-value (stationary bootstrap). H₀: the best strategy’s edge is entirely explained by data-snooping across all candidate configurations. Must be ≤ 0.05 to pass (reject H₀).
Minimum Track Record Length — the minimum number of trades required for the observed Sharpe to be statistically significant at α = 0.05. Acts as a physical-feasibility gate: if
actualN < minTRL, the sample is too small for any conclusion.The actual number of trades in the selected configuration’s return series. Must be ≥
minTRL to pass.The unbiased out-of-sample estimate from nested cross-validation.
null if nested CV was not run (selection.nestedOuterFolds = 0). Must be > 0 to pass when present.Human-readable list of barrier failures. Empty when
certified: true. Example: ["DSR 0.71 < 0.95 (N-trial correction failed)", "actualN 28 < minTRL 34"].PredictionResult
The full output of the low-levelpredict() function and model.explain().
Only verdicts with
action = "open", sorted by confidence descending. These are the candidates that passed all detector filters.All verdicts for every
(symbol, direction) evaluated, including those with action = "skip".A
Map<string, number> of channel → author-cluster id, representing the merging of channels belonging to the same operator.Number of independent author clusters identified in the current burst window.
The self-tuned characteristic lag τ between sibling channels, in milliseconds. Derived from the histogram of pairwise delays; clamped to
[30s, 60min]. Defaults to 15 minutes when data is insufficient.The effective burst synchrony window (
windowK × τ, capped at maxBurstWindowMs).The mode that actually ran for this prediction (
"auto" resolves to one of the two concrete modes).Full viability assessment explaining why
auto chose matrix or single. See ViabilityReport.ExitParams and ReplayResult
ExitParams
The complete set of exit parameters for a single position. Stored in the exit tensor and resolved hierarchically per signal. Every field is a training-time decision, not a runtime heuristic.Trailing-take pullback threshold as a percentage of peak PnL. Once
currentProfit ≥ 0, a pullback of this % from the peak triggers an exit. Already tightened (multiplied by tightenFactor) when squeezePolicy = "tighten".Fixed hard-stop percentage from the entry price against the position direction. Long: below entry; short: above entry. When triggered, the realized PnL is the honest
−hardStop% loss.Profit percentage threshold that arms the peak-staleness exit. The staleness timer only activates once the position reaches at least this profit.
Number of minutes without a new peak PnL high, after
stalenessSinceProfit is reached, before the staleness exit fires.Hard ceiling on position lifetime in minutes — the empirical impact horizon of a single post. The position is force-closed at the close of the last candle in this window. Trained by the grid; varies significantly by asset (e.g. 30 min for HYPE vs. 48h+ for BTC).
Number of candles before the entry candle used as the volume baseline for
volZ. If absent, volZ is not computed (no volume regime classification).The z-score threshold separating
"calm" from "anomalous" volume regime. Trained by grid.Reaction when
squeezePressure ≥ squeezeThreshold: none = normal entry; tighten = tighten trailing take; veto = skip the signal entirely; invert = enter opposite to the channel’s direction; ignore = enter in the original direction despite the cascade (produces the counterfactual “what if we ignore the cascade” pnl).The
squeezePressure fraction (0–1) that triggers squeezePolicy. Trained by grid.Multiplier applied to
trailingTake when squeezePolicy = "tighten". Default 0.5 (trailing halved).Minutes over which
squeezePressure is measured — the cascade-detection window. Independent of staleMinutes because a squeeze is a fast event (minutes), not the full position lifetime. Falls back to staleMinutes for backward compatibility when unset.ReplayResult
The output ofreplayExit() — the realized outcome of simulating the exit strategy on a sequence of 1-minute candles. Also embedded in BacktestResult (returned by model.backtest()).
Realized PnL as a fraction (e.g.
0.05 = +5%). At a hard-stop this is the honest −hardStop% loss — not a fictitious peak rollback.Why the position was closed:
"trailing-take", "hard-stop", "peak-staleness", "life-cap", "cascade-veto", "invert", or "no-entry".Peak PnL reached at any point during the position’s life, as a fraction. Kept for diagnostics; does not affect the realized
pnl.Number of minutes from entry to exit.
Whether the position was actually opened.
false when the entry zone was never touched within the candle window.The price at which entry was taken.
0 if not entered.The price at which the position was closed.
0 if not entered.Z-score of the entry candle’s volume against the baseline window. High values indicate the crowd synchronously entered on leverage (fuel accumulated for a potential cascade).
Fraction of volume in the detection window on candles where price moved against the position direction. For long: bearish candles; for short: bullish candles. High values indicate a liquidation cascade rather than honest directional flow.
Volume regime at entry:
"calm" if volZ < volZThreshold; "anomalous" if above. Determines which exit-tensor cell is used.Whether the position direction was inverted by
squeezePolicy = "invert".true when there were not enough candles after entry to cover the full staleMinutes life-cap. Truncated results are dropped per-exit during training to prevent a 1-hour horizon being compared against a 24-hour one on a clipped path.For the high-level API —
PumpMatrix.fit(), plan(), backtest(), and signals() — see the PumpMatrix API reference. For the input contract, see ParserItem and GetCandles.