Repository Analysis

nautechsystems/nautilus_trader

Production-grade Rust-native trading engine with deterministic event-driven architecture

5.4 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of nautechsystems/nautilus_trader, a Rust project with 28,017 GitHub stars. SynthScan v2.0 examined 1,999,190 lines of code across 4252 source files, recording 9210 pattern matches distributed across 22 syntactic categories. The overall adjusted score of 5.4 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

5.4
Adjusted Score
5.4
Raw Score
100%
Time Factor
2026-08-28
Last Push
28.0K
Stars
Rust
Language
2.0M
Lines of Code
4.3K
Files
9.2K
Pattern Hits
2026-08-29
Scan Date
0.02
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 68MEDIUM 842LOW 8300

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 9210 distinct pattern matches across 22 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Over-Commented Block6089 hits · 5850 pts
SeverityFileLineSnippetContext
LOWCargo.toml521# LTO is disabled for faster bench compile times.COMMENT
LOWCargo.toml541# figures.COMMENT
LOWdeny.toml41COMMENT
LOWdeny.toml101license-files = []COMMENT
LOWcrates/lib.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/build.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/tests/layout.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/stack_str_iai.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/stack_str.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/concurrent_map.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/concurrent_map.rs21//! Results (10k reads/thread, barrier-synced, String keys, u64 values):COMMENT
LOWcrates/core/benches/correctness.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/to_snake_case.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/decimal_deserialization.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/time.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/uuid.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/identifier_comparison.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/hash_map.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/datetime.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/hex.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/benches/urlencoding.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/src/consts.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/src/correctness.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/src/correctness.rs61 /// A string contained a non-ASCII character.COMMENT
LOWcrates/core/src/correctness.rs201 set_type_repr: String,COMMENT
LOWcrates/core/src/correctness.rs321 });COMMENT
LOWcrates/core/src/correctness.rs361///COMMENT
LOWcrates/core/src/correctness.rs621/// Checks the `f64` value is in range [`l`, `r`] (inclusive).COMMENT
LOWcrates/core/src/correctness.rs961 }COMMENT
LOWcrates/core/src/correctness.rs1061COMMENT
LOWcrates/core/src/correctness.rs1081 #[case] rhs_param: &str,COMMENT
LOWcrates/core/src/correctness.rs1121 );COMMENT
LOWcrates/core/src/correctness.rs1201 #[case(f64::NEG_INFINITY, "value")]COMMENT
LOWcrates/core/src/correctness.rs1221 #[case(0, 1, 2, "value")]COMMENT
LOWcrates/core/src/correctness.rs1241 ) {COMMENT
LOWcrates/core/src/correctness.rs1261 fn test_check_in_range_inclusive_i64_when_in_range(COMMENT
LOWcrates/core/src/correctness.rs1281 }COMMENT
LOWcrates/core/src/correctness.rs1301 #[case] r: i64,COMMENT
LOWcrates/core/src/correctness.rs1401 #[case(&HashMap::from([(1, 10), (2, 20)]), 1, "key", "map", false)] // key existsCOMMENT
LOWcrates/core/src/correctness.rs1461 assert_eq!(result, expected);COMMENT
LOWcrates/core/src/env.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/src/env.rs41/// Only attempts to read the environment variable when `value` is `None`,COMMENT
LOWcrates/core/src/lib.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/src/lib.rs21//!COMMENT
LOWcrates/core/src/lib.rs41//! depending on the intended use case, i.e. whether to provide Python bindingsCOMMENT
LOWcrates/core/src/paths.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/src/paths.rs21///COMMENT
LOWcrates/core/src/time.rs1// -------------------------------------------------------------------------------------------------COMMENT
LOWcrates/core/src/time.rs21//! # ModesCOMMENT
LOWcrates/core/src/time.rs61/// Returns a static reference to the global atomic clock in **real-time mode**.COMMENT
LOWcrates/core/src/time.rs81/// Panics if the system time is set before the UNIX epoch.COMMENT
LOWcrates/core/src/time.rs101/// libc-intercepted by madsim and resolves to the same real syscall it wouldCOMMENT
LOWcrates/core/src/time.rs141/// [`AtomicTime`] can act as a real-time clock or static clock based on its mode.COMMENT
LOWcrates/core/src/time.rs181 }COMMENT
LOWcrates/core/src/time.rs221 clippy::cast_precision_loss,COMMENT
LOWcrates/core/src/time.rs261 }COMMENT
LOWcrates/core/src/time.rs301 Ok(UnixNanos::from(previous + delta))COMMENT
LOWcrates/core/src/time.rs341 // Acquire on failure reloads if we lost a CAS race.COMMENT
LOWcrates/core/src/time.rs361 return UnixNanos::from(next);COMMENT
LOWcrates/core/src/time.rs381 pub fn make_realtime(&self) {COMMENT
6029 more matches not shown…
Decorative Section Separators700 hits · 2136 pts
SeverityFileLineSnippetContext
MEDIUMCargo.toml515# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml517# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml522# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml532# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml534# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml545# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml555# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml557# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml566# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml95# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml99# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml120# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml125# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml320# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml322# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml362# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml364# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml387# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml389# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml400# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml402# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml434# -----------------------------------------------------------------------------COMMENT
MEDIUMCargo.toml436# -----------------------------------------------------------------------------COMMENT
MEDIUMdeny.toml4# =============================================================================COMMENT
MEDIUMdeny.toml6# =============================================================================COMMENT
MEDIUMdeny.toml14# =============================================================================COMMENT
MEDIUMdeny.toml16# =============================================================================COMMENT
MEDIUMdeny.toml56# =============================================================================COMMENT
MEDIUMdeny.toml58# =============================================================================COMMENT
MEDIUMdeny.toml110# =============================================================================COMMENT
MEDIUMdeny.toml112# =============================================================================COMMENT
MEDIUMdeny.toml227# =============================================================================COMMENT
MEDIUMdeny.toml229# =============================================================================COMMENT
MEDIUMosv-scanner.toml4# =============================================================================COMMENT
MEDIUMosv-scanner.toml6# =============================================================================COMMENT
MEDIUMcrates/core/benches/concurrent_map.rs25//! ┌──────────┬──────────┬──────────┬───────────┐COMMENT
MEDIUMcrates/core/benches/concurrent_map.rs27//! ├──────────┼──────────┼──────────┼───────────┤COMMENT
MEDIUMcrates/core/benches/concurrent_map.rs30//! └──────────┴──────────┴──────────┴───────────┘COMMENT
MEDIUMcrates/core/benches/concurrent_map.rs33//! ┌──────────┬──────────┬──────────┬───────────┐COMMENT
MEDIUMcrates/core/benches/concurrent_map.rs35//! ├──────────┼──────────┼──────────┼───────────┤COMMENT
MEDIUMcrates/core/benches/concurrent_map.rs39//! └──────────┴──────────┴──────────┴───────────┘COMMENT
MEDIUMcrates/core/benches/concurrent_map.rs42//! ┌──────────┬──────────┬──────────┬───────────┐COMMENT
MEDIUMcrates/core/benches/concurrent_map.rs44//! ├──────────┼──────────┼──────────┼───────────┤COMMENT
MEDIUMcrates/core/benches/concurrent_map.rs48//! └──────────┴──────────┴──────────┴───────────┘COMMENT
MEDIUMcrates/adapters/okx/src/http/query.rs377 // ───────── Both cursors validationCOMMENT
MEDIUMcrates/adapters/okx/src/http/query.rs385 // ───────── Cursor chronological validationCOMMENT
MEDIUMcrates/adapters/okx/src/http/query.rs399 // ───────── Cursor unit (≤ 13 digits ⇒ milliseconds)COMMENT
MEDIUMcrates/adapters/okx/src/http/query.rs412 // ───────── Limit validationCOMMENT
MEDIUM…tes/adapters/derive/tests/oracle-py/generate_oracle.py2# -------------------------------------------------------------------------------------------------COMMENT
MEDIUM…tes/adapters/derive/tests/oracle-py/generate_oracle.py15# -------------------------------------------------------------------------------------------------COMMENT
MEDIUM…es/adapters/lighter/tests/oracle-py/generate_oracle.py2# -------------------------------------------------------------------------------------------------COMMENT
MEDIUM…es/adapters/lighter/tests/oracle-py/generate_oracle.py15# -------------------------------------------------------------------------------------------------COMMENT
MEDIUMcrates/infrastructure/src/redis/mod.rs89/// ┌───────────┬───────────┬────────────────────────────┐COMMENT
MEDIUMcrates/infrastructure/src/redis/mod.rs91/// ├───────────┼───────────┼────────────────────────────┤COMMENT
MEDIUMcrates/infrastructure/src/redis/mod.rs95/// └───────────┴───────────┴────────────────────────────┘COMMENT
MEDIUMpython/generate_docstrings.py2# -------------------------------------------------------------------------------------------------COMMENT
MEDIUMpython/generate_docstrings.py15# -------------------------------------------------------------------------------------------------COMMENT
MEDIUMpython/generate_stubs.py2# -------------------------------------------------------------------------------------------------COMMENT
MEDIUMpython/generate_stubs.py15# -------------------------------------------------------------------------------------------------COMMENT
MEDIUMpython/nautilus_trader/__init__.py1# -------------------------------------------------------------------------------------------------COMMENT
640 more matches not shown…
Hyper-Verbose Identifiers1779 hits · 1605 pts
SeverityFileLineSnippetContext
LOWpython/generate_stubs.py2523def _fix_optional_defaults_in_line(line: str) -> str:CODE
LOWpython/generate_stubs.py2556def _is_property_setter_decorator(line: str) -> bool:CODE
LOWpython/generate_stubs.py2803def add_missing_model_imports(content: str) -> str:CODE
LOWpython/generate_stubs.py2840def _line_contains_name_to_remove(line: str, names_to_remove: set[str]) -> bool:CODE
LOWpython/generate_stubs.py2906def clean_orphaned_decorators(source: str) -> str:CODE
LOWpython/generate_stubs.py2939def normalize_builtin_type_names(content: str) -> str:CODE
LOWpython/generate_stubs.py3060def _infer_constant_python_type(CODE
LOWpython/generate_stubs.py3138def _insert_constants_after_all(content: str, const_block: str) -> str:CODE
LOWpython/generate_stubs.py588def remove_stale_top_level_adapter_stubs(root: Path) -> None:STRING
LOWpython/generate_stubs.py667def _extract_signature_params_str(attr: str, open_paren: int) -> str:STRING
LOWpython/generate_stubs.py684def _resolve_signature_params(STRING
LOWpython/generate_stubs.py811def collect_rust_class_fixups(workspace_root: Path) -> dict[str, ClassMethodFixup]:STRING
LOWpython/generate_stubs.py881def collect_renamed_enum_variants(workspace_root: Path) -> dict[str, list[str]]:STRING
LOWpython/generate_stubs.py923def collect_rust_enum_variants(lines: list[str], enum_start: int) -> list[str]:STRING
LOWpython/generate_stubs.py1000def renamed_enum_variant_name(STRING
LOWpython/generate_stubs.py1030def normalize_enum_variant_name(name: str) -> str:STRING
LOWpython/generate_stubs.py1037def fix_enum_defaults_in_signatures(content: str, renamed_enums: set[str]) -> str:STRING
LOWpython/generate_stubs.py1064def _replace_forward_local_class_default(STRING
LOWpython/generate_stubs.py1076def elide_forward_class_defaults_in_signatures(content: str) -> str:STRING
LOWpython/generate_stubs.py1124def _collect_pyclass_name_fixups(source: str, fixups: dict[str, ClassMethodFixup]) -> None:STRING
LOWpython/generate_stubs.py1166def _collect_identifier_macro_fixups(source: str, fixups: dict[str, ClassMethodFixup]) -> None:STRING
LOWpython/generate_stubs.py1186def strip_double_quoted_strings(text: str) -> str:STRING
LOWpython/generate_stubs.py1219def _collect_custom_data_macro_fixups(source: str, fixups: dict[str, ClassMethodFixup]) -> None:STRING
LOWpython/generate_stubs.py1259def _collect_struct_field_names(lines: list[str], struct_start: int) -> set[str]:STRING
LOWpython/generate_stubs.py1313def _collect_pyfunction_signature_defaults(STRING
LOWpython/generate_stubs.py1367def _register_free_function_defaults(STRING
LOWpython/generate_stubs.py1387def _collect_block_method_fixups(STRING
LOWpython/generate_stubs.py1466def consume_rust_method_signature(STRING
LOWpython/generate_stubs.py1484def register_rust_method_fixup(STRING
LOWpython/generate_stubs.py1540def _register_injected_classmethod(STRING
LOWpython/generate_stubs.py1557def register_rust_setter_fixup(STRING
LOWpython/generate_stubs.py1585def _extract_method_signature_defaults(STRING
LOWpython/generate_stubs.py1618def render_missing_staticmethod_stub(STRING
LOWpython/generate_stubs.py1637def render_missing_classmethod_stub(STRING
LOWpython/generate_stubs.py1731def remove_final_from_subclassable_classes(STRING
LOWpython/generate_stubs.py1945def rewrite_stub_method_block(STRING
LOWpython/generate_stubs.py1993def render_stub_property_setter(property_name: str, method_block: list[str]) -> list[str]:STRING
LOWpython/generate_stubs.py2019def drop_stub_method_receiver(signature_text: str) -> str:STRING
LOWpython/generate_stubs.py2102def relocate_classes_from_libnautilus(root: Path) -> None:STRING
LOWpython/nautilus_trader/_fixup.py45def _should_fixup_module_name(CODE
LOWpython/nautilus_trader/core/datetime.py107def _has_more_than_microsecond_precision(value: str) -> bool:CODE
LOWpython/nautilus_trader/analysis/reporter.py81 def generate_order_fills_report(orders: list) -> pd.DataFrame:CODE
LOWpython/nautilus_trader/analysis/reporter.py142 def generate_positions_report(CODE
LOWpython/nautilus_trader/analysis/tearsheet.py116def _format_optional_duration(start_ns: int | None, end_ns: int | None) -> str:CODE
LOWpython/nautilus_trader/analysis/tearsheet.py500def _create_tearsheet_from_result(CODE
LOWpython/nautilus_trader/analysis/tearsheet.py550def _validate_result_node_state(node: BacktestNode, run_config_id: str) -> None:CODE
LOWpython/nautilus_trader/analysis/tearsheet.py645def _resolve_tearsheet_returns(CODE
LOWpython/nautilus_trader/analysis/tearsheet.py668def _calculate_snapshot_returns(CODE
LOWpython/nautilus_trader/analysis/tearsheet.py824def _calculate_account_returns(CODE
LOWpython/nautilus_trader/analysis/tearsheet.py908def _extract_account_balance_series(CODE
LOWpython/nautilus_trader/analysis/tearsheet.py937def _calculate_daily_balance_returns(total_balance: pd.Series) -> pd.Series | None:CODE
LOWpython/nautilus_trader/analysis/tearsheet.py955def _aggregate_period_returns(CODE
LOWpython/nautilus_trader/analysis/tearsheet.py975def create_tearsheet_from_stats(CODE
LOWpython/nautilus_trader/analysis/tearsheet.py1258def create_monthly_returns_heatmap(CODE
LOWpython/nautilus_trader/analysis/tearsheet.py1361def create_returns_distribution(CODE
LOWpython/tests/unit/test_msgbus.py70def test_register_adds_endpoint(bus: object) -> None:CODE
LOWpython/tests/unit/test_msgbus.py78def test_deregister_removes_endpoint(bus: object) -> None:CODE
LOWpython/tests/unit/test_msgbus.py88def test_send_delivers_to_endpoint(bus: object) -> None:CODE
LOWpython/tests/unit/test_msgbus.py166def test_has_subscribers_with_pattern(bus: object) -> None:CODE
LOWpython/tests/unit/test_msgbus.py175def test_subscribe_adds_topic(bus: object) -> None:CODE
1719 more matches not shown…
AI Slop Vocabulary122 hits · 396 pts
SeverityFileLineSnippetContext
MEDIUMCargo.toml530# Cargo ignores `panic` for bench profile (harness requires unwind to catch failures)COMMENT
MEDIUMcrates/testkit/src/lib.rs19//! file handling, and common testing patterns. This crate supports robust testing workflowsCOMMENT
MEDIUMcrates/backtest/src/config.rs510 /// The account default leverage, or `None` to use the account-type default.COMMENT
MEDIUMcrates/backtest/src/config.rs512 /// The instrument specific leverage configuration (for margin accounts).COMMENT
MEDIUMcrates/backtest/src/config.rs1234 fn test_non_positive_default_leverage_rejected(#[case] leverage: Decimal) {CODE
MEDIUMcrates/backtest/src/config.rs1252 fn test_simulated_non_positive_instrument_leverage_rejected(#[case] leverage: Decimal) {CODE
MEDIUMcrates/backtest/src/config.rs1450 fn test_non_positive_sim_default_leverage_rejected(#[case] leverage: Decimal) {CODE
MEDIUMcrates/adapters/okx/src/config.rs299 /// Enables margin/leverage for SPOT trading when true.COMMENT
MEDIUMcrates/adapters/okx/src/http/client.rs1050 /// Requests position tiers information, maximum leverage depends on your borrowings and margin ratio.COMMENT
MEDIUMcrates/adapters/okx/src/http/models.rs515 /// Maximum available leverage.COMMENT
MEDIUMcrates/adapters/okx/src/http/models.rs617 /// Notional leverage.COMMENT
MEDIUMcrates/adapters/okx/src/http/models.rs684 /// Position leverage.COMMENT
MEDIUMcrates/adapters/okx/src/http/models.rs1202 /// Algo leverage configuration.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/common/models.rs702 /// converting balances and handling the margin account type since Hyperliquid supports leverage.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/common/enums.rs499 // Normalize: trim whitespace and convert to lowercase for robust matchingCOMMENT
MEDIUMcrates/adapters/hyperliquid/src/common/enums.rs573 /// **Deprecated**: This method uses substring matching which is fragile and not robust.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/query.rs39 /// Update leverage for an assetCOMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/query.rs82/// Parameters for updating leverage.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/query.rs485 /// Creates an action to update leverage for an asset.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/query.rs743 assert!(json.contains(r#""leverage":10"#));CODE
MEDIUMcrates/adapters/hyperliquid/src/http/models.rs129 /// Maximum leverage allowed for this asset.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/models.rs146 /// Margin tables for leverage tiers.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/models.rs162 /// Maximum leverage allowed for this asset.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/models.rs179/// Margin table with leverage tiers.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/models.rs200 /// Maximum leverage for this tier.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/models.rs1838 /// Update leverage for a position.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/models.rs1848 #[serde(rename = "leverage")]COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/models.rs2199 /// Maximum leverage allowed for this asset.COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/rate_limits.rs147/// We count the largest array in the response (robust to schema variants).COMMENT
MEDIUMcrates/adapters/hyperliquid/src/http/parse.rs133 /// Maximum leverage (for perps).COMMENT
MEDIUMcrates/adapters/bitmex/src/websocket/messages.rs1186 /// Margin leverageCOMMENT
MEDIUMcrates/adapters/bitmex/src/python/http.rs125 /// Update position leverage.COMMENT
MEDIUMcrates/adapters/bitmex/src/python/http.rs142 // Call the leverage update method once it's implementedCOMMENT
MEDIUMcrates/adapters/bitmex/src/python/http.rs143 // let report = client.update_position_leverage(&symbol, leverage)COMMENT
MEDIUMcrates/adapters/bitmex/src/http/client.rs860 /// Update position leverage.COMMENT
MEDIUMcrates/adapters/bitmex/src/http/client.rs2721 /// Update position leverage.COMMENT
MEDIUMcrates/adapters/bitmex/src/http/query.rs445/// Parameters for the POST /position/leverage endpoint.COMMENT
MEDIUMcrates/adapters/bitmex/src/http/query.rs451 /// Symbol to set leverage for.COMMENT
MEDIUMcrates/adapters/bitmex/src/http/query.rs455 /// Optional leverage for long position (isolated margin only).COMMENT
MEDIUMcrates/adapters/coinbase/src/config.rs173 /// Optional default leverage applied to derivatives orders. Ignored onCOMMENT
MEDIUMcrates/adapters/derive/tests/data_client.rs1982 // Wait until the REST call lands on the mock so the test is robustCOMMENT
MEDIUMcrates/adapters/derive/src/http/models.rs706 /// Effective leverage (perps only).COMMENT
MEDIUMcrates/adapters/deribit/src/http/models.rs78 /// Maximal leverage for instrument (only for futures)COMMENT
MEDIUMcrates/adapters/sandbox/src/config.rs63 /// The account default leverage (for margin accounts).COMMENT
MEDIUMcrates/adapters/sandbox/src/config.rs66 /// Per-instrument leverage overrides.COMMENT
MEDIUMcrates/adapters/bybit/src/config.rs238 /// Leverage configuration for futures (symbol -> leverage).COMMENT
MEDIUMcrates/adapters/bybit/src/python/http.rs335 /// Sets leverage for a symbol (requires authentication).COMMENT
MEDIUMcrates/adapters/bybit/src/python/http.rs346 /// - <https://bybit-exchange.github.io/docs/v5/position/leverage>COMMENT
MEDIUMcrates/adapters/bybit/src/common/models.rs43/// Common leverage filter that describes leverage bounds and step.COMMENT
MEDIUMcrates/adapters/bybit/src/common/models.rs47 /// Minimum leverage supported.COMMENT
MEDIUMcrates/adapters/bybit/src/common/models.rs49 /// Maximum leverage supported.COMMENT
MEDIUMcrates/adapters/bybit/src/common/models.rs51 /// Step between successive leverage values.COMMENT
MEDIUMcrates/adapters/bybit/src/common/parse.rs1693 /// expects. BBO, `position_idx`, and leverage stay separate because they are alreadyCOMMENT
MEDIUMcrates/adapters/bybit/src/common/rate_limit.rs785 #[case("/v5/position/set-leverage", Some(BybitProductType::Linear), 10)]COMMENT
MEDIUMcrates/adapters/bybit/src/http/client.rs1260 /// Sets leverage for a symbol.COMMENT
MEDIUMcrates/adapters/bybit/src/http/client.rs1275 /// - <https://bybit-exchange.github.io/docs/v5/position/leverage>COMMENT
MEDIUMcrates/adapters/bybit/src/http/client.rs2232 /// Sets leverage for a symbol (requires authentication).COMMENT
MEDIUMcrates/adapters/bybit/src/http/client.rs2243 /// - <https://bybit-exchange.github.io/docs/v5/position/leverage>COMMENT
MEDIUMcrates/adapters/bybit/src/http/query.rs277/// Body parameters for `POST /v5/position/set-leverage`.COMMENT
MEDIUMcrates/adapters/bybit/src/http/query.rs280/// - <https://bybit-exchange.github.io/docs/v5/position/leverage>COMMENT
62 more matches not shown…
Unused Imports237 hits · 218 pts
SeverityFileLineSnippetContext
LOW…tes/adapters/derive/tests/oracle-py/generate_oracle.py49CODE
LOW…es/adapters/lighter/tests/oracle-py/generate_oracle.py30CODE
LOWpython/generate_docstrings.py34CODE
LOWpython/generate_stubs.py26CODE
LOWpython/nautilus_trader/__init__.py26CODE
LOWpython/nautilus_trader/core/__init__.py20CODE
LOWpython/nautilus_trader/core/__init__.py21CODE
LOWpython/nautilus_trader/core/__init__.py22CODE
LOWpython/nautilus_trader/core/datetime.py19CODE
LOWpython/nautilus_trader/core/datetime.py26CODE
LOWpython/nautilus_trader/core/datetime.py27CODE
LOWpython/nautilus_trader/core/datetime.py28CODE
LOWpython/nautilus_trader/core/datetime.py29CODE
LOWpython/nautilus_trader/core/datetime.py30CODE
LOWpython/nautilus_trader/core/datetime.py31CODE
LOWpython/nautilus_trader/core/datetime.py32CODE
LOWpython/nautilus_trader/core/datetime.py33CODE
LOWpython/nautilus_trader/core/datetime.py34CODE
LOWpython/nautilus_trader/core/datetime.py35CODE
LOWpython/nautilus_trader/analysis/themes.py19CODE
LOWpython/nautilus_trader/analysis/config.py19CODE
LOWpython/nautilus_trader/analysis/reporter.py23CODE
LOWpython/nautilus_trader/analysis/__init__.py21CODE
LOWpython/nautilus_trader/analysis/__init__.py27CODE
LOWpython/nautilus_trader/analysis/__init__.py28CODE
LOWpython/nautilus_trader/analysis/__init__.py31CODE
LOWpython/nautilus_trader/analysis/__init__.py32CODE
LOWpython/nautilus_trader/analysis/__init__.py33CODE
LOWpython/nautilus_trader/analysis/__init__.py34CODE
LOWpython/nautilus_trader/analysis/__init__.py35CODE
LOWpython/nautilus_trader/analysis/__init__.py36CODE
LOWpython/nautilus_trader/analysis/__init__.py37CODE
LOWpython/nautilus_trader/analysis/__init__.py40CODE
LOWpython/nautilus_trader/analysis/__init__.py43CODE
LOWpython/nautilus_trader/analysis/__init__.py44CODE
LOWpython/nautilus_trader/analysis/__init__.py45CODE
LOWpython/nautilus_trader/analysis/__init__.py48CODE
LOWpython/nautilus_trader/analysis/__init__.py49CODE
LOWpython/nautilus_trader/analysis/__init__.py50CODE
LOWpython/nautilus_trader/analysis/__init__.py51CODE
LOWpython/nautilus_trader/analysis/__init__.py52CODE
LOWpython/nautilus_trader/analysis/__init__.py55CODE
LOWpython/nautilus_trader/analysis/__init__.py58CODE
LOWpython/nautilus_trader/analysis/__init__.py59CODE
LOWpython/nautilus_trader/analysis/__init__.py60CODE
LOWpython/nautilus_trader/analysis/__init__.py63CODE
LOWpython/nautilus_trader/analysis/__init__.py64CODE
LOWpython/nautilus_trader/analysis/__init__.py65CODE
LOWpython/nautilus_trader/analysis/__init__.py66CODE
LOWpython/nautilus_trader/analysis/__init__.py67CODE
LOWpython/nautilus_trader/analysis/__init__.py68CODE
LOWpython/nautilus_trader/analysis/__init__.py69CODE
LOWpython/nautilus_trader/analysis/__init__.py70CODE
LOWpython/nautilus_trader/analysis/tearsheet.py23CODE
LOWpython/nautilus_trader/config/__init__.py22CODE
LOWpython/nautilus_trader/config/__init__.py23CODE
LOWpython/nautilus_trader/config/__init__.py24CODE
LOWpython/nautilus_trader/config/__init__.py25CODE
LOWpython/nautilus_trader/config/__init__.py26CODE
LOWpython/nautilus_trader/config/__init__.py27CODE
177 more matches not shown…
Cross-File Repetition41 hits · 205 pts
SeverityFileLineSnippetContext
HIGHpython/tests/unit/indicators/test_ema.py0test initialized with required inputs returns true.STRING
HIGHpython/tests/unit/indicators/test_atr.py0test initialized with required inputs returns true.STRING
HIGHpython/tests/unit/indicators/test_hma.py0test initialized with required inputs returns true.STRING
HIGHpython/tests/unit/indicators/test_aroon.py0test initialized with required inputs returns true.STRING
HIGHpython/tests/unit/indicators/test_rsi.py0test initialized with required inputs returns true.STRING
HIGHpython/tests/unit/indicators/test_dema.py0test initialized with required inputs returns true.STRING
HIGHpython/tests/unit/indicators/test_rma.py0test initialized with required inputs returns true.STRING
HIGHpython/tests/unit/indicators/test_sma.py0test initialized with required inputs returns true.STRING
HIGHpython/tests/unit/indicators/test_efficiency_ratio.py0test initialized with required inputs returns true.STRING
HIGHpython/tests/unit/indicators/test_ema.py0test value with three inputs returns expected value.STRING
HIGHpython/tests/unit/indicators/test_hma.py0test value with three inputs returns expected value.STRING
HIGHpython/tests/unit/indicators/test_dema.py0test value with three inputs returns expected value.STRING
HIGHpython/tests/unit/indicators/test_rma.py0test value with three inputs returns expected value.STRING
HIGHpython/tests/unit/indicators/test_sma.py0test value with three inputs returns expected value.STRING
HIGHpython/tests/unit/indicators/test_ema.py0test reset successfully returns indicator to fresh state.STRING
HIGHpython/tests/unit/indicators/test_atr.py0test reset successfully returns indicator to fresh state.STRING
HIGHpython/tests/unit/indicators/test_hma.py0test reset successfully returns indicator to fresh state.STRING
HIGHpython/tests/unit/indicators/test_aroon.py0test reset successfully returns indicator to fresh state.STRING
HIGHpython/tests/unit/indicators/test_rsi.py0test reset successfully returns indicator to fresh state.STRING
HIGHpython/tests/unit/indicators/test_dema.py0test reset successfully returns indicator to fresh state.STRING
HIGHpython/tests/unit/indicators/test_rma.py0test reset successfully returns indicator to fresh state.STRING
HIGHpython/tests/unit/indicators/test_sma.py0test reset successfully returns indicator to fresh state.STRING
HIGHpython/tests/unit/indicators/test_efficiency_ratio.py0test reset successfully returns indicator to fresh state.STRING
HIGHexamples/live/okx/exec_tester.py0test binance spot execution with the built-in exectester strategy. warning: this example connects to binance and places STRING
HIGHexamples/live/hyperliquid/exec_tester.py0test binance spot execution with the built-in exectester strategy. warning: this example connects to binance and places STRING
HIGHexamples/live/coinbase/exec_tester.py0test binance spot execution with the built-in exectester strategy. warning: this example connects to binance and places STRING
HIGHexamples/live/bybit/exec_tester.py0test binance spot execution with the built-in exectester strategy. warning: this example connects to binance and places STRING
HIGHexamples/live/dydx/exec_tester.py0test binance spot execution with the built-in exectester strategy. warning: this example connects to binance and places STRING
HIGHexamples/live/kraken/exec_tester.py0test binance spot execution with the built-in exectester strategy. warning: this example connects to binance and places STRING
HIGHexamples/live/binance/exec_tester.py0test binance spot execution with the built-in exectester strategy. warning: this example connects to binance and places STRING
HIGHexamples/live/architect_ax/exec_tester.py0test deribit execution with the built-in exectester strategy. this example connects to the deribit testnet and places liSTRING
HIGHexamples/live/derive/exec_tester.py0test deribit execution with the built-in exectester strategy. this example connects to the deribit testnet and places liSTRING
HIGHexamples/live/deribit/exec_tester.py0test deribit execution with the built-in exectester strategy. this example connects to the deribit testnet and places liSTRING
HIGHexamples/live/hyperliquid/data_tester.py0stream kraken market data with the built-in datatester actor. running this example connects to kraken and starts subscriSTRING
HIGHexamples/live/coinbase/data_tester.py0stream kraken market data with the built-in datatester actor. running this example connects to kraken and starts subscriSTRING
HIGHexamples/live/polymarket/data_tester.py0stream kraken market data with the built-in datatester actor. running this example connects to kraken and starts subscriSTRING
HIGHexamples/live/derive/data_tester.py0stream kraken market data with the built-in datatester actor. running this example connects to kraken and starts subscriSTRING
HIGHexamples/live/deribit/data_tester.py0stream kraken market data with the built-in datatester actor. running this example connects to kraken and starts subscriSTRING
HIGHexamples/live/bybit/data_tester.py0stream kraken market data with the built-in datatester actor. running this example connects to kraken and starts subscriSTRING
HIGHexamples/live/dydx/data_tester.py0stream kraken market data with the built-in datatester actor. running this example connects to kraken and starts subscriSTRING
HIGHexamples/live/kraken/data_tester.py0stream kraken market data with the built-in datatester actor. running this example connects to kraken and starts subscriSTRING
Magic Placeholder Names19 hits · 98 pts
SeverityFileLineSnippetContext
HIGHcrates/adapters/tardis/bin/example_replay.rs24// -e "TM_API_KEY=YOUR_API_KEY" \COMMENT
HIGHcrates/adapters/binance/README.md51export BINANCE_API_KEY="your-api-key-from-binance"CODE
HIGHdocs/how_to/run_rust_live_trading.md123export OKX_API_KEY="your_api_key"CODE
HIGHdocs/integrations/binance.md1182export BINANCE_API_KEY="your-api-key-from-binance"CODE
HIGHdocs/integrations/binance.md1278 api_key="YOUR_API_KEY",CODE
HIGHdocs/integrations/bybit.md111 api_key="YOUR_API_KEY",CODE
HIGHdocs/integrations/bybit.md581 api_key="YOUR_API_KEY",CODE
HIGHdocs/integrations/kraken.md504 api_key="YOUR_API_KEY",CODE
HIGHdocs/integrations/kraken.md537 api_key="YOUR_API_KEY",CODE
HIGHdocs/integrations/okx.md895export OKX_API_KEY="your_api_key"CODE
HIGHdocs/integrations/bitmex.md598 api_key="YOUR_API_KEY",CODE
HIGHdocs/integrations/bitmex.md666 api_key="YOUR_API_KEY",CODE
HIGHdocs/integrations/bitmex.md740 api_key="YOUR_API_KEY",CODE
HIGHdocs/integrations/bitmex.md865 api_key="YOUR_API_KEY", # Or use os.getenv("BITMEX_API_KEY")CODE
HIGHdocs/integrations/bitmex.md871 api_key="YOUR_API_KEY",CODE
HIGHdocs/integrations/coinbase.md143 api_key="YOUR_API_KEY",CODE
HIGHdocs/tutorials/options_data_bybit.md62export BYBIT_API_KEY="your-api-key"CODE
HIGHdocs/tutorials/delta_neutral_options_bybit.md33export BYBIT_API_KEY="your-api-key"CODE
HIGHdocs/tutorials/gold_book_imbalance_ax.md72export DATABENTO_API_KEY="your-api-key"CODE
Verbosity Indicators28 hits · 54 pts
SeverityFileLineSnippetContext
LOWcrates/network/src/websocket/auth.rs691 // Step 1: Begin authenticationCOMMENT
LOWcrates/network/src/websocket/auth.rs694 // Step 2: Spawn resubscription task that waits for authCOMMENT
LOWcrates/adapters/okx/src/websocket/client.rs4431 client.subscriptions_state.confirm_unsubscribe(topic); // Step 1: clear pending_unsubscribeCODE
LOWcrates/adapters/okx/src/websocket/client.rs4432 client.subscriptions_state.mark_subscribe(topic); // Step 2: mark as subscribingCODE
LOWcrates/adapters/okx/src/websocket/client.rs4433 client.subscriptions_state.confirm_subscribe(topic); // Step 3: confirm subscriptionCODE
LOWcrates/adapters/hyperliquid/src/signing/signers.rs128 // Step 4: Create Agent structCOMMENT
LOWcrates/adapters/hyperliquid/src/signing/signers.rs136 // Step 5: Sign Agent with EIP-712COMMENT
LOWcrates/adapters/bitmex/src/websocket/client.rs1423 client.subscriptions.confirm_unsubscribe(&topic); // Step 1: clear pending_unsubscribeCODE
LOWcrates/adapters/bitmex/src/websocket/client.rs1424 client.subscriptions.mark_subscribe(&topic); // Step 2: mark as subscribingCODE
LOWcrates/adapters/bitmex/src/websocket/client.rs1425 client.subscriptions.confirm_subscribe(&topic); // Step 3: confirm subscriptionCODE
LOWcrates/adapters/polymarket/src/websocket/dispatch.rs2476 // Step 1: Dispatch cancel (simulates message A from the bug)COMMENT
LOWcrates/adapters/polymarket/src/websocket/dispatch.rs2486 // Step 2: Dispatch trade fill (simulates trade arriving after cancel)COMMENT
LOWcrates/adapters/polymarket/src/execution/responses.rs2502 // Step 1: the WS taker trade arrives BEFORE the submit response. The order is not yetCOMMENT
LOWcrates/adapters/polymarket/src/execution/responses.rs2527 // Step 2: the submit response arrives, registers the order, and drains the buffered fillCOMMENT
LOWcrates/adapters/polymarket/src/execution/responses.rs2611 // Step 1: the WS cancel arrives BEFORE the submit response and buffers (order unregistered)COMMENT
LOWcrates/adapters/polymarket/src/execution/responses.rs2633 // Step 2: the submit response registers the order and drains the buffered cancelCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1069 // Step 1: Register DEXCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1079 // Step 2: Subscribe to eventsCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1085 // Step 3: Verify subscriptionsCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1091 // Step 4: Get event signaturesCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1095 // Step 5: Unsubscribe from some eventsCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1099 // Step 6: Verify remaining subscriptions (only pool1 mint remains)COMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py131 # Step 2: Define exchange and add it to the engineCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py142 # Step 3: Create instrument definition and add it to the engineCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py167 # Step 5: Create strategy and add it to the engineCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py171 # Step 6: Run engine = Run backtestCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py174 # Step 7: Release system resourcesCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py117 # Step 1: Configure and create backtest engineCOMMENT
Structural Annotation Overuse28 hits · 54 pts
SeverityFileLineSnippetContext
LOWcrates/network/src/websocket/auth.rs691 // Step 1: Begin authenticationCOMMENT
LOWcrates/network/src/websocket/auth.rs694 // Step 2: Spawn resubscription task that waits for authCOMMENT
LOWcrates/adapters/okx/src/websocket/client.rs4431 client.subscriptions_state.confirm_unsubscribe(topic); // Step 1: clear pending_unsubscribeCODE
LOWcrates/adapters/okx/src/websocket/client.rs4432 client.subscriptions_state.mark_subscribe(topic); // Step 2: mark as subscribingCODE
LOWcrates/adapters/okx/src/websocket/client.rs4433 client.subscriptions_state.confirm_subscribe(topic); // Step 3: confirm subscriptionCODE
LOWcrates/adapters/hyperliquid/src/signing/signers.rs128 // Step 4: Create Agent structCOMMENT
LOWcrates/adapters/hyperliquid/src/signing/signers.rs136 // Step 5: Sign Agent with EIP-712COMMENT
LOWcrates/adapters/bitmex/src/websocket/client.rs1423 client.subscriptions.confirm_unsubscribe(&topic); // Step 1: clear pending_unsubscribeCODE
LOWcrates/adapters/bitmex/src/websocket/client.rs1424 client.subscriptions.mark_subscribe(&topic); // Step 2: mark as subscribingCODE
LOWcrates/adapters/bitmex/src/websocket/client.rs1425 client.subscriptions.confirm_subscribe(&topic); // Step 3: confirm subscriptionCODE
LOWcrates/adapters/polymarket/src/websocket/dispatch.rs2476 // Step 1: Dispatch cancel (simulates message A from the bug)COMMENT
LOWcrates/adapters/polymarket/src/websocket/dispatch.rs2486 // Step 2: Dispatch trade fill (simulates trade arriving after cancel)COMMENT
LOWcrates/adapters/polymarket/src/execution/responses.rs2502 // Step 1: the WS taker trade arrives BEFORE the submit response. The order is not yetCOMMENT
LOWcrates/adapters/polymarket/src/execution/responses.rs2527 // Step 2: the submit response arrives, registers the order, and drains the buffered fillCOMMENT
LOWcrates/adapters/polymarket/src/execution/responses.rs2611 // Step 1: the WS cancel arrives BEFORE the submit response and buffers (order unregistered)COMMENT
LOWcrates/adapters/polymarket/src/execution/responses.rs2633 // Step 2: the submit response registers the order and drains the buffered cancelCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1069 // Step 1: Register DEXCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1079 // Step 2: Subscribe to eventsCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1085 // Step 3: Verify subscriptionsCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1091 // Step 4: Get event signaturesCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1095 // Step 5: Unsubscribe from some eventsCOMMENT
LOWcrates/adapters/blockchain/src/data/subscription.rs1099 // Step 6: Verify remaining subscriptions (only pool1 mint remains)COMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py131 # Step 2: Define exchange and add it to the engineCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py142 # Step 3: Create instrument definition and add it to the engineCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py167 # Step 5: Create strategy and add it to the engineCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py171 # Step 6: Run engine = Run backtestCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py174 # Step 7: Release system resourcesCOMMENT
LOW…ples/other/minimal_reproducible_example/run_example.py117 # Step 1: Configure and create backtest engineCOMMENT
Deep Nesting62 hits · 51 pts
SeverityFileLineSnippetContext
LOWpython/generate_docstrings.py117CODE
LOWpython/generate_docstrings.py209CODE
LOWpython/generate_docstrings.py385CODE
LOWpython/generate_stubs.py445CODE
LOWpython/generate_stubs.py667CODE
LOWpython/generate_stubs.py728CODE
LOWpython/generate_stubs.py839CODE
LOWpython/generate_stubs.py1124CODE
LOWpython/generate_stubs.py1186CODE
LOWpython/generate_stubs.py1344CODE
LOWpython/generate_stubs.py1440CODE
LOWpython/generate_stubs.py2231CODE
LOWpython/generate_stubs.py2446CODE
LOWpython/generate_stubs.py2468CODE
LOWpython/generate_stubs.py2491CODE
LOWpython/generate_stubs.py2507CODE
LOWpython/generate_stubs.py2675CODE
LOWpython/generate_stubs.py2711CODE
LOWpython/generate_stubs.py2741CODE
LOWpython/generate_stubs.py3060CODE
LOWpython/generate_stubs.py3223CODE
LOWpython/nautilus_trader/analysis/tearsheet.py596CODE
LOWpython/nautilus_trader/analysis/tearsheet.py2473CODE
LOWpython/tests/unit/test_generate_stubs.py1893CODE
LOWpython/tests/unit/test_generate_stubs.py2048CODE
LOWpython/tests/unit/test_generate_stubs.py2744CODE
LOWpython/tests/unit/test_generate_stubs.py3211CODE
LOWpython/tests/unit/test_generate_stubs.py3285CODE
LOWpython/tests/unit/test_public_module_names.py67CODE
LOWpython/tests/unit/analysis/test_reporter.py360CODE
LOWpython/tests/unit/indicators/test_python_handlers.py65CODE
LOW…sts/unit/adapters/polymarket/test_polymarket_loader.py103CODE
LOWpython/tests/integration/test_live_node_uvicorn.py63CODE
LOWpython/tests/integration/test_live_node_uvicorn.py71CODE
LOWpython/tests/strategies/backtest_surface.py131CODE
LOWpython/tests/strategies/backtest_surface.py343CODE
LOWpython/tests/acceptance/test_backtest.py1350CODE
LOW.pre-commit-hooks/check_pyo3_names.py40CODE
LOW.pre-commit-hooks/check_pyo3_names.py112CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py19CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py158CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py272CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py313CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py410CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py583CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py609CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py32CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py1115CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py1147CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py1252CODE
LOWdocs/tutorials/orderbook_data.py145CODE
LOWdocs/tutorials/ema_cross.py63CODE
LOW…cs/tutorials/assets/hurst_vpin_kraken/render_panels.py95CODE
LOWdocs/getting_started/backtest_low_level.py178CODE
LOWdocs/getting_started/quickstart.py75CODE
LOWscripts/benchmark-backtest-versions.py612CODE
LOWscripts/benchmark-backtest-versions.py638CODE
LOWscripts/benchmark-backtest-versions.py1291CODE
LOWscripts/benchmark-backtest-versions.py1508CODE
LOWscripts/benchmark-backtest-versions.py687CODE
2 more matches not shown…
Cross-Language Confusion7 hits · 50 pts
SeverityFileLineSnippetContext
HIGHpython/tests/unit/analysis/test_reporter.py413 assert orders.equals(expected)CODE
HIGHpython/tests/unit/backtest/test_backtest_node.py645 assert orders_report.equals(ReportProvider.generate_orders_report(orders))CODE
HIGHpython/tests/unit/backtest/test_backtest_node.py646 assert order_fills_report.equals(ReportProvider.generate_order_fills_report(orders))CODE
HIGHpython/tests/unit/backtest/test_backtest_node.py647 assert fills_report.equals(ReportProvider.generate_fills_report(orders))CODE
HIGHpython/tests/unit/backtest/test_backtest_node.py648 assert positions_report.equals(CODE
HIGHpython/tests/unit/backtest/test_backtest_node.py651 assert account_report.equals(ReportProvider.generate_account_report(account))CODE
HIGHpython/tests/unit/backtest/test_backtest_node.py652 assert account_report_by_id.equals(account_report)CODE
Self-Referential Comments17 hits · 48 pts
SeverityFileLineSnippetContext
MEDIUMpython/generate_stubs.py53# This file is automatically generated by pyo3_stub_genCOMMENT
MEDIUMpython/tests/unit/test_public_module_names.py30GENERATED_HEADER = "# This file is automatically generated by pyo3_stub_gen"CODE
MEDIUM.pre-commit-hooks/cargo_fmt_stable.sh11# Create an empty rustfmt.toml in the temp directoryCOMMENT
MEDIUMpatches/pyo3-stub-gen/src/generate/module.rs53 writeln!(f, "# This file is automatically generated by pyo3_stub_gen")?;CODE
MEDIUMpatches/pyo3-stub-gen/src/generate/module.rs311 writeln!(f, "# This file is automatically generated by pyo3_stub_gen")?;CODE
MEDIUMpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py988 # Create a list item with a referenceCOMMENT
MEDIUMpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py995 # Create a reference to the submodule's documentation pageCOMMENT
MEDIUMpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py1074 # Create a single bullet list for all submodulesCOMMENT
MEDIUMpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py1209 # Create a single bullet list for all submodulesCOMMENT
MEDIUMdocs/how_to/data_catalog_databento.py114# Create a catalog instanceCOMMENT
MEDIUMdocs/tutorials/orderbook_imbalance.py4# Define the reusable order book imbalance strategy used by the Binance and BybitCOMMENT
MEDIUMdocs/tutorials/ema_cross.py4# Define the reusable bar-based EMA cross strategy used by the FX bars tutorial.COMMENT
MEDIUMdocs/tutorials/backtest_orderbook_binance.py139# Define the instrument with the public model API, then convert each loader rowCOMMENT
MEDIUMdocs/getting_started/backtest_high_level.py77# Create a EUR/USD instrument on the SIM venue and parse the CSV into quote ticksCOMMENT
MEDIUMdocs/getting_started/backtest_high_level.py99# Create a catalog instanceCOMMENT
MEDIUMdocs/getting_started/quickstart.py145# Create a EUR/USD instrument on the SIM venueCOMMENT
MEDIUMscripts/install-capnp.sh55 # Create a temp directory with cleanup trapCOMMENT
Modern Structural Boilerplate37 hits · 36 pts
SeverityFileLineSnippetContext
LOWpython/nautilus_trader/core/datetime.py42__all__ = [CODE
LOWpython/nautilus_trader/config/__init__.py57__all__ = [CODE
LOWpython/nautilus_trader/testkit/providers.py59__all__ = [CODE
LOWpython/nautilus_trader/adapters/okx/__init__.py23__all__ = [CODE
LOW…thon/nautilus_trader/adapters/architect_ax/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/hyperliquid/__init__.py23__all__ = [CODE
LOW…utilus_trader/adapters/interactive_brokers/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/bitmex/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/coinbase/__init__.py23__all__ = [CODE
LOWpython/nautilus_trader/adapters/polymarket/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/derive/__init__.py23__all__ = [CODE
LOWpython/nautilus_trader/adapters/blockchain/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/tardis/__init__.py23__all__ = [CODE
LOWpython/nautilus_trader/adapters/deribit/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/sandbox/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/bybit/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/betfair/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/dydx/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/kraken/__init__.py25__all__ = [CODE
LOWpython/nautilus_trader/adapters/lighter/__init__.py23__all__ = [CODE
LOWpython/nautilus_trader/adapters/databento/__init__.py23__all__ = [CODE
LOWpython/nautilus_trader/adapters/binance/__init__.py28__all__ = [CODE
LOWpython/tests/providers.py24__all__ = [CODE
LOWpython/tests/unit/test_generate_stubs.py1485__all__ = ["BINANCE", "MissingSymbol"]CODE
LOWpython/tests/unit/test_generate_stubs.py1490__all__ = ["BINANCE"]CODE
LOWpython/tests/unit/test_generate_stubs.py872 def set_actor_id(self, actor_id: model.ActorId | None = ...) -> None: ...CODE
LOWpython/tests/unit/test_generate_stubs.py1432__all__ = [CODE
LOWpython/tests/unit/test_generate_stubs.py1440__all__ = [CODE
LOWpython/tests/unit/test_generate_stubs.py1539__all__ = [CODE
LOWpython/tests/unit/test_generate_stubs.py1561__all__ = [CODE
LOWpython/tests/unit/test_generate_stubs.py177__all__ = [STRING
LOWpython/tests/unit/test_generate_stubs.py214__all__ = ["TearsheetConfig"]STRING
LOWpython/tests/integration/test_live_node_cache.py103 def set_saved_state(cls, saved_state: dict[str, bytes]) -> None:CODE
LOWpython/tests/integration/test_live_node_cache.py132 def set_saved_state(cls, saved_state: dict[str, bytes]) -> None:CODE
LOWpython/tests/strategies/backtest_surface.py216 def _update_bar_state(self, bar: Bar) -> None:CODE
LOWpython/tests/strategies/acceptance.py739 def _update_indicators(self, bar: Bar) -> None:CODE
LOW…/interactive_brokers/notebooks/order_example_driver.py109def set_databento_request_contracts_default() -> None:CODE
Redundant / Tautological Comments20 hits · 29 pts
SeverityFileLineSnippetContext
LOWpython/generate_stubs.py2092 # Check if D401 is already in the headerSTRING
LOW.pre-commit-hooks/check_non_latin_text.sh7# Check if perl is availableCOMMENT
LOW.pre-commit-hooks/check_tokio_usage.sh54 # Check if tokio appears as a regular dependency (not in [dev-dependencies])COMMENT
LOW.pre-commit-hooks/check_tokio_usage.sh104 # Check if it's Duration specifically (should use std::time::Duration)COMMENT
LOW.pre-commit-hooks/check_nautilus_conventions.sh71 # Check if allow marker in context or current lineCOMMENT
LOW.pre-commit-hooks/check_cargo_conventions.sh343 # Check if the order is correct: rlib before staticlib before cdylibCOMMENT
LOW.pre-commit-hooks/check_cargo_conventions.sh380 # Check if any crate uses this dependency with workspace = trueCOMMENT
LOW.pre-commit-hooks/check_cargo_conventions.sh497 # Check if used by core crates (not in adapters/)COMMENT
LOW.pre-commit-hooks/check_logging_conventions.sh46 # Read file and accumulate multi-line use statementsCOMMENT
LOW.pre-commit-hooks/check_logging_conventions.sh66 # Check if statement is complete (ends with semicolon)COMMENT
LOW.pre-commit-hooks/check_logging_conventions.sh71 # Check if normalized statement contains a forbidden macro as a wordCOMMENT
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py60 # Check if it's a qualified external typeCOMMENT
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py75 # Check if it's py:data or py:class in typing moduleCOMMENT
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py198 # Check if this is a union type by looking for '|' in displayCOMMENT
LOWscripts/find-replace.sh58# Check if ripgrep is availableCOMMENT
LOWscripts/regen-capnp.sh36# Check if capnp is installedCOMMENT
LOWscripts/regen-capnp.sh112# Check if there are any changesCOMMENT
LOWscripts/install-capnp.sh46 # Check if already installed to save timeCOMMENT
LOWscripts/install-capnp.sh92 # Check if already installed with correct versionCOMMENT
LOWscripts/ci/install-nautilus-cli.sh45# Check if forced to build from sourceCOMMENT
Example Usage Blocks7 hits · 10 pts
SeverityFileLineSnippetContext
LOWcrates/adapters/lighter/fuzz/pornin/grind.sh7# Usage:COMMENT
LOWscripts/regen-capnp.sh12# Usage:COMMENT
LOWscripts/purge-orphan-dev-wheels.sh10# Usage:COMMENT
LOWscripts/curate-dataset.sh10# Usage:COMMENT
LOWscripts/ci/publish-release-checksums.sh4# Usage:COMMENT
LOWscripts/ci/publish-cargo-crates.sh4# Usage:COMMENT
LOWscripts/ci/verify-published-registries.bash4# Usage:COMMENT
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHcrates/adapters/betfair/tests/stream_client.rs1042/// venue partitions matched orders by strategy ref / account id as requested.COMMENT
Fake / Example Data4 hits · 4 pts
SeverityFileLineSnippetContext
LOWcrates/adapters/derive/src/execution.rs3373 assert!(msg.contains("placeholder"), "unexpected error: {msg}",);CODE
LOW…ters/deribit/test_data/http_get_account_summaries.json6 "email": "user@example.com",CODE
LOW…test_data/http_get_account_summaries_cross_margin.json6 "email": "user@example.com",CODE
LOWcrates/common/src/messages/system/socket.rs258 #[case("user@example.com")]COMMENT
AI Structural Patterns5 hits · 4 pts
SeverityFileLineSnippetContext
LOWpython/nautilus_trader/analysis/tearsheet.py366CODE
LOWpython/nautilus_trader/analysis/tearsheet.py975CODE
LOWpython/tests/unit/model/factories.py188CODE
LOWpython/tests/unit/model/test_position.py56CODE
LOWpython/tests/strategies/acceptance.py560CODE
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMcrates/adapters/blockchain/examples/node_data_tester.rs53// IMPORTANT: The actor definitions below are EXAMPLE CODE for demonstration purposes.COMMENT
Modern AI Meta-Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMcrates/adapters/lighter/src/signing/tx/encode.rs566 // the helper fail loudly on the test scaffold rather than producingCOMMENT
Excessive Try-Catch Wrapping4 hits · 3 pts
SeverityFileLineSnippetContext
MEDIUMpython/generate_stubs.py299 print(f"Error: {result.stderr}")STRING
LOWpython/tests/unit/test_generate_stubs.py3438 except Exception: # noqa: S112STRING
LOWpython/tests/unit/analysis/test_tearsheet.py941 except Exception as e:CODE
LOWpatches/pyo3-stub-gen/src/docgen/sphinx_ext.py383 except Exception:CODE
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWcrates/persistence/src/backend/feather.rs550 /// TODO: Fix error type to handle arrow error and object store errorCOMMENT