Parse ISO 10962 CFI codes into category, group, and attributes. Classification of Financial Instruments decoder. Zero dependencies.
npm install parse-cfiParse ISO 10962 CFI (Classification of Financial Instruments) codes into structured data.
Decompose a 6-character CFI code into category, group, and four attributes with human-readable labels.
Zero dependencies. Pure functions. TypeScript types included.
``bash`
npm install parse-cfi
`ts
import { parseCFI, isValidCFI } from 'parse-cfi';
// Decompose a CFI code
const result = parseCFI('ESVUFR');
result.valid // true
result.category // { code: 'E', label: 'Equities' }
result.group // { code: 'S', label: 'Common/ordinary shares' }
result.attributes // [
// { code: 'V', label: 'Voting' },
// { code: 'U', label: 'Unrestricted' },
// { code: 'F', label: 'Fully paid' },
// { code: 'R', label: 'Registered' }
// ]
result.description // "Equities — Common/ordinary shares (Voting, Unrestricted, Fully paid, Registered)"
// Quick validation
isValidCFI('ESVUFR') // true
isValidCFI('123456') // false
`
Parse a 6-character CFI code. Never throws. Returns { valid: false } for invalid input.
Check if a string is a structurally valid CFI code with a recognized category.
| Code | Category |
|------|----------|
| E | Equities |
| D | Debt instruments |
| C | Collective investment vehicles |
| R | Entitlements (rights) |
| O | Listed options |
| F | Futures |
| S | Swaps |
| H | Non-listed and complex listed options |
| I | Spot |
| J | Forwards |
| K | Strategies |
| L | Financing |
| T | Referential instruments |
| M | Others (miscellaneous) |
`ts
// Bond: fixed rate, government guarantee, fixed maturity, registered
parseCFI('DBFTFR').description
// "Debt instruments — Bonds (Fixed rate, Government/state guarantee, Fixed maturity, Registered)"
// ETF with unspecified attributes
parseCFI('CEXXXX').description
// "Collective investment vehicles — Exchange-traded funds (ETFs)"
// Listed call option: American, stock underlying, cash settled, standardized
parseCFI('OCASCS').description
// "Listed options — Call options (American, Stock-equities, Cash, Standardized)"
``
- FIX Protocol: CFI codes appear in FIX messages (tag 461). Decode them to route orders correctly.
- MiFID II reporting: Regulatory submissions require CFI classification. Parse and validate before filing.
- ISIN databases: Every ISIN record includes a CFI code. Enrich your security master with structured attributes.
- ANNA service bureau: CFI is assigned alongside ISIN by national numbering agencies.
- parse-isin — Parse ISIN codes
- parse-cusip — Parse CUSIP identifiers
- parse-lei — Parse LEI codes
MIT