A deposit settles at 09:00, reaches the warehouse at 09:18 and is reversed as a chargeback three days later. Each of those moments can produce a different value for the same seven-day deposit feature, and a risk model scoring the player in between sees only one of them. When the score then goes wrong, the post-mortem usually starts with the model: retraining, threshold, drift. In a payments-heavy iGaming stack the cause often sits a layer lower, in an input that passed every schema check and still meant something different from what the model was trained on.
A feature can fail before the model runs
A model can receive a perfectly valid feature vector and still decide badly, because the vector describes the wrong moment, market, currency or account state. Picture three quiet errors: a deposit feature that misses late settlements, a player-risk feature that still holds a record the payments team corrected yesterday, a cross-market aggregate that adds euros to unconverted local-currency amounts. None of them breaks a pipeline, and none shows up in an accuracy report. They surface later, as a commercial or compliance consequence (an offer sent to the wrong segment, a risk flag that never fired), by which point the trail back to the input has gone cold.
A feature data contract writes those hidden assumptions down: what the feature means, who answers for it, when it arrives, how corrections travel, and when consumers must stop trusting it. Its most practical effect is organisational. When data engineering, payments, risk and ML disagree about a feature, as they usually do during an incident, the contract has already named the person who decides and the documented path to repair.
Features are products with a delivery promise
A contract on the source table does not cover any of this. A deposits table can be available and structurally correct while deposit_amount_7d_base_currency is wrong for live scoring. A feature adds its own rules on top: whose value it is (the grain), over what period (the window), who is eligible, how currencies are converted, what an empty value means, and what consumers expect: whether scoring tolerates a 30-minute delay, an old value remains usable, or a correction requires rescoring.
iGaming streams rarely arrive cleanly. Providers send delayed confirmations; settlements can reverse after success; market launches add payment routes with different statuses; and players can move between regulated brands or wallets where shared identifiers have different scope. Each needs an explicit written answer; an understanding buried in old tickets rarely survives the next provider migration.
The wider control plane (governance, feature-store patterns, access controls, and registry design) is covered in this guide to data governance and feature stores for iGaming AI. What follows stays at the level of a single feature: what it promises when things work, and what it does when they don't.
A useful contract separates three clocks: event time, when the player action or operational change happened; ingestion time, when the platform received it; and feature availability time, when the value became safe to read. Confusing them creates quiet leakage: a batch can finish on time while excluding events belonging in a seven-day window.
One deposit feature, with its contract written out in full
This deliberately narrow contract defines a payments-derived player-level feature for settled deposit value. Its thresholds are product choices that each team sets for itself: high-frequency fraud may need a tighter window, while offline reporting may accept a longer one.
feature: deposit_amount_7d_base_currency
version: 2.1.0
definition: >
Sum of successfully settled cash deposits in the trailing seven 24-hour
periods before scoring_time, converted to the player wallet base currency.
grain: player_account_id at scoring_time
business_owner: Head of Payments Product
data_owner: Payments Data Engineering
consumer_owner: ML Risk Operations
type: decimal(18,2)
event_time:
field: provider_settled_at
timezone: UTC
window: [scoring_time - 7d, scoring_time)
availability_time:
field: warehouse_available_at
freshness:
target_max_lag: 20m
breach_action: serve_last_valid_value_and_flag_score
completeness:
rule: reconcile accepted settled events to the payments ledger by market and method
null_policy: null for accounts without a wallet currency; zero only for confirmed no-deposit history
lineage:
sources:
- payments.deposit_status_events
- wallet.currency_reference
transform: payments_features.deposit_amount_7d_v2
downstream: risk_scoring.deposit_signal_v4
pii_class: restricted_pseudonymous
markets:
allowed: [market_code from licensed_brand_registry]
rule: do_not_aggregate_across_brand_or_license_boundary
currencies:
input: original_transaction_currency
conversion: wallet_base_currency_using_event_date_rate
missing_rate_action: quarantine_record_and_raise_data_quality_event
late_events:
acceptance_window: 72h
action: recompute_affected_player_windows_and_publish_correction
corrections:
triggers: [reversal, chargeback, duplicate_void, provider_status_correction]
action: emit_feature_revision_with_reason_code
backfills:
policy: write_new_feature_version_with_run_id_and_effective_from
schema:
compatibility: additive_fields_only_without_major_version
required_fields: [player_account_id, provider_settled_at, amount, currency, status, market_code]
deprecation_policy:
notice_period: 30d
replacement: deposit_amount_7d_base_currency_v3
removal_condition: no_registered_consumer_reads_for_14d
The value lies in the decisions it exposes: zero and null differ; conversion uses the event-date rate rather than the latest one; late events have a bounded repair path; and consumers know freshness-breach behaviour instead of silently receiving a current-looking value.
Store contracts with code, version them with transformation logic, and expose them to producers and registered consumers. A wiki page not checked during deployment or monitored at runtime describes history and promises nothing about delivery.
Event time prevents false freshness
Processing-time contracts suit arrival-based counters, such as provider messages received in the last hour, but are weak for behavioural and financial features. A deposit settled at 09:00 and received at 09:18 belongs in player state at 09:00. Stamp it by arrival time and the seven-day window starts measuring pipeline delays instead of player activity.
Late events need two rules: whether the record is admissible and what must be repaired if it is. A 72-hour acceptance window does not permit untraceable history rewrites. Identify affected player-time windows, recompute them, publish a revision, and retain a reason code. An online model may need a rescoring queue; a training dataset needs a revised value reproducible from the same feature version and source snapshot.
Corrections differ from late events. A provider can report a deposit settled and later issue a reversal or chargeback. Counting the later message as another deposit inflates the feature and downstream segmentation. The feature needs a stable transaction identifier, event-state precedence, and idempotent aggregation. The event log may retain both messages, but the feature must represent the current contractual interpretation at scoring time.
A worked example with illustrative numbers shows how far the readings drift. A player makes four deposits in a week: €250, €400, €300 and €500, a true settled total of €1,450. The €500 deposit settles on Sunday at 23:50 but reaches the warehouse at 00:20 on Monday. A window built on arrival time reports €950 for Sunday night's scoring run, about a third below the truth. On Wednesday the provider reverses the €300 deposit as a chargeback. A feature that treats the reversal message as one more deposit event now reports €1,750; an idempotent one keyed on transaction ID reports €1,150. Say the risk model's affordability trigger sits at €1,200 a week. The first error hides a player who crossed it. The second flags one who has fallen back below it. Neither produces a failed job.
Market and currency changes create a related failure. A licensed market may add a base currency, provider, or wallet model. If market_code is nullable during launch, a global feature can swallow records it must exclude. If an FX rate is unavailable, using a current rate makes history look complete while changing its meaning. Quarantine may reduce coverage for a while, but it exposes the problem instead of faking precision.
Ownership starts with the person who can repair it
The reflex is to hand ownership to the data platform team, since it runs the pipeline. That team can restart a job, but it cannot say whether a provider changed its status mapping, whether a reversal is legitimate, or whether a newly licensed market may enter an aggregate. Those are questions of meaning, and ownership has to sit with whoever holds the right to answer them.
Use three named roles. The business owner approves the definition and accepts the freshness trade-off. The data owner operates source mapping, transformation, reconciliation, and repair. The consumer owner chooses degraded-state model behaviour: last valid value, deferred score, or safe fallback. Compliance or privacy may approve features crossing brands, markets, or sensitive classes, but should not become the default incident operator.
Define incident ownership before the first alert. The feature monitor detects a freshness breach; the data owner acknowledges and classifies it as source delay, transformation failure, schema drift, or reconciliation gap. The consumer owner records whether scores were served, suppressed, or rerun. The business owner closes the incident after the contract is met and player or operational effects are assessed. This evidence ties recovery to the affected feature better than a generic incident channel.
A source change can meet its own contract but break a feature. Payments may add manual_review as a valid status: the schema remains compatible, but logic counting only settled can understate deposits if reviewed records are business-complete. Schema checks cannot resolve this semantic change. Require producer notification for enum or status-precedence changes, provider migrations, and market launches. The ML literature calls this an unstable data dependency, and Hidden Technical Debt in Machine Learning Systems explains why it is so expensive: the input's meaning changes while its format stays valid, and no compiler or schema check notices.
Evidence should show whether a feature was safe to use
Job success and row counts do not prove a feature was fit for a model. Monitoring should establish whether expected data was present, current, plausible under its definition, and traceable to consumers that received an affected version.
| Evidence signal | Contract test | Incident clue | Required record |
|---|---|---|---|
| Freshness lag | Availability time minus latest eligible event time | Source delay or stalled transformation | Breach start, affected feature version, recovery time |
| Completeness reconciliation | Feature-eligible transactions match ledger totals by market and method | Missing provider feed, filter change, or duplicate suppression | Reconciliation result and exception set |
| Schema and enum drift | Required fields and approved status values are present | Provider mapping or release changed semantics | Old and new schema versions, producer notice |
| Distribution check | Null rate, zero rate, and value range stay within expected operating bands | Currency failure, join loss, or unintended backfill | Segment cut, query reference, reviewer decision |
| Consumer exposure | Every score records feature version and quality flag | Model acted while feature was degraded | Score IDs, fallback action, rescore status |
A threshold breach is not the whole incident. A 20-minute lag may be harmless if no scoring occurs, or material when delayed records belong to a market with active payment review. Retain market, provider, currency, feature version, and consumer context; aggregate alerts hide causes and slow repair.
Model monitoring remains necessary. Fresh, complete features can be weak because targets changed, training populations are stale, or the feature was always a poor predictor. Contracts protect input integrity and explainability. Model quality, fairness, calibration and regulatory suitability need their own checks. Andrew Jones makes the same division in Driving Data Quality with Data Contracts (Packt, 2023): a contract is an agreement about the interface between producer and consumer, and it says nothing about whether the consumer used the data wisely.
Backfills must not rewrite production history silently
Backfills can alter training labels, offline evaluation, and online parity. Correcting historical FX logic may improve a feature, but silent overwrites make it impossible to explain why an earlier model report differs from a later rerun.
Create a new feature version or documented revision run when definition, source interpretation, or historical transformation changes. Attach a run identifier, source snapshot reference, effective date, and reason code. A narrow repair may update affected records under the same version when the contract defined that path. A broad restatement, such as historical deposits converted with a revised market-specific currency reference, needs a new version and explicit migration decision for every consumer.
Training and serving need the same point-in-time answer. A feature computed today from corrected history helps retrospective analysis, but does not show what the model knew when it scored last month. Preserve availability timestamps and revision lineage; otherwise offline validation can report improvement from knowledge unavailable at decision time. The broader problem is usually called training-serving skew: the model learned from one version of the data and scores on another. The standard fix is to log the features actually used at serving time and build training sets from that log, so they show what the model really saw. With contracted features, that log also carries the version and quality flag, which is what makes it usable in a dispute.
Choose strictness from the cost of being wrong
Features need different delivery promises (SLAs) according to the cost of an incorrect or unavailable value, recoverability, and legal boundaries. A nightly finance-adjacent model may prioritise completeness and reproducibility over minute-level freshness. A real-time risk control may prefer a known stale value with a quality flag to a missing value, if its fallback is approved and does not create unfair treatment.
Small teams push back hardest. With a dozen features, one market and one currency, a full contract per feature looks like paperwork, and schema and row-count tests in the transformation layer catch most breakage. That holds while all scoring is batch, the features feed reports rather than automated actions, and the engineer who wrote the transformation still owns it. It fails at the first of three events: a second market or currency, a feature that triggers an automated risk or marketing action, or the departure of the person who knew why manual_review was excluded. The costs are lopsided. A contract like the one above is roughly a day's work to write and an hour a quarter to review; one affordability flag misfiring over a weekend can touch thousands of scores that then need rescoring and explaining.
Before rollout, decide in writing:
- The decision the feature influences, and safe behaviour when data is degraded.
- The event-time boundary, late-event window, correction precedence, and currency rule.
- Producer, business, and consumer owners, with an out-of-hours escalation route.
- Tests for a delayed feed, unknown status, reversal, missing FX rate, and backfill before connecting a live model.
These tests expose hidden assumptions faster than design review and show whether the feature store preserves versions, quality flags, and point-in-time joins. If it cannot, the organisation has a gap in tracing where its data comes from, and one more alert will not close it.
The practical result is a debuggable model input
A feature contract pays for its upkeep the first time an incident has edges: which version was served, to which accounts and markets, in what freshness state, and who can repair the source interpretation. Without those answers the post-mortem turns into an argument about whether a dashboard looked healthy at the time.
Features tied to money movement, account state, or regulatory controls make the best first contracts, because late events and corrections there have clear consequences; once one contract has instrumented evidence and rehearsed failure paths, the pattern extends to the rest. None of this stops data arriving late or getting corrected. What the contract buys is known quality, traceable exceptions, and model behaviour you can defend when inputs break. The first contract worth writing covers the one feature that feeds an automated risk or bonus decision: its three clocks, its three owners, and last month's late events and reversals replayed through it.