CRSP Cumulative Share/Volume Adjustment
Install and import#
npm install fintech-algorithmsimport { calculate } from "fintech-algorithms/corporate-actions-and-security-master-data/adjustment-factors/crsp-cumulative-share-volume-adjustment";Signature#
calculate(data)The volume counterpart of the CRSP price adjustment. Volume moves the opposite way to price across a split, and adjusting one without the other silently corrupts every turnover and liquidity measure downstream.
Parameters#
| Name | Type | Notes |
|---|---|---|
data | { schemaVersion: string; sourceRelease: string; crspBasisDate: string; extractCoverage: object; records: Record[] } | crspBasisDate sets the basis the adjusted volumes are expressed on. extractCoverage states the window the extract actually spans, so a partial extract cannot be mistaken for a complete history. |
Returns#
{ schemaVersion, sourceRelease, crspBasisDate, extractCoverage, roundingDigits, rows }
Adjusted volume rows with the provenance and rounding that produced them.
Errors#
- When the extract coverage does not span the requested records — throws
Complexity: time O(n),
space O(n).
Worked example#
verified This is the worked example published in the article, replayed by the test suite on every run. The output cannot drift.
Input#
{
"schemaVersion": "CRSP_US_STOCK_CIZ_2_0",
"sourceRelease": "synthetic-ciz-2.0-fixture-v1",
"crspBasisDate": "2024-09-05",
"extractCoverage": "full_history",
"records": [
{
"packageSecurityKey": "SYNTHETIC-CRSP-CIZ-001",
"date": "2024-08-28",
"frequency": "daily",
"crspFactorField": "DlyCumFacShr",
"crspCumulativeShareFactor": 4,
"crspFactorStatus": "observed",
"rawSharesOutstandingThousands": 250,
"rawVolumeShares": 100
},
{
"packageSecurityKey": "SYNTHETIC-CRSP-CIZ-001",
"date": "2024-08-29",
"frequency": "daily",
"crspFactorField": "DlyCumFacShr",
"crspCumulativeShareFactor": 4,
"crspFactorStatus": "observed",
"rawSharesOutstandingThousands": 250,
"rawVolumeShares": 125
},
{
"packageSecurityKey": "SYNTHETIC-CRSP-CIZ-001",
"date": "2024-08-30",
"frequency": "daily",
"crspFactorField": "DlyCumFacShr",
"crspCumulativeShareFactor": 1,
"crspFactorStatus": "observed",
"rawSharesOutstandingThousands": 1000,
"rawVolumeShares": 460
}
]
}Call#
calculate(data)Returns#
object with 1 field: rows
{
"rows": [
{
"crspAdjustedSharesOutstandingThousands": 1000,
"crspAdjustedVolumeShares": 400
},
{
"crspAdjustedSharesOutstandingThousands": 1000,
"crspAdjustedVolumeShares": 500
},
{
"crspAdjustedSharesOutstandingThousands": 1000,
"crspAdjustedVolumeShares": 460
}
]
}Diagrams#
Calculation flow#
CRSP CIZ 2.0 calculation flow
flowchart LR
A["CRSP CIZ 2.0 row and release"] --> B{"DlyCumFacShr or MthCumFacShr?"}
B -->|No| X["Reject field substitution"]
B -->|Yes| C{"CRSP factor and raw quantity present?"}
C -->|No| M["Return explicit missing status"]
C -->|Yes| D{"Monthly volume with mixed basis?"}
D -->|Yes| R["Require licensed daily reconstruction"]
D -->|No| E["Multiply by CRSP share factor"]
E --> F["Round once at 12 decimals"]
F --> G["Retain CRSP release, basis, and status"]
CRSP evidence-state lifecycle
stateDiagram-v2
[*] --> ValidateCRSPField
ValidateCRSPField --> Rejected: price factor or wrong frequency
ValidateCRSPField --> Missing: raw value or CRSP factor absent
ValidateCRSPField --> CheckFrequency: valid share factor
CheckFrequency --> DailyComputed: daily quantity
CheckFrequency --> MonthlyComputed: clean monthly evidence
CheckFrequency --> DailyReconstructionRequired: mixed or unknown month
CheckFrequency --> GapQualified: CRSP factor continued across gap
DailyComputed --> Audited
MonthlyComputed --> Audited
GapQualified --> Audited
Missing --> Audited
Rejected --> Audited
DailyReconstructionRequired --> Audited
How it works#
This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.
References#
- R1 - CRSP US Stock & Indexes Database Guide, Flat File Format 2.0 (CIZ)
- R2 - Important Notice: CRSP US Stock & Indexes Flat File Format 2.0 (CIZ)
- R3 - June 2025 Monthly Update: CRSP US Stock & Index Release Notes
- R4 - May 2026 Monthly Update: CRSP US Stock & Index Databases Release Notes
- R5 - CRSP US Stock & Indexes Database Data Descriptions Guide