When to Use
Use this skill to record what data each strategy actually needs, how fresh each feed must be,
which vendors may serve it, what happens when none of them can, and which strategies a given
vendor outage would stop. Apply it during strategy onboarding, production-readiness review,
data-vendor change assessment, outage triage, and periodic single-point-of-failure review.
When NOT to Use
Do not use it as a failover mechanism. It decides whether a strategy may trade on the data it
currently has; it does not reconnect feeds, reroute subscriptions, or reconcile prices across
vendors — see vendor-outage-fallback-data-source-hierarchy for the failover path itself. It
is also not a pre-trade risk control: a strategy can be fully data-ready and still be over its
exposure or capital limits.
Prerequisites
- Python 3.10+ for the dependency-free reference engine (typed with PEP 604 unions).
- An authoritative inventory of each strategy's feeds, including derived features and reference
data, not only the obvious price feeds.
- Per feed: an ordered vendor preference list, a freshness bound chosen for that feed, the
schema contract version if one is enforced, upstream feeds it is computed from, and whether
loss of every vendor must block trading or may degrade it.
- A health probe per
(feed, vendor) pair. The engine credits a fallback vendor only from an
observation of that vendor; without a probe on the fallback, the fallback does not exist as
far as readiness is concerned.
- Clock discipline across the hosts producing and consuming feed timestamps — a lag computed
against a skewed clock is meaningless.
Read before implementation:
references/standards.md for freshness-tier guidance, the regulatory touchpoints, and an
explicit statement of which numbers are operator-chosen rather than mandated.
references/workflows.md for the registration, evaluation, and triage procedures.
assets/checklist.md for the production sign-off artifact.
Workflow
- Inventory the dependencies: Register a
DataDependencyNode per feed with a stable
feed_id, criticality, ordered vendors, and an explicit max_acceptable_lag_seconds.
The SLA has no default: choose it per feed rather than inheriting one.
- Record derivation edges: Set
upstream_feed_ids on every derived feed. The engine
rejects unknown references, self-loops, and cycles at construction, and never lets a derived
feed score better than its worst upstream.
- Choose the failure response: Leave
failure_response unset to get BLOCK for CRITICAL
feeds and DEGRADE for everything else, or set it explicitly. Setting DEGRADE on a feed means
you accept trading on cached or imputed values for it — decide that deliberately.
- Observe every vendor: Emit one
FeedObservation per (feed_id, vendor_id) you actually
probed, carrying the publication timestamp, health flag, schema version, and any schema
error. Do not synthesise an observation you did not measure.
- Evaluate before trading: Call
evaluate_strategy_readiness(now, observations). Each
feed is served by the highest-preference vendor whose observation is healthy, on-contract,
not future-dated beyond tolerance, and within the freshness bound. Trade only when
is_strategy_ready_to_trade is true, and treat any raised exception as not-ready.
- Act on the report, not the score alone:
blocked_dependencies is a hard stop.
fallback_dependencies and degraded_dependencies are running-on-a-spare signals that
belong in an alert, and warnings surfaces configuration drift — an unmapped feed, an
observation from a vendor outside the hierarchy, a duplicated observation.
- Review single points: Run
assess_vendor_outage(vendor_id) and single_source_feeds()
during design review, and DataDependencyPortfolio.strategies_blocked_by(vendor_id) during
an incident to see which strategies a vendor loss stops.
- Reconcile: Re-check the map against deployed subscriptions and vendor contracts on a
defined cadence. A dependency map that drifts from production is worse than none, because
it is trusted.
Decision Points
- Block versus degrade: Ask what the strategy does with a missing value, not how important
the feed feels. If it imputes and keeps trading, DEGRADE is honest; if it silently reuses the
last value in a price-sensitive calculation, that is BLOCK.
- Freshness bound per feed: Derive it from how fast the underlying quantity moves relative
to the strategy's holding period. A quarterly fundamentals feed and an L2 book do not share
a bound, and the tier table in
references/standards.md is a starting point, not a rule.
- Is the fallback real?: Two vendors count as independent only if they have separate
upstream sources, networks, credentials, and parsers. A "secondary" that redistributes the
primary's data is one vendor wearing two names, and the engine cannot detect that for you.
- Unobserved fallback: A fallback with no health probe scores as unavailable. That is the
intended conservative reading — fix the probe rather than assuming the vendor is fine.
- Score versus blocks:
readiness_score_pct is a scalar summary for dashboards and trend
lines. The gate is is_strategy_ready_to_trade, which requires zero blocked dependencies
and a score at or above the policy minimum. Never re-derive the decision from the score.
- Static projection versus live state:
assess_vendor_outage assumes every remaining
vendor is healthy, so it is an upper bound on resilience. During a correlated outage, use a
live evaluation.
Common Pitfalls
- Crediting an unobserved fallback: Concluding that a secondary vendor is serving because
the primary failed. Nothing observed the secondary; it may be down for the same reason.
- Trusting a fresh timestamp on a derived feed: A feature pipeline computing off a dead
input keeps publishing on schedule with a current timestamp. Only the upstream edge reveals it.
- Unbounded staleness arithmetic:
now - last_updated goes negative when a vendor's clock
runs fast, and a negative lag passes any "lag <= bound" test forever. Future-dated timestamps
beyond a small tolerance are a clock fault, not fresh data.
- Inheriting a default SLA: A CRITICAL order-book feed silently picking up a lenient
default bound is a stale-data incident waiting for a quiet market.
- Treating schema validity as static configuration: Schema conformance is a property of
what the vendor just sent, not of the node definition. Compare the observed schema version
against the contract on every evaluation.
- Single-sourcing quietly: A feed with one vendor is a single point of failure whether or
not anyone wrote that down.
single_source_feeds() makes the list explicit.
- Ignoring warnings: An observation for an unmapped feed usually means the map is stale,
which means the readiness verdict is answering the wrong question.
- Reusing a readiness verdict: A report is a statement about one timestamp. Re-evaluate
before acting rather than caching the verdict across a session.
Expected Outputs and Success Criteria
- A versioned per-strategy node inventory: feed ids, criticality, ordered vendors, freshness
bounds, schema contracts, upstream edges, and failure responses.
- A
StrategyDataDependencyReport per evaluation carrying the readiness score, the trading
verdict, a per-feed DependencyAssessment with state, serving vendor, fault code and lag,
and the blocked/fallback/degraded/unobserved lists plus configuration warnings.
- A
VendorExposure per vendor identifying dependent feeds, sole-sourced feeds, feeds whose
loss would block trading, and the projected readiness after that vendor is lost.
- A portfolio-level list of strategies a given vendor outage would stop.
- Evidence that every configured fallback vendor has a live health probe, and a documented
rationale for the policy weights, credits, and readiness minimum in use.
Verification
Run:
python -m unittest discover -s skills/strategy-specific-data-dependency-mapping/scripts
The suite covers the healthy path and score arithmetic, fallback promotion only on observed
evidence, a feed already serving from a non-primary vendor, freshness at and just past the SLA
bound, future-dated timestamps inside and outside the clock tolerance, schema errors and
contract mismatches, upstream propagation through derived feeds, block-versus-degrade
responses, conservative duplicate-observation resolution, unmapped and out-of-hierarchy
observations, vendor blast radius, portfolio triage, configuration and policy validation,
determinism, and report immutability.
Before production adoption, replay a recorded outage through the engine and confirm the
verdict matches what the desk did, verify that every fallback vendor in the map has a health
probe feeding real observations, and confirm the calling code fails closed when
evaluate_strategy_readiness raises.
Related Skills
vendor-outage-fallback-data-source-hierarchy
reference-data-golden-source-designation
risk-control-dependency-mapping
data-lineage-tracking-for-audit-and-debugging
clock-skew-correction-for-tick-timestamps
data-pipeline-schema-contract-testing
1---2name: strategy-specific-data-dependency-mapping3description: >-4 Use when recording what data each strategy needs, how fresh each feed must be, which5 vendors may serve it and which strategies a given vendor outage would stop, with6 per-feed block or degrade responses.7license: Apache-2.08metadata:9 source: https://skillmd.com/skills/himanshuj16/strategy-specific-data-dependency-mapping10 domain: algorithmic-trading11 subdomain: portfolio-multi-strategy12 tags: risk-management, data-dependency, freshness-sla, vendor-failover, blast-radius13 brokers_frameworks: Broker-agnostic14 version: "2.0.0"15 author: algo-trading-skills-contributors16---1718## When to Use1920Use this skill to record what data each strategy actually needs, how fresh each feed must be,21which vendors may serve it, what happens when none of them can, and which strategies a given22vendor outage would stop. Apply it during strategy onboarding, production-readiness review,23data-vendor change assessment, outage triage, and periodic single-point-of-failure review.2425## When NOT to Use2627Do not use it as a failover mechanism. It decides whether a strategy may trade on the data it28currently has; it does not reconnect feeds, reroute subscriptions, or reconcile prices across29vendors — see `vendor-outage-fallback-data-source-hierarchy` for the failover path itself. It30is also not a pre-trade risk control: a strategy can be fully data-ready and still be over its31exposure or capital limits.3233## Prerequisites3435- Python 3.10+ for the dependency-free reference engine (typed with PEP 604 unions).36- An authoritative inventory of each strategy's feeds, including derived features and reference37 data, not only the obvious price feeds.38- Per feed: an ordered vendor preference list, a freshness bound chosen for *that* feed, the39 schema contract version if one is enforced, upstream feeds it is computed from, and whether40 loss of every vendor must block trading or may degrade it.41- A health probe per `(feed, vendor)` pair. The engine credits a fallback vendor only from an42 observation of that vendor; without a probe on the fallback, the fallback does not exist as43 far as readiness is concerned.44- Clock discipline across the hosts producing and consuming feed timestamps — a lag computed45 against a skewed clock is meaningless.4647Read before implementation:4849- `references/standards.md` for freshness-tier guidance, the regulatory touchpoints, and an50 explicit statement of which numbers are operator-chosen rather than mandated.51- `references/workflows.md` for the registration, evaluation, and triage procedures.52- `assets/checklist.md` for the production sign-off artifact.5354## Workflow55561. **Inventory the dependencies**: Register a `DataDependencyNode` per feed with a stable57 `feed_id`, criticality, ordered `vendors`, and an explicit `max_acceptable_lag_seconds`.58 The SLA has no default: choose it per feed rather than inheriting one.592. **Record derivation edges**: Set `upstream_feed_ids` on every derived feed. The engine60 rejects unknown references, self-loops, and cycles at construction, and never lets a derived61 feed score better than its worst upstream.623. **Choose the failure response**: Leave `failure_response` unset to get BLOCK for CRITICAL63 feeds and DEGRADE for everything else, or set it explicitly. Setting DEGRADE on a feed means64 you accept trading on cached or imputed values for it — decide that deliberately.654. **Observe every vendor**: Emit one `FeedObservation` per `(feed_id, vendor_id)` you actually66 probed, carrying the publication timestamp, health flag, schema version, and any schema67 error. Do not synthesise an observation you did not measure.685. **Evaluate before trading**: Call `evaluate_strategy_readiness(now, observations)`. Each69 feed is served by the highest-preference vendor whose observation is healthy, on-contract,70 not future-dated beyond tolerance, and within the freshness bound. Trade only when71 `is_strategy_ready_to_trade` is true, and treat any raised exception as not-ready.726. **Act on the report, not the score alone**: `blocked_dependencies` is a hard stop.73 `fallback_dependencies` and `degraded_dependencies` are running-on-a-spare signals that74 belong in an alert, and `warnings` surfaces configuration drift — an unmapped feed, an75 observation from a vendor outside the hierarchy, a duplicated observation.767. **Review single points**: Run `assess_vendor_outage(vendor_id)` and `single_source_feeds()`77 during design review, and `DataDependencyPortfolio.strategies_blocked_by(vendor_id)` during78 an incident to see which strategies a vendor loss stops.798. **Reconcile**: Re-check the map against deployed subscriptions and vendor contracts on a80 defined cadence. A dependency map that drifts from production is worse than none, because81 it is trusted.8283## Decision Points8485- **Block versus degrade**: Ask what the strategy does with a missing value, not how important86 the feed feels. If it imputes and keeps trading, DEGRADE is honest; if it silently reuses the87 last value in a price-sensitive calculation, that is BLOCK.88- **Freshness bound per feed**: Derive it from how fast the underlying quantity moves relative89 to the strategy's holding period. A quarterly fundamentals feed and an L2 book do not share90 a bound, and the tier table in `references/standards.md` is a starting point, not a rule.91- **Is the fallback real?**: Two vendors count as independent only if they have separate92 upstream sources, networks, credentials, and parsers. A "secondary" that redistributes the93 primary's data is one vendor wearing two names, and the engine cannot detect that for you.94- **Unobserved fallback**: A fallback with no health probe scores as unavailable. That is the95 intended conservative reading — fix the probe rather than assuming the vendor is fine.96- **Score versus blocks**: `readiness_score_pct` is a scalar summary for dashboards and trend97 lines. The gate is `is_strategy_ready_to_trade`, which requires zero blocked dependencies98 *and* a score at or above the policy minimum. Never re-derive the decision from the score.99- **Static projection versus live state**: `assess_vendor_outage` assumes every remaining100 vendor is healthy, so it is an upper bound on resilience. During a correlated outage, use a101 live evaluation.102103## Common Pitfalls104105- **Crediting an unobserved fallback**: Concluding that a secondary vendor is serving because106 the primary failed. Nothing observed the secondary; it may be down for the same reason.107- **Trusting a fresh timestamp on a derived feed**: A feature pipeline computing off a dead108 input keeps publishing on schedule with a current timestamp. Only the upstream edge reveals it.109- **Unbounded staleness arithmetic**: `now - last_updated` goes negative when a vendor's clock110 runs fast, and a negative lag passes any "lag <= bound" test forever. Future-dated timestamps111 beyond a small tolerance are a clock fault, not fresh data.112- **Inheriting a default SLA**: A CRITICAL order-book feed silently picking up a lenient113 default bound is a stale-data incident waiting for a quiet market.114- **Treating schema validity as static configuration**: Schema conformance is a property of115 what the vendor just sent, not of the node definition. Compare the observed schema version116 against the contract on every evaluation.117- **Single-sourcing quietly**: A feed with one vendor is a single point of failure whether or118 not anyone wrote that down. `single_source_feeds()` makes the list explicit.119- **Ignoring warnings**: An observation for an unmapped feed usually means the map is stale,120 which means the readiness verdict is answering the wrong question.121- **Reusing a readiness verdict**: A report is a statement about one timestamp. Re-evaluate122 before acting rather than caching the verdict across a session.123124## Expected Outputs and Success Criteria125126- A versioned per-strategy node inventory: feed ids, criticality, ordered vendors, freshness127 bounds, schema contracts, upstream edges, and failure responses.128- A `StrategyDataDependencyReport` per evaluation carrying the readiness score, the trading129 verdict, a per-feed `DependencyAssessment` with state, serving vendor, fault code and lag,130 and the blocked/fallback/degraded/unobserved lists plus configuration warnings.131- A `VendorExposure` per vendor identifying dependent feeds, sole-sourced feeds, feeds whose132 loss would block trading, and the projected readiness after that vendor is lost.133- A portfolio-level list of strategies a given vendor outage would stop.134- Evidence that every configured fallback vendor has a live health probe, and a documented135 rationale for the policy weights, credits, and readiness minimum in use.136137## Verification138139Run:140141```bash142python -m unittest discover -s skills/strategy-specific-data-dependency-mapping/scripts143```144145The suite covers the healthy path and score arithmetic, fallback promotion only on observed146evidence, a feed already serving from a non-primary vendor, freshness at and just past the SLA147bound, future-dated timestamps inside and outside the clock tolerance, schema errors and148contract mismatches, upstream propagation through derived feeds, block-versus-degrade149responses, conservative duplicate-observation resolution, unmapped and out-of-hierarchy150observations, vendor blast radius, portfolio triage, configuration and policy validation,151determinism, and report immutability.152153Before production adoption, replay a recorded outage through the engine and confirm the154verdict matches what the desk did, verify that every fallback vendor in the map has a health155probe feeding real observations, and confirm the calling code fails closed when156`evaluate_strategy_readiness` raises.157158## Related Skills159160- `vendor-outage-fallback-data-source-hierarchy`161- `reference-data-golden-source-designation`162- `risk-control-dependency-mapping`163- `data-lineage-tracking-for-audit-and-debugging`164- `clock-skew-correction-for-tick-timestamps`165- `data-pipeline-schema-contract-testing`