Algorithmic trading firm licensing thresholds
Skill HimanshuJ16/Algo-Trading-Skills/skills/algorithmic-trading-firm-licensing-thresholds
Evaluates proprietary trading activity against global regulatory thresholds (SEC Rule 15b9-1, MiFID II, SEBI) to trigger mandatory firm licensing and registration alerts.From its SKILL.md
npx -y skills add HimanshuJ16/Algo-Trading-Skills --skill algorithmic-trading-firm-licensing-thresholdsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.6 KB, as published. Nobody here has run it
When to Use
Use this skill when auditing a proprietary trading firm or hedge fund to verify that trading activity has not crossed regulatory thresholds requiring formal licensing or registration. As off-exchange volume, message rates, and customer activity scale, firms frequently cross one or more thresholds (SEC's amended Rule 15b9-1, MiFID II's HFT designation, or SEBI's retail algo limits) that mandate immediate legal and compliance review.
The output is an audit-trail-friendly LicensingComplianceReport. It is not a substitute for legal opinion: every requires_registration = True result must be escalated to the Chief Compliance Officer and qualified regulatory counsel before the desk continues operating.
Prerequisites
- Python 3.9+
- Firm-wide trading metrics measured over a documented rolling window:
off_exchange_volume_usd(dark-pool / ATS executions, in USD)peak_orders_per_second(peak 1-second OPS)is_exchange_member,has_customers, andjurisdiction
- Operating jurisdiction of the firm.
The module does not compute metrics from raw order data; it consumes a pre-aggregated FirmTradingActivity snapshot. Aggregation discipline (windowing, exchange-vs- ATS classification, customer-fund segregation) is unchanged from earlier versions and is treated as a prerequisite.
Workflow
- Data Aggregation: Build the firm's
FirmTradingActivity. The constructor validates jurisdiction, finite non-negative metrics, and rejectsNaN,±inf, orboolmasquerading as numeric. - Threshold Configuration: Construct a
LicensingThresholdEvaluator. Defaults reflect commonly-cited policy benchmarks. Passsebi_retail_ops_limit=,mifid_ii_hft_ops_limit=, orsec_off_exchange_floor_usd=overrides when the firm operates under stricter internal policy. - Threshold Evaluation: Call
evaluator.evaluate(activity). Every triggered rule is collected; the report'sviolationstuple preserves the full list in deterministic order.rule_ididentifies the dominant regulatory chain that drove the decision. - Triaging: Inspect
reason,violations, andrule_id. Ifrequires_registrationisTrue, the desk is non-compliant under the configured thresholds and must throttle or suspend relevant activity until registration is obtained. - Audit: Record the
LicensingComplianceReport(evaluated_at,schema_version,violations,rule_id) in the firm's compliance log. Re-run on a scheduled cadence; thresholds are policy benchmarks that can change.
Common Pitfalls
- Relying on Outdated Exemptions: Assuming a proprietary firm is exempt from FINRA registration because they have no customers. The 2023 SEC amendments to Rule 15b9-1 effectively closed this loophole for modern HFT firms with material off-exchange flow.
- Ignoring Message Rates (EU): Failing to track peak quotes per second can lead to an inadvertent transition into a regulated HFT entity under MiFID II.
- Treating a Single Threshold as Decisive: Real activity can simultaneously breach customer-fund, off-exchange, and OPS thresholds; the report returns every violation. A "compliant" report only means none of the configured rules fired, not that the firm is licensed.
- Confusing Benchmarks with Rule Text: The default OPS limits are practical policy benchmarks. They are not verbatim citations of SEC / ESMA / SEBI rule text and may diverge from current regulation. Always pair the report with counsel-reviewed threshold configuration.
- Logging User-Provided Fields Verbatim: Build downstream logging on
reportattributes only — never on raw call-site strings — to avoid log-injection through free-form fields.
Verification
Run python scripts/test_algorithmic_trading_firm_licensing_thresholds.py to assert threshold breaches trigger non-compliance alerts across US, EU, and IN jurisdictions, that malformed inputs are rejected by the dataclass, that violations are collected and deduped, that LicensingComplianceReport carries stable metadata, and that constructor overrides change the decision.
Related Skills
finra-algo-trading-registration-requirementsmifid-ii-algo-trading-compliance-euindia-sebi-algo-trading-tagging-requirements