Documentation Index
Fetch the complete documentation index at: https://mintlify.com/backtest-kit/backtest-ollama-crontab/llms.txt
Use this file to discover all available pages before exploring further.
screen-items is the final output collection of the pipeline. Each document represents a parsed trading signal that has been evaluated by the LLM risk filter. The collection is written exclusively by ScreenDbService.create() after SignalLogicService successfully runs the RiskOutline outline and all five Zod validators pass. Documents are immutable after creation — re-running the pipeline for the same parserItemId is a no-op due to the unique index.
Schema Definition
FullIScreenDto interface and ScreenSchema from packages/core/src/schema/Screen.schema.ts:
Fields
Identity
Foreign-key reference to the originating
parser-items document (_id serialised as a string). Protected by a unique index — inserting a second screen-items document for the same parserItemId is silently rejected via $setOnInsert upsert semantics.Telegram channel identifier from which the signal was originally scraped (e.g.,
"crypto_yoda_channel"). Indexed for channel-level filtering.Source channel name. In the current crawler implementation
source is set equal to channel. Indexed separately to allow future multi-source fan-out.The timestamp at which the signal was published on Telegram. Used as the time axis for all 4-hour window queries. Indexed.
Trading symbol with USDT suffix (e.g.,
"BTCUSDT", "SOLUSDT"). Indexed and used as the primary key in compound time-range queries.Signal
Trade direction as parsed from the original Telegram message. Maps directly from
IParserRow.direction.Lower bound of the entry price zone. Sourced from
IParserRow.entry.from.Upper bound of the entry price zone. Sourced from
IParserRow.entry.to.Array of take-profit target prices in ascending order. At least one element is always present.
Stop-loss price level. For
long signals this is below entryFrom; for short signals it is above entryTo.Risk Assessment (LLM output)
The LLM’s trading verdict.
follow means the risk filter approved the signal; skip means it was rejected. Indexed to allow fast filtering by verdict. Sourced from RiskOutlineContract.action.LLM’s confidence in the presence of market manipulation in the candle data. Audit field only. Indexed for analytical queries. Sourced from
RiskOutlineContract.sure_level.LLM’s assessment of the input data quality.
reliable indicates ≥ 60 one-minute candles with unambiguous metrics. Audit field only. Indexed. Sourced from RiskOutlineContract.confidence.Human-readable 2–3 sentence verdict for the trader. Always names the applied rule with specific numbers. Minimum 30 characters. Sourced from
RiskOutlineContract.description.Single flat string with newline-separated reasoning steps produced by the LLM. Not a JSON object or array. Minimum 80 characters. Sourced from
RiskOutlineContract.reasoning.Raw Data
The full original Telegram message text, preserved verbatim for audit and replay purposes.
The raw parsed content object produced by the parser (type
unknown in TypeScript / Schema.Types.Mixed in Mongoose). Stores the structured signal data before field-level extraction.Auto-managed by Mongoose
timestamps. Set once at document creation, never updated. Mapped from the Mongoose default createdAt via { createdAt: "createDate" }.Auto-managed by Mongoose
timestamps. Mapped from the Mongoose default updatedAt via { updatedAt: "updatedDate" }.Indexes
The collection carries the following indexes:| Index | Type | Purpose |
|---|---|---|
{ parserItemId: 1 } | Unique | Prevents duplicate processing of the same parser row |
{ symbol: 1, publishedAt: -1 } | Compound | Efficient findLast4HourRow queries sorted by recency |
{ channel: 1 } | Single-field | Filter by Telegram channel |
{ source: 1 } | Single-field | Filter by source identifier |
{ publishedAt: 1 } | Single-field | Time-range scans |
{ symbol: 1 } | Single-field | Symbol equality filter |
{ riskSureLevel: 1 } | Single-field | Analytical grouping by manipulation confidence |
{ riskConfidence: 1 } | Single-field | Analytical grouping by data quality |
{ riskAction: 1 } | Single-field | Fast filter of follow/skip verdicts |
The unique index on
{ parserItemId: 1 } is the primary idempotency guard. ScreenDbService.create() uses findOneAndUpdate with $setOnInsert, so calling create() twice for the same parser row returns the existing document without writing any new data.Querying
ScreenDbService exposes two read methods used by the rest of the system:
{ symbol: 1, publishedAt: -1 }, making them efficient even for high-frequency symbols.