refactor: improve Market Health Reporter prompts for structured, evidence-based analysis#523
Open
sealfe wants to merge 1 commit into1712n:mainfrom
Open
refactor: improve Market Health Reporter prompts for structured, evidence-based analysis#523sealfe wants to merge 1 commit into1712n:mainfrom
sealfe wants to merge 1 commit into1712n:mainfrom
Conversation
…ence-based analysis - Enhance system prompt with clear analytical principles and role definition - Restructure prompt1 with severity-based analytical methodology - Add cross-metric corroboration framework (strong/moderate/weak evidence) - Add quantitative thresholds: Benford's expected frequencies, CV for time-of-trade, K-S p-value tiers - Add average transaction size as explicit metric with cross-exchange benchmark - Add skewness analysis and buy/sell ratio stability anomaly pattern - Fix output format to match example article: YAML list entities, single date, descriptive subsection headings - Map illustration filenames to their visualization tool outputs - Add writing style guidelines matching the Huobi reference article's narrative tone
Author
|
@sofiasedlova Requesting review for this submission to issue #427. This PR refactors both prompts to improve the reporter's output alignment with the published article format and contribution guidelines. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #427
After a systematic comparison of the current prompts against the Huobi reference article, the contribution guidelines, the project metric documentation, and the visualization tool code, I identified several structural and analytical gaps between what the prompts instruct and what the published standards require.
Key Gaps Identified
No severity framework — The original prompt treats all anomalies equally. A single metric deviation (potentially noise) gets the same weight as three metrics deviating simultaneously (strong evidence). This leads to reports that either cry wolf on minor fluctuations or understate genuine manipulation.
Missing metric: Average Transaction Size — The
avgtransactionsizefield is plotted by the visualization tool incrypto_metrics.pngand is the primary finding in the Huobi reference article ("Abnormal activity indicator - Average transaction size"), yet the prompt never instructs the model to analyze it.No quantitative thresholds for key metrics — The prompt mentions Benford's Law but doesn't provide the expected digit frequencies (30.1%, 17.6%, 12.5%...). It mentions the K-S test but doesn't include the p-value interpretation tiers from the project's own documentation. Without concrete numbers, the model has no reference for quantifying deviations.
Broken output format — The original prompt specifies
date: 'YYYY-MM-DD — YYYY-MM-DD'(range format) andentities: 'Huobi, HT, TRX, DOGE'(comma-separated string). Every published article uses a singledate: YYYY-MM-DDand a YAML list for entities. This produces Hugo front matter that doesn't match the site's schema.No article structure guidance — The prompt says "create an article" but doesn't specify the
## Summary+## Metrics usedstructure or the descriptive subsection headings that the Huobi article uses (e.g., "Order printing bots - Volume distribution tail and skewness").Missing analytical patterns from the reference article — Buy/sell ratio stability anomaly (HT's abnormally narrow fluctuation range), volume distribution skewness analysis (below-zero skewness indicating order-printing bots), and time-of-trade periodicity detection (5-second interval bot patterns from the OKEx article) are all absent.
Illustration files undocumented — The prompt lists four allowed illustration filenames but doesn't describe what each chart contains, making it impossible for the model to place them at the correct point in the narrative.
Changes Made
system_prompt.txt<article>tags)prompt1.txtAnalytical Methodology:
Metric Definitions:
Cross-Metric Correlations:
Output Format:
date: YYYY-MM-DD, YAML list forentities## Summaryand## Metrics usedsection structure###subsection headings matching the reference article style (e.g., "Abnormal activity indicator - Average transaction size", not "avgtransactionsize")Illustration Documentation:
volume_hist.png→ transaction volume histogram (volume distribution analysis)crypto_metrics.png→ 4-panel time series of volume, trade count, avg tx size, buy/sell ratiobenford_law.png→ K-S test score vs critical value over timevv_correlation.png→ volume-volatility correlation over timeWriting Style:
What This PR Does NOT Do
Methodology
Each change maps directly to a specific gap between the current prompt output and the published article standards:
AI Disclosure
AI (Claude) was used as a coding assistant. All analytical decisions — the severity framework design, threshold selections, cross-metric patterns, and gap analysis — are based on systematic comparison of the existing codebase, published articles, and project documentation.