# Return-of-Capital Adjustment

> Keep Price, Return, and Tax Views Separate

`D02-F02-A05` · Corporate Actions and Security Master Data → Complex Distributions · archetype `record-transform` · difficulty 4/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/corporate-actions-and-security-master-data/complex-distributions/return-of-capital-adjustment/
Agent skill: `npx skills add IslamBaraka90/Fintech-Algorithms-Library` — https://docs.thefintechbuilder.com/guides/agent-skill/

## Install and import

```bash
npm install fintech-algorithms
```

```ts
import { calculate } from "fintech-algorithms/corporate-actions-and-security-master-data/complex-distributions/return-of-capital-adjustment";
```

## Signature

```ts
calculate(payload)
```

Applies a return of capital, which reduces the investor's cost basis rather than paying income. It affects price continuity and tax reporting differently from a dividend, and conflating the two misstates both.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `payload` | `{ asOf: string; revisions: EventRevision[]; referenceObservation: object; fxObservation?: object; exObservation?: object; taxIllustration?: object }` | yes | `taxIllustration` is optional and, when supplied, drives an illustrative US federal treatment kept strictly separate from the market-data adjustment. Point-in-time by construction: `asOf` is the knowledge time, and only revisions available at or before it are eligible. Passing the event date instead of the knowledge date is what lets a backtest use information it could not have had. |

## Returns

`{ state, applied, marketDataAdjustment, investorReturnDiagnostics, usFederalTaxIllustration }`

The market-data adjustment and the tax illustration as separate blocks, deliberately — one is a price-series fact and the other is jurisdiction-specific and illustrative only.

## Errors

- When no revision is available at asOf — reported as a state rather than thrown

## Complexity

Time `O(revisions)`, space `O(1)`.

## Worked example

This is the worked example published in the article, replayed by the test suite on every run. The output cannot drift.

### Input

`payload`:

```json
{
  "asOf": "2025-02-03T21:05:00Z",
  "revisions": [
    {
      "eventId": "SYN-ROC-2025-001",
      "revisionId": "SYN-ANNOUNCEMENT-R1",
      "revisionSequence": 1,
      "observedAt": "2025-01-20T14:00:00Z",
      "availableAt": "2025-01-20T14:02:00Z",
      "sourceId": "SYN-ISSUER-NOTICE",
      "status": "confirmed",
      "exAt": "2025-02-03T14:30:00Z",
      "sameDayOrdering": {
        "sequence": 1,
        "priorEventIds": []
      },
      "terms": {
        "eventCurrency": "USD",
        "grossCapitalReturnPerShare": "2.00000000",
        "withholdingPerShare": "0.10000000",
        "feesPerShare": "0.02000000"
      }
    }
  ],
  "referenceObservation": {
    "price": "25.00000000",
    "currency": "USD",
    "observedAt": "2025-01-31T21:00:00Z",
    "availableAt": "2025-01-31T21:00:05Z",
    "sourceId": "SYN-OFFICIAL-CLOSE"
  },
  "fxObservation": {
    "priceCurrencyPerEventCurrency": "1.00000000",
    "pair": "USD/USD",
    "anchorPolicy": "ON_OR_BEFORE_REFERENCE_OBSERVATION",
    "observedAt": "2025-01-31T21:00:00Z",
    "availableAt": "2025-01-31T21:00:00Z",
    "sourceId": "IDENTITY-FX"
  },
  "exObservation": {
    "price": "23.15000000",
    "currency": "USD",
    "observedAt": "2025-02-03T21:00:00Z",
    "availableAt": "2025-02-03T21:00:04Z",
    "sourceId": "SYN-OFFICIAL-CLOSE"
  },
  "taxIllustration": {
    "jurisdiction": "US_FEDERAL_INDIVIDUAL_TAXABLE_2025",
    "currency": "USD",
    "basisPerShareBefore": "1.50000000",
    "confirmedReturnOfCapitalPerShare": "1.20000000",
    "sourceId": "SYN-FINAL-ISSUER-TAX-CLASSIFICATION",
    "observedAt": "2025-02-03T20:00:00Z",
    "availableAt": "2025-02-03T20:05:00Z"
  }
}
```

### Call

```ts
calculate(payload)
```

### Returns

object with 8 fields: eventId, revisionId, state, applied, priceCurrency, marketDataAdjustment, investorReturnDiagnostics, usFederalTaxIllustration

```json
{
  "eventId": "SYN-ROC-2025-001",
  "revisionId": "SYN-ANNOUNCEMENT-R1",
  "state": "confirmed",
  "applied": true,
  "priceCurrency": "USD",
  "marketDataAdjustment": {
    "referencePrice": "25.00000000",
    "grossDistributionInPriceCurrency": "2.00000000",
    "theoreticalExPrice": "23.00000000",
    "backwardHistoryFactor": "0.92000000",
    "forwardPostEventFactor": "1.08695652",
    "factorDirection": "multiply_pre_ex_history_by_backwardHistoryFactor",
    "theoreticalPriceIsObservedTrade": false
  },
  "investorReturnDiagnostics": {
    "rawPriceReturn": "-0.07400000",
    "grossTotalReturn": "0.00600000",
    "netCashReturn": "0.00120000"
  },
  "usFederalTaxIllustration": {
    "basisPerShareAfter": "0.30000000",
    "basisReductionPerShare": "1.20000000",
    "excessOverBasisPerShare": "0.00000000"
  }
}
```

## Verification and provenance

Tier: **verified** (via input-expected).

The worked example below is the figure published in this algorithm's article, replayed and asserted by the test suite on every build. The arithmetic cannot drift without the build failing.

Both tiers guarantee the signature. Full explanation: https://docs.thefintechbuilder.com/guides/verification/

Generated from the docs.json payload shipped inside fintech-algorithms@0.13.1.
The signature and parameter list are checked against the compiled implementation at build time,
so a description that contradicts the code fails the build rather than reaching this file.

## Links

- Article (how it works, step by step): https://thefintechbuilder.com/corporate-actions-and-security-master-data/complex-distributions/return-of-capital-adjustment/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/corporate-actions-and-security-master-data/complex-distributions/return-of-capital-adjustment/impl.ts
- Standalone repository: https://github.com/IslamBaraka90/Fintech-Return-Of-Capital-Adjustment-Corporate-Actions-algorithm
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/corporate-actions-and-security-master-data/llms.txt
