Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

odb-microstructure-forensicsODB 微观结构取证

Agent Skill

odb-microstructure-forensics 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

424

周安装

17

GitHub Stars

38

下载量

137
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:odb-microstructure-forensics(ODB 微观结构取证)
来源仓库:https://github.com/terrylica/cc-skills
仓库路径:skills/odb-microstructure-forensics
安装命令:
npx skills add https://github.com/terrylica/cc-skills --skill odb-microstructure-forensics
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/terrylica/cc-skills --skill odb-microstructure-forensics

简介

odb-microstructure-forensics 用于查找、检索和筛选相关信息。

  • 适合根据关键词或任务场景快速定位候选结果。
  • 通过 npx skills add 命令从指定仓库安装,需确认权限范围。
  • 建议结合原始 README 核验具体用法,避免触发未预期的联网操作。
  • 使用前应检查维护状态,确保与当前宿主环境兼容。

SKILL.md

ODB Microstructure Forensics

Systematic methodology for investigating Open Deviation Bar anomalies by tracing from ClickHouse cache back to raw Parquet trade data. Distinguishes algorithm correctness issues from market microstructure phenomena (liquidation cascades, order book sweeps, matching engine batch effects).

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

When to Use

  • ODB bars appear visually larger (taller or wider) than neighbors at the same threshold
  • Bars have zero or near-zero duration with extreme price range
  • abs_dev_dbps exceeds the threshold (e.g., 22 dbps on a 100 dbps bar)
  • Clusters of micro-bars appear at a single timestamp
  • Diagnosing whether anomalies are data bugs vs market microstructure
  • Investigating specific time windows flagged by the Flowsurface chart UI

Data Sources

SourceLocationSchemaAccess
ClickHouse cacheopendeviationbar_cache.open_deviation_bars on bigblack76 columns, see schema referencessh bigblack 'curl -s http://localhost:8123/ -d "..."'
Parquet tick cache/home/tca/.cache/opendeviationbar/ticks/{SYMBOL}/{YYYY-MM-DD}.parquet on bigblackagg_trade_id, price, quantity, first_trade_id, last_trade_id, timestamp, is_buyer_makerssh bigblack 'cd /home/tca && uv run --python 3.13 python3 -c "..."' with Polars

Access pattern: Always query bigblack directly via SSH. The SSH tunnel (localhost:18123) is for the Flowsurface app runtime only — forensic queries go direct.

Investigation Methodology

The investigation follows a 3-layer drill-down: ClickHouse overview → per-bar anomaly detection → Parquet trade-level root cause.

Layer 1: ClickHouse Bar Overview

Query bars in the suspect time window. Look for anomaly signals in the result set.

-- Adjust symbol, threshold, and time window to match the investigation
SELECT
    toDateTime64(close_time_us / 1000000, 3) AS close_ts,
    toDateTime64(open_time_us / 1000000, 3) AS open_ts,
    open, high, low, close,
    round((high - low) / open * 10000, 1) AS range_dbps,
    round(abs(close - open) / open * 10000, 1) AS abs_dev_dbps,
    agg_record_count AS n_agg,
    individual_trade_count AS n_trades,
    round(duration_us / 1e6, 1) AS dur_s,
    first_agg_trade_id AS first_id,
    last_agg_trade_id AS last_id,
    is_orphan, is_liquidation_cascade AS is_liq
FROM opendeviationbar_cache.open_deviation_bars
WHERE symbol = '{SYMBOL}'
  AND threshold_decimal_bps = {THRESHOLD}
  AND close_time_us >= toUnixTimestamp('{START_UTC}', 'UTC') * 1000000
  AND close_time_us <= toUnixTimestamp('{END_UTC}', 'UTC') * 1000000
ORDER BY close_time_us
FORMAT PrettyCompact

Anomaly signals to flag:

SignalColumn PatternMeaning
Threshold overshootabs_dev_dbps >> threshold / 10Single trade crossed beyond threshold
Zero durationdur_s = 0Entire bar formed within one matching engine cycle
Extreme rangerange_dbps > 2 * threshold / 10Price swept far beyond threshold
Micro trade countn_agg < 10 with high rangeGiant individual fills eating book
Burst clusteringMultiple bars at same secondLiquidity sweep fragmented across bars

Layer 2: Anomaly Isolation

Filter to just the anomalous bars to get agg_trade_id ranges for Parquet drill-down:

-- Bars with threshold overshoot or zero duration
SELECT close_ts, dur_s, open, high, low, close,
    range_dbps, abs_dev_dbps, n_agg,
    first_agg_trade_id, last_agg_trade_id
FROM (... Layer 1 query ...)
WHERE dur_s < 1.0 OR abs_dev_dbps > {THRESHOLD / 10 * 1.5}

Record the first_agg_trade_id and last_agg_trade_id ranges — these are the Parquet lookup keys.

Layer 3: Parquet Trade-Level Root Cause

Use Polars on bigblack to analyze raw trades. Three analyses in sequence:

3a. Timestamp Burst Detection

Group trades by timestamp to find matching engine batches (hundreds of trades sharing exact microsecond):

import polars as pl

df = pl.read_parquet("/home/tca/.cache/opendeviationbar/ticks/{SYMBOL}/{DATE}.parquet")

burst = df.filter(
    (pl.col("agg_trade_id") >= {FIRST_ID}) &
    (pl.col("agg_trade_id") <= {LAST_ID})
).sort("agg_trade_id")

# Group by timestamp to find single-cycle batches
ts_groups = burst.group_by("timestamp").agg([
    pl.col("price").min().alias("min_price"),
    pl.col("price").max().alias("max_price"),
    pl.col("quantity").sum().alias("total_qty"),
    pl.len().alias("count"),
]).sort("timestamp")

Key diagnostic: If a single timestamp has hundreds of trades spanning the full price range, it is a matching engine batch (single large order sweeping the book).

3b. Order Flow Analysis

Determine whether the sweep is buy or sell dominated:

buys = burst.filter(~pl.col("is_buyer_maker"))   # taker buy
sells = burst.filter(pl.col("is_buyer_maker"))    # taker sell

print(f"Taker buys:  {len(buys)} trades, {buys['quantity'].sum():.4f} BTC")
print(f"Taker sells: {len(sells)} trades, {sells['quantity'].sum():.4f} BTC")

Liquidation cascades are typically 95%+ one-sided (all taker sells or all taker buys).

3c. Price Gap Analysis

Find individual trades with large price jumps — these are the direct cause of threshold overshoot:

with_gap = burst.sort("agg_trade_id").with_columns([
    (pl.col("price") - pl.col("price").shift(1)).alias("price_diff"),
    (pl.col("timestamp") - pl.col("timestamp").shift(1)).alias("ts_diff_us"),
])

# Trades with gaps exceeding threshold dollar equivalent
threshold_dollars = open_price * threshold_dbps / 10000
big_jumps = with_gap.filter(pl.col("price_diff").abs() > threshold_dollars)

If individual trade-to-trade price gaps exceed the threshold, the ODB algorithm cannot split within a single agg_trade — overshoot is inherent and correct.

Root Cause Classification

After completing the 3-layer analysis, classify the finding:

ClassificationEvidence PatternAction
Liquidation cascade95%+ one-sided, 50-100+ BTC, same-µs timestamp, sweeps $200+Oracle bit-exact — no fix needed. Document the event.
Thin book sweepFewer trades but large price gaps between levelsOracle bit-exact — book was thin at that moment.
Orphan baris_orphan = 1 in ClickHouseKnown phenomenon — writer-boundary artifact. Skip in analysis.
Algorithm bugTrades are normally distributed, no burst, but bar still overshootsFile upstream issue on opendeviationbar-py.
Data gapagg_trade_id discontinuity between adjacent barsMissing Parquet data. Check collection pipeline.

Threshold Overshoot Mechanics

The ODB algorithm processes agg_trades sequentially. A bar closes when the first trade deviates beyond the threshold from the bar's open. The overshoot mechanism:

  1. Bar opens at price P₀ with threshold T (e.g., 100 dbps = 0.1%)
  2. Algorithm scans trades: P₁, P₂,... Pₙ
  3. At trade Pₖ: |Pₖ - P₀| / P₀ ≥ T — bar closes at Pₖ
  4. If Pₖ₋₁ was within threshold but Pₖ jumps far beyond, overshoot = |Pₖ - P₀| / P₀ - T

Overshoot is larger at lower thresholds because:

  • BPR10 threshold = $70 on $70k BTC. A $150 order book gap → 2x overshoot.
  • BPR50 threshold = $350 on $70k BTC. Same $150 gap → well within threshold.

This is inherent to discrete trade data — not a bug.

Related Skills

SkillRelationship
opendeviation-eval-metricsEvaluates ODB signal quality (output metrics). This skill investigates input data quality.
exchange-session-detectorSession flags in ClickHouse. Cascades often cluster at session boundaries (NY open/close).

Post-Execution Reflection

After this skill completes, check before closing:

  1. Did the queries succeed? — If ClickHouse schema changed (column renames, new columns), update the Layer 1 SQL template.
  2. Did the Parquet schema change? — If tick cache columns changed, update the Polars snippets.
  3. Was a new root cause pattern discovered? — Add it to the Root Cause Classification table with evidence pattern and action.
  4. Did the threshold overshoot mechanics explanation hold? — If a new overshoot mechanism was found, document it.

Only update if the issue is real and reproducible — not speculative.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.58%
按下载量换算47

Claude

32.93%
按下载量换算45

Cursor

19.63%
按下载量换算27

Gemini CLI

8.41%
按下载量换算12

安全审计

Gen Agent Trust Hub

可疑

Socket

可疑

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills