> ## Documentation Index
> Fetch the complete documentation index at: https://docs.amlok.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Transaction classification and financial reconciliation

> Whitepaper 01: hierarchical bilingual classification, payment-event linking, cash-flow statistics, and five-hop reconciliation.

![](https://mintcdn.com/amlok-docs/E2XhE7LcU8Z7MBXL/images/whitepapers/01-transaction-reconciliation.svg?fit=max\&auto=format\&n=E2XhE7LcU8Z7MBXL\&q=85\&s=739fe9cfca87e6487a3a4a0d278f97fa)**Research period:** August 2025 - November 2026 · [Research timeline](https://docs.amlok.io/research/index.md#research-timeline)## What this study comparesThis study asks whether a transaction-processing pipeline can identify financial events and reconstruct revenue more reliably than simpler classification methods. AMLOK's TE-327 uses a ModernBERT-395M encoder with hierarchical classification and payment-event linking; five-hop reconciliation then connects the resulting evidence across financial systems. The comparison measures these complete configurations on the same task.| Financial task | Baseline result | AMLOK configuration and result | Difference |
| - | - | - | - |
| Assign one of 327 transaction categories | Flat ModernBERT-395M: 0.834 F1 | TE-327 + five-hop reconciliation: 0.891 F1 | 0.057 F1 points higher |
| Assign the same transaction categories | Zero-shot language-model baseline: 0.748 F1 | TE-327 + five-hop reconciliation: 0.891 F1 | 0.143 F1 points higher |
| Link failed payments, fees, and reversals | Flat ModernBERT-395M: 0.885 F1 | TE-327 + five-hop reconciliation: 0.988 F1 | 0.103 F1 points higher |
| Reconstruct business revenue | Flat ModernBERT-395M: 2.6% MAPE | TE-327 + five-hop reconciliation: 1.9% MAPE | 0.7 percentage points lower error |The transaction benchmark uses **125,000 audited bilingual out-of-time transactions**. Revenue reconstruction uses the study's **non-fraud business subset**, a separate evaluation population. F1 balances precision and recall; higher is better. MAPE measures percentage error; lower is better. The source leaves the zero-shot model unnamed, so that row describes the evaluated baseline without assigning it a model brand.Source: [RP-2026-01, reported benchmark results](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md#reported-benchmark-results), source section 6 and Figure 1.1. The full table below also includes the aggregator/regex baseline and every reported measure.## AbstractReliable financial analysis starts by distinguishing what a transaction means from the way a bank describes it. This paper combines **TE-327**, a Hierarchical Transaction Encoder with 327 categories, with payment-event linking, windowed cash-flow statistics, and reconciliation across commerce, payment, bank, and accounting records. The classification tree contains 14 macro groups, 45 groups, and 327 leaf categories. The statistical engine produces 12,805 windowed attributes, and the paper defines 79 financial metrics across six dimensions.The reported bilingual transaction benchmark contains 125,000 audited transactions. TE-327 reaches 0.964 macro-group F1, 0.891 leaf-category F1, and 0.988 F1 for linking failed payments to their fees and reversals. The combined reconciliation pipeline reports 1.9% revenue mean absolute percentage error on the study's non-fraud business subset. The sections below explain the method, reproduce every benchmark column, and provide all 79 metric expressions.Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), abstract and sections 2-6.## The problemA short bank description can hide a supplier payment, a transfer between the borrower's own accounts, loan proceeds, or genuine sales. English and Quebec French abbreviations make those distinctions harder. A failed payment can also produce three ledger entries: the attempted principal, its reversal, and a fee. Counting all three as separate failures exaggerates payment stress.Calendar boundaries create another problem. Payments on January 31 and February 1 are close together, even though a linear calculation of the day-of-month numbers makes them look far apart. The method therefore keeps economic classification, event identity, calendar timing, and accounting corroboration as separate steps.### From a posted transaction to a supported metricEach stage preserves the evidence needed by the next stage.<ol />## Hierarchical bilingual classificationTE-327 uses a ModernBERT-395M encoder. Instead of treating all 327 categories as unrelated labels, it predicts a path through the classification tree. A leaf probability is the product of the probabilities along that path. An uncertain macro prediction becomes `unknown.unclassified`. A supported macro with an uncertain group produces `macro_only`; a supported group with an uncertain leaf produces `group_only`, with a null category. These uncertainty states preserve the supported parent without inventing an unspecified leaf. This preserves uncertainty instead of forcing an unsupported detailed classification.**1.1 - Category probabilities and abstention**$$
\begin{aligned}
P(c_{L3}\mid x_j,s_j)&=P(g_{L1}\mid\mathbf h_j)P(g_{L2}\mid g_{L1},\mathbf h_j)P(c_{L3}\mid g_{L2},\mathbf h_j)\\
\widehat c_j&=\begin{cases}
\text{unknown.unclassified},&\max P(g_{L1})<\tau_1\\
\text{NULL (macro only)},&\max P(g_{L2}\mid\widehat g_{L1})<\tau_2\\
\text{NULL (group only)},&\max P(c\mid\widehat g_{L2})<\tau_3\\
\arg\max_{c\in\widehat g_{L2}}P(c\mid\widehat g_{L2}),&\text{otherwise}
\end{cases}
\end{aligned}
$$`x_j` is a transaction, `s_j` its surface, and `h_j` its encoded representation. The thresholds control whether the model has enough confidence to publish the relevant level of detail. Choose each parent by its highest posterior within the supported preceding parent, using a stable key order to break ties. Thresholds `tau_1`, `tau_2`, and `tau_3` are explicit classifier-version inputs in `[0,1]`. Return the supported parent IDs and uncertainty status alongside a null leaf. The [complete parent/child map](https://docs.amlok.io/research/resources/metric-taxonomy.md#complete-parent-and-child-map) defines the 45 stable group IDs and preserves all 327 category keys.Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), equation 1.1.### Learning from bilingual and cross-system evidenceThe teacher-student objective combines classification at all three levels, payment-rail classification, teacher-logit matching, bilingual counterparty alignment, and payment-event linking. The source uses a Qwen2.5-72B teacher with journal and lender-schedule context. Counterparty contrastive learning brings English and French descriptions of the same entity closer together in representation space.**1.2 - Multi-task classification objective**$$
\begin{aligned}
\mathcal L_{\mathrm{TE}}={}&\sum_{\ell=1}^{3}\mathcal L_{\mathrm{CE}}(y^{(\ell)},\widehat p^{(\ell)})
+\alpha_{\mathrm{rail}}\mathcal L_{\mathrm{CE}}(y_{\mathrm{rail}},\widehat p_{\mathrm{rail}})\\
&+\beta_{\mathrm{KL}}\tau^2D_{\mathrm{KL}}\!\left(\sigma(z^{\mathrm{tch}}/\tau)\parallel\sigma(z^{\mathrm{stu}}/\tau)\right)
+\gamma_{\mathrm{con}}\mathcal L_{\mathrm{SupCon}}+\lambda_{\mathrm{ptr}}\mathcal L_{\mathrm{Ptr}}\\
\mathcal L_{\mathrm{SupCon}}={}&-\sum_{j\in\mathcal B}\frac1{|\mathcal P(j)|}\sum_{p\in\mathcal P(j)}
\ln\frac{\exp((\widetilde{\mathbf h}_j\cdot\widetilde{\mathbf h}_p)/\tau_c)}
{\sum_{a\in\mathcal B,\,a\ne j}\exp((\widetilde{\mathbf h}_j\cdot\widetilde{\mathbf h}_a)/\tau_c)}
\end{aligned}
$$Cross-entropy rewards the correct category. KL divergence transfers the teacher distribution. The contrastive term uses positive counterparty pairs `P(j)` within a batch `B`; the pointer term learns which ledger entries belong to the same payment event. The Greek coefficients weight these objectives.Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), equation 1.2.### One failed payment, one eventThe pointer searches for a failed principal within three Payments Canada business days before or after the associated fee. A null candidate allows the model to leave a fee unmatched. The principal, reversal, and fee form one tuple. Returned-payment amount sums the distinct principals, while fee outflows remain a separate cash-flow measure.**1.3 - Principal, fee, and reversal linking**$$
\begin{aligned}
P_{\mathrm{ptr}}(p\mid f)&=\operatorname{softmax}_{p\in\mathcal W_{\pm3d}(f)\cup\{\varnothing\}}
\left(\mathbf h_f^\top\mathbf W_{\mathrm{ptr}}\mathbf h_p\right)\\
\operatorname{nsf\_event\_count}(W)&=\left|\operatorname{BundledTuples}(p_{\mathrm{failed}},r_{\mathrm{rev}},f_{\mathrm{fee}})\right|
\end{aligned}
$$The bilinear score measures whether a principal and fee belong together. `W` is the observation window. The event count is the number of bundled failures, rather than the number of ledger lines.Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), equation 1.3.## Cash-flow statistics and liquidityAll metric expressions use [research-financial-v2](https://docs.amlok.io/research/resources/metric-specifications.md#calculation-version-and-domain-policies). Signed operating cash effects include refunds, chargebacks, supported recoveries, and reversals once. A net processor deposit is counted as cash once; embedded fees and refunds are not deducted again. Free cash flow subtracts supported cash CapEx, excluding securities, deposits, and loans advanced. Revenue exclusions affect only the same supported revenue records in which the excluded amounts were included.Events are sorted once in chronological order. Sparse category slices then use compressed-sparse-row indexing, prefix sums, and Welford second moments. Sorting costs `O(M log M)` for `M` events; the subsequent sketch pass is linear. The source reports 7,044 bank-cash-flow attributes and 5,761 card-activity attributes across seven windows and ten statistics, with a 4.8 ms sketch runtime per borrower under its benchmark conditions.**1.4 - Prefix sums and stable variance**$$
\begin{aligned}
S_{1,k}&=S_{1,k-1}+x_k,\quad \bar x_k=\bar x_{k-1}+(x_k-\bar x_{k-1})/k,\\
M_{2,k}&=M_{2,k-1}+(x_k-\bar x_{k-1})(x_k-\bar x_k),\\
n&=b-a,\quad \bar x_{(a,b]}=(b\bar x_b-a\bar x_a)/n,\\
\Delta_{ab}&=\frac{an}{b}(\bar x_a-\bar x_{(a,b]})^2,\\
\sigma_{(a,b]}&=\sqrt{\frac{M_{2,b}-M_{2,a}-\Delta_{ab}}{n-1}},\quad n\ge2.
\end{aligned}
$$Initialize `S_1,0 = M_2,0 = mean_0 = 0`. For `a = 0`, set `Delta_ab = 0`. The displayed subtraction is the inverse of combining two centered-moment states. In floating-point arithmetic, clamp a negative residual moment to zero only when its magnitude is at most `1e-12 * max(1, abs(M_2,b), abs(M_2,a), abs(Delta_ab))`; a larger negative residual requires recomputing the interval from its observations or returning a numerical-error state. Do not silently take the square root of a materially negative value. Two supported observations are the minimum for sample SD.The prefix sum supports window totals without rescanning every event. Welford accumulation keeps variance numerically stable. The source uses `Delta_ab` for the correction needed when subtracting prefix second moments to recover a window variance.Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), equation 1.4.### Consolidated cash and account-level overdraftsA business can have one overdrawn account while its total balance remains positive. `negative_balance_days` tests the sum across assessed accounts. `overdraft_days` tests whether any assessed account is negative, counting each calendar day once. Cash shocks compare the consolidated balance with the preceding 60-day median and median absolute deviation. Freeze the positive median at the episode start. Recovery requires completing five consecutive covered days at or above 90% of that frozen reference.**1.5 - Negative balances, shocks, and recovery**$$
\begin{aligned}
\operatorname{negative\_balance\_days}(W)&=\sum_{d\in W}\mathbb I\!\left(\sum_{a\in\mathcal A}B_{a,d}<0\right)\\
\operatorname{overdraft\_days}(W)&=\sum_{d\in W}\mathbb I\!\left(\min_{a\in\mathcal A}B_{a,d}<0\right)\\
B_{\mathrm{ref},k}&=\operatorname{Med}(B_{d_{\mathrm{start},k}-60:\,d_{\mathrm{start},k}-1})>0,\\
B_{\mathrm{shock}}(d)&=\max\!\left(B_{\mathrm{floor}},\operatorname{Med}_{60\mathrm{pre}}(B)-2.5\operatorname{MAD}_{60\mathrm{pre}}(B)\right),\\
d_{\mathrm{rec},k}&=\min\{d\ge d_{\mathrm{start},k}+4:\ \forall u\in[d-4,d],\ B_u\ge0.9B_{\mathrm{ref},k}\ \land\ m_u=1\}
\end{aligned}
$$`B_a,d` is the closing balance for account `a` on day `d`. The floor is the declared balance threshold. The recovery date is the fifth qualifying covered day. There is at most one open episode; missing days interrupt the run. Require 60 consecutive covered pre-start balances, and carry episode state across requested windows. The reference stays frozen during a prolonged shortfall. An unrecovered excursion remains open at assessment and has a null recovery duration. The [versioned domain policies](https://docs.amlok.io/research/resources/metric-specifications.md#receipt-timing-settlement-and-shock-episodes) govern counts and unsupported histories.Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), equation 1.5.### Receipt timing around a month boundaryCircular statistics treat the end and start of a month as adjacent. The source example compares January 31 and February 1: linear day-of-month standard deviation is 15.0 days, while its circular calculation is 0.54 days. This measure describes timing regularity; it does not change receipt amounts.**1.6 - Circular receipt cadence**$$
\begin{aligned}
\theta_k&=2\pi\frac{\operatorname{DayOfMonth}(t_k)}{\operatorname{DaysInMonth}(t_k)}\\
\bar R&=\sqrt{\left(\frac1N\sum_{k=1}^{N}\cos\theta_k\right)^2+
\left(\frac1N\sum_{k=1}^{N}\sin\theta_k\right)^2}\\
\operatorname{receipt\_day\_of\_month\_stddev}&=\frac{30.4375}{2\pi}\sqrt{-2\ln\bar R}
\end{aligned}
$$Each receipt date becomes an angle. `R-bar` measures how tightly those angles cluster. The last expression converts circular dispersion back to an equivalent number of days. Publish it only with at least three distinct supported receipt dates and `R-bar > 1e-12`; a zero resultant has unbounded dispersion and returns `NULL_UNBOUNDED`. Clip roundoff to `[0,1]` only within `1e-12`; larger violations are errors. The two-date example illustrates geometry and does not meet the publication minimum.Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), equation 1.6.## Five-hop reconciliation and financial statementsGross card or marketplace sales do not equal the bank deposit. Refunds, merchant fees, reserve movements, and settlement delay explain the difference. The expected settlement applies a zero-to-five-business-day lag distribution, then matches candidate payouts to bank deposits by both date and amount. Jonker-Volgenant bipartite assignment supplies the pairwise matches.The five relationships are `order_payment`, `payment_payout`, `payout_bank`, `invoice_bank`, and `bank_journal`. They are related matching problems, rather than a requirement that every transaction passes through a single linear chain. The statistical catalog also identifies 43 cross-system attributes.**1.7 - Expected settlement and matching cost**$$
\begin{aligned}
\widehat D_t^{(P\to B)}&=\sum_{\delta=0}^{5}\kappa_\delta
\left(S_{t-\delta}^{(P)}-R_{t-\delta}^{(P)}-f_{t-\delta}^{(P)}-\Delta H_{t-\delta}^{(P)}\right)\\
\min_{X_{pb}\in\{0,1\}}\quad&\sum_{p=1}^{M_p}\sum_{b=1}^{M_b}X_{pb}
\left[\lambda_t|\Delta d_{\mathrm{CA}}(t_p,t_b)-\widehat\delta|
+\lambda_a\frac{|D_b-\widehat D_p|}{\max(\widehat D_p,\varepsilon)}\right]\\
&+\psi_{\mathrm{unm}}\sum_{p=1}^{M_p}\left(1-\sum_{b=1}^{M_b}X_{pb}\right)
\end{aligned}
$$The binary assignment satisfies$$
\sum_b X_{pb}\le1\quad\forall p,\qquad
\sum_p X_{pb}\le1\quad\forall b,\qquad
X_{pb}=0\text{ for unsupported candidate pairs}.
$$Payout and deposit IDs identify distinct settled batches. Split or merged settlements must first be represented as supported disjoint bundles; an original cash record can belong to at most one bundle in this assignment. Otherwise use an explicitly capacity-constrained amount-allocation model and report that separate configuration. Do not reuse a receipt to match two payouts. Require nonnegative lag weights summing to one, positive candidate expected deposits, and nonnegative penalty coefficients. Negative settlements use a separately typed debit matching problem.`S`, `R`, `f`, and `Delta H` represent sales, refunds, fees, and reserve changes. `kappa` is the lag weight. The matching objective penalizes date mismatch, relative amount mismatch, and unmatched payouts; assignment constraints prevent duplicate matching.Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), equation 1.7.GIFI/GAAP statement spreading keeps accrual measures distinct from cash movements. EBITDA adds stated depreciation and amortization to operating profit. The method does not automatically add back discretionary expenses. Free cash flow deducts cash capital expenditure, while the balance-sheet discrepancy tests whether assets equal liabilities plus equity.**1.8 - Accrual and cash-flow identities**$$
\begin{aligned}
\operatorname{ebitda}&=\operatorname{EBIT}_{\mathrm{GIFI}}+\operatorname{Depr}_{\mathrm{stmt}}+\operatorname{Amort}_{\mathrm{stmt}}\\
\operatorname{free\_cash\_flow}&=\operatorname{operating\_net\_cash\_flow}-\operatorname{CapEx}_{\mathrm{cash}}\\
\Delta_{\mathrm{BS}}&=|A-(L+E)|
\end{aligned}
$$`A`, `L`, and `E` are assets, liabilities, and equity. These identities keep supported statement entries and observed cash transactions traceable to their respective sources.Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), equation 1.8.## Reported benchmark resultsThe classification results use the paper's 125,000 audited bilingual transactions from the out-of-time evaluation. F1 ranges from zero to one and combines precision and recall; higher is better. Revenue MAPE is a separate reconciliation result on the stated non-fraud business subset; lower is better. Throughput uses the benchmark's different API and GPU execution conditions and should be read with those conditions.

\### Macro-group classification


      

Reported comparison from the same benchmark table.


    
    
    
    
    

\<table><caption>Exact values</caption>
        \<thead><tr><th scope="col">Method or group</th></tr></thead>
        \<tbody /></table>



\### Leaf-category classification


      

Reported comparison from the same benchmark table.


    
    
    
    
    

\<table><caption>Exact values</caption>
        \<thead><tr><th scope="col">Method or group</th></tr></thead>
        \<tbody /></table>



\### Quebec French classification


      

Reported comparison from the same benchmark table.


    
    
    
    
    

\<table><caption>Exact values</caption>
        \<thead><tr><th scope="col">Method or group</th></tr></thead>
        \<tbody /></table>



\### Failed-payment event linking


      

Reported comparison from the same benchmark table.


    
    
    
    
    

\<table><caption>Exact values</caption>
        \<thead><tr><th scope="col">Method or group</th></tr></thead>
        \<tbody /></table>



\### Revenue reconciliation error


      

Reported comparison from the same benchmark table.


    
    
    
    
    

\<table><caption>Exact values (%)</caption>
        \<thead><tr><th scope="col">Method or group</th></tr></thead>
        \<tbody /></table>



\### Classification throughput


      

Reported comparison from the same benchmark table.


    
    
    
    

Source conditions: proxy uses API throughput; the zero-shot baseline uses language-model inference; ModernBERT uses GPU inference. The separate 4.8 ms figure is the attribute-sketch runtime, not total end-to-end latency.


    

\<table><caption>Exact values (transactions/s)</caption>
        \<thead><tr><th scope="col">Method or group</th></tr></thead>
        \<tbody /></table>

The source additionally reports **91.2% recall for manual journal stuffing** in the reconciliation study and **51.4% category coverage** for the aggregator proxy. These describe the source study and its proxy configuration. [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), abstract, section 1, and Figure 1.1.## Metric definitions (79)These definitions retain the source notation and its scope. `W` is the observation window; `t_0` is the assessment time; `I(condition)` is one when the condition holds and zero otherwise. `Div+` denotes the catalog division operation with a supported positive denominator. Missing evidence or an unsupported denominator does not establish a zero. Currency expressions use a consistent reporting currency. Source: [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md), metric-definition table.### Cash flow**`total_inflows`**Scope and unit: business, person \[currency].`sum_{j in J(W) : a_j > 0} a_j`**`total_outflows`**Scope and unit: business, person \[currency].`sum_{j in J(W) : a_j < 0} |a_j|`**`net_cash_flow`**Scope and unit: business, person \[currency].`(total_inflows - internal_transfer_inflows) - (total_outflows - internal_transfer_outflows)`**`operating_cash_inflows`**Scope and unit: business, person \[currency].`sum_{j in OperatingCashEffects(W) : a_j > 0} a_j`**`operating_cash_outflows`**Scope and unit: business, person \[currency].`sum_{j in OperatingCashEffects(W) : a_j < 0} |a_j|`**`operating_net_cash_flow`**Scope and unit: business, person \[currency].`operating_cash_inflows - operating_cash_outflows`**`internal_transfer_inflows`**Scope and unit: business, person \[currency].`sum_{a_j > 0} a_j * I(c_j in {transfer.internal, transfer.sweep, transfer.fx})`**`financing_inflows`**Scope and unit: business, person \[currency].`sum_{a_j > 0} a_j * I(c_j in financing.loan_proceeds.* union financing.equity_in.*)`**`positive_cashflow_month_share`**Scope and unit: business, person \[ratio].`Div+( |{m in M_full : net_cash_flow_m > 0}|, |M_full| )`**`cashflow_volatility`**Scope and unit: business, person \[ratio].`Div+( sample_std_m(operating_net_cash_flow_m), median_m(|operating_net_cash_flow_m|) ) [at least 2 complete months]`**`cashflow_change_90d`**Scope and unit: business, person \[ratio].`Div+( NCF_op(0..90d) - NCF_op(91..180d), |NCF_op(91..180d)| )`**`posted_transaction_count`**Scope and unit: business \[count].`|J_dedup(W)|`**`operating_receipt_count`**Scope and unit: business \[count].`|{ j in OperatingCashEffects(W) : a_j > 0 }|`**`owner_contribution_inflows`**Scope and unit: business \[currency].`sum_{a_j > 0} a_j * I(c_j == financing.equity_in.owner)`**`owner_distribution_outflows`**Scope and unit: business \[currency].`sum_{a_j < 0} |a_j| * I(c_j in financing.equity_out.*)`**`debt_proceeds_inflows`**Scope and unit: business \[currency].`sum_{a_j > 0} a_j * I(c_j in financing.loan_proceeds.*)`**`observed_debt_service`**Scope and unit: business \[currency].`sum_{a_j < 0} |a_j| * I(c_j in financing.debt_service.* union financial.interest.*)`**`bank_fee_outflows`**Scope and unit: business \[currency].`sum_{a_j < 0} |a_j| * I(c_j in financial.fee.*)`**`cash_withdrawal_outflows`**Scope and unit: business \[currency].`sum_{a_j < 0} |a_j| * I(c_j == cash.withdrawal)`**`payroll_outflows`**Scope and unit: business \[currency].`sum_{a_j < 0} |a_j| * I(c_j in expense.payroll.* union expense.benefits.*)`**`inventory_purchase_outflows`**Scope and unit: business \[currency].`sum_{a_j < 0} |a_j| * I(c_j in expense.inventory.*)`**`internal_transfer_outflows`**Scope and unit: business \[currency].`sum_{a_j < 0} |a_j| * I(c_j in {transfer.internal, transfer.sweep, transfer.fx})`**`spending_to_receipts_ratio`**Scope and unit: business \[ratio].`Div+( operating_cash_outflows, operating_cash_inflows )`**`spending_to_receipts_change_90d`**Scope and unit: business \[ratio].`(O_op/I_op)_{0..90d} - (O_op/I_op)_{91..180d}`### Liquidity**`unrestricted_cash`**Scope and unit: business, person \[currency].`sum_{a in A_unrestricted} B_{a, t_0}`**`average_daily_balance`**Scope and unit: business, person \[currency].`(1 / |D_cov|) * sum_{d in D_cov} B_cons(d)`**`minimum_daily_balance`**Scope and unit: business, person \[currency].`min_{d in D_cov} B_cons(d)`**`negative_balance_days`**Scope and unit: business, person \[days].`sum_{d in D_cov} I( sum_{a in A_cons} B_{a,d} < 0 )`**`cash_buffer_days`**Scope and unit: business, person \[days].`Div+( unrestricted_cash, O_essential(W) / |W|_days )`**`current_ratio`**Scope and unit: business \[ratio].`Div+( CurrentAssets(t_0), CurrentLiabilities(t_0) )`**`quick_ratio`**Scope and unit: business \[ratio].`Div+( Cash + ShortTermInv + EligibleAR, CurrentLiabilities(t_0) )`**`cash_ratio`**Scope and unit: business \[ratio].`Div+( unrestricted_cash, CurrentLiabilities(t_0) )`**`balance_stddev`**Scope and unit: business \[currency].`sqrt(sum_{d in D_cov} (B_cons(d) - average_daily_balance)^2 / (|D_cov| - 1)) [|D_cov| >= 2; complete comparable balances]`**`balance_coefficient_of_variation`**Scope and unit: business \[ratio].`Div+( balance_stddev, |average_daily_balance| )`**`maximum_daily_balance`**Scope and unit: business \[currency].`max_{d in D_cov} B_cons(d)`**`median_daily_balance`**Scope and unit: business \[currency].`median_{d in D_cov} B_cons(d)`**`low_balance_days`**Scope and unit: business \[days].`sum_{d in D_cov} I( B_cons(d) < B_declared_floor )`**`balance_change_90d`**Scope and unit: business \[currency].`B_cons(t_0) - B_cons(t_0 - 90d)`**`cash_shock_count`**Scope and unit: business \[count].`|{ k in NonoverlappingCashShockEpisodes : d_start_k in W }|`**`balance_recovery_days`**Scope and unit: business \[days].`d_rec_K - d_start_K [K = latest episode starting in W; five-day recovery completion against frozen positive B_ref_K; NULL if absent or open]`**`unrecovered_cash_shock_count`**Scope and unit: business \[count].`|{ k in NonoverlappingCashShockEpisodes : d_start_k in W and d_rec_k > t_0 }|`### Revenue quality**`verified_revenue`**Scope and unit: business \[currency].`sum_{r in CorroboratedRevenue(W)} (IncludedAmount_r - SupportedExcludedOverlap_r)`**`recurring_revenue_share`**Scope and unit: business \[ratio].`Div+( Rev_recurring_supported(W), verified_revenue )`**`revenue_growth_yoy`**Scope and unit: business \[ratio].`Div+( Rev(W) - Rev(W - 365d), Rev(W - 365d) )`**`revenue_growth_90d`**Scope and unit: business \[ratio].`Div+( Rev(0..90d) - Rev(91..180d), Rev(91..180d) )`**`revenue_volatility`**Scope and unit: business \[ratio].`Div+( std_m(Rev_m), mean_m(Rev_m) )`**`refund_amount_share`**Scope and unit: business \[ratio].`Div+( sum |a_j|*I(c_j == refund.customer), GrossEligibleSales(W) )`**`chargeback_amount_share`**Scope and unit: business \[ratio].`Div+( sum |a_j|*I(c_j == dispute.chargeback_debit), ProcessedSalesValue(W) )`**`revenue_cash_realization`**Scope and unit: business \[ratio].`Div+( MatchedCashCollections(W), RecognizedSales(W) )`**`unverified_receipts_share`**Scope and unit: business \[ratio].`Div+( I_candidate_unresolved(W), operating_cash_inflows + I_candidate_unresolved(W) )`**`nonrecurring_revenue_share`**Scope and unit: business \[ratio].`Div+( Rev_one_off_supported(W), verified_revenue )`**`receipt_gap_mean_days`**Scope and unit: business \[days].`mean_{r=2..R} (t_op_r - t_op_{r-1})`**`receipt_gap_stddev_days`**Scope and unit: business \[days].`std_{r=2..R} (t_op_r - t_op_{r-1})`**`receipt_day_of_month_stddev`**Scope and unit: business \[days].`(30.4375 / (2*pi)) * sqrt(-2 * ln(clip(R_bar_vonMises, 0, 1))) [at least 3 distinct receipt dates; R <= 1e-12: NULL_UNBOUNDED]`**`zero_revenue_month_count`**Scope and unit: business \[count].`sum_{m in M_full} I( operating_cash_inflows_m == 0 )`**`operating_receipts_volatility`**Scope and unit: business \[ratio].`Div+( std_m(operating_cash_inflows_m), mean_m(operating_cash_inflows_m) )`**`operating_receipts_change_90d`**Scope and unit: business \[ratio].`Div+( I_op(0..90d) - I_op(91..180d), I_op(91..180d) )`**`days_since_last_operating_receipt`**Scope and unit: business \[days].`floor( t_0 - max_{r in OpReceipts} t_r )`**`unclassified_receipt_share`**Scope and unit: business \[ratio].`Div+( sum_{a_j>0, ext} a_j*I(c_j == unknown.unclassified), ExternalInflows(W) )`### Profitability**`gross_profit`**Scope and unit: business \[currency].`RecognizedRevenue(W) - COGS(W)`**`gross_margin`**Scope and unit: business \[ratio].`Div+( gross_profit, RecognizedRevenue(W) )`**`ebitda`**Scope and unit: business \[currency].`operating_profit + Depr_stmt + Amort_stmt  [zero automatic discretionary addbacks]`**`ebitda_margin`**Scope and unit: business \[ratio].`Div+( ebitda, RecognizedRevenue(W) )`**`operating_profit`**Scope and unit: business \[currency].`gross_profit - OperatingExpenses_ex_Financing(W)`**`operating_margin`**Scope and unit: business \[ratio].`Div+( operating_profit, RecognizedRevenue(W) )`**`net_profit`**Scope and unit: business \[currency].`operating_profit - InterestExpense - IncomeTax +/- NonOperatingItems`**`net_margin`**Scope and unit: business \[ratio].`Div+( net_profit, RecognizedRevenue(W) )`**`free_cash_flow`**Scope and unit: business \[currency].`operating_net_cash_flow - sum_{j in SupportedCapExCashEffects(W)} |a_j|`**`return_on_assets`**Scope and unit: business \[ratio].`Div+( net_profit, 0.5 * (TotalAssets_open + TotalAssets_close) )`### Payment behavior**`nsf_event_count`**Scope and unit: business, person \[count].`|PointerBundledNSFTuples(p_failed, r_reversal, f_nsf_fee)|  [excludes fee as separate event]`**`overdraft_days`**Scope and unit: business, person \[days].`sum_{d in D_cov} I( min_{a in A_assessed} B_{a,d} < 0 )  [deduplicated across accounts per day]`**`returned_payment_amount`**Scope and unit: business, person \[currency].`sum_{p in DistinctReturnedPaymentPrincipals} |a_p|  [excludes duplicate fee rows]`**`delinquent_obligation_count`**Scope and unit: business, person \[count].`|{ o in SupportedObligations : DPD_o(t_0) > 0 }|`**`maximum_days_past_due`**Scope and unit: business, person \[days].`max_{o in ObligationsWithKnownDues} DPD_o(t_0)`**`on_time_payment_share`**Scope and unit: business, person \[ratio].`Div+( PaidByContractualDueDateCount(W), ElapsedEligibleObligationDuesCount(W) )`### Financial reporting quality**`bank_accounting_match_share`**Scope and unit: business \[ratio].`Div+( MatchedBankToJournalValue(W), EligibleBankTransactionValue(W) )`**`statement_balance_discrepancy`**Scope and unit: business \[currency].`| TotalAssets(t_stmt) - (TotalLiabilities(t_stmt) + TotalEquity(t_stmt)) |`**`material_adjustment_share`**Scope and unit: business \[ratio].`Div+( sum |MaterialAccountingAdjustments(W)|, PreAdjustmentActivityMagnitude(W) )`**`books_closing_lag_days`**Scope and unit: business \[days].`t_period_finalized_or_closed - t_accounting_period_end`## Supporting material- [RP-2026-01](https://docs.amlok.io/whitepapers/01-transaction-reconciliation.md): original paper, equations 1.1-1.8, Figure 1.1, and the 79-metric table.
- [RS-2026-01](https://docs.amlok.io/research/resources/study-cohorts.md): corpus and cohort definitions.
- [Financial event representation and credit risk](https://docs.amlok.io/whitepapers/02-financial-event-credit.md): how these histories feed the next modeling stage.
- [Entity and network risk](https://docs.amlok.io/whitepapers/03-entity-network-risk.md): counterparties, circular flows, and concentration.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.