# Merger spread (merger_spread)

Desk: Equities. Page: https://hedgefund.md/models/merger_spread

**What it asks.** What is this deal spread worth after carry, and what completion odds does the price imply?

Computes a deal's offer value, gross spread, simple and compounded annualized return, return net of financing, borrow and dividends, the completion probability the price implies, and the break-even probability after carry. Prices and terms come from the caller. It is arithmetic on those numbers, not a view on whether any deal closes.

Results are hypothetical: arithmetic on the numbers sent, a made-up template or a stated default. Nobody achieved them, and they aren't a forecast, a recommendation, an offer or a record of real trading. Don't show any output to investors or clients, or use it to market an investment. Terms: https://hedgefund.md/terms

## Inputs

| Input | Type | Range | Required | What it is |
| --- | --- | --- | --- | --- |
| `deal_cash` | number | 0 to 10000000 | no | Cash paid per target share. Default 0. |
| `deal_stock_ratio` | number | 0 to 10000 | no | Acquirer shares paid per target share. Default 0. |
| `acquirer_price` | number | 0.0001 to 10000000 | no | Acquirer share price. Required when deal_stock_ratio is above 0. |
| `target_price` | number | 0.0001 to 10000000 | yes | Target share price now. |
| `break_price` | number | 0 to 10000000 | yes | Where the target would trade if the deal broke. |
| `days_to_close` | number | 1 to 3650 | yes | Calendar days until the deal closes. |
| `dividends_target` | number | 0 to 1000000 | no | Dividends per target share expected before close. Default 0. |
| `dividends_acquirer` | number | 0 to 1000000 | no | Dividends per acquirer share expected before close. Default 0. |
| `financing_rate_pct` | number | -10 to 100 | yes | Annual rate on the whole target price, in percent. |
| `borrow_bps` | number | 0 to 100000 | no | Annual borrow fee on the acquirer short, in basis points of its value. Default 0. |

## Template

Made-up numbers that run as they stand, so you can see the shape of a result. They aren't market levels, typical values or estimates, and the names in them don't exist. Replace every number before you read anything into a run.

```json
{
  "deal_cash": 20,
  "deal_stock_ratio": 0.5,
  "acquirer_price": 60,
  "target_price": 47,
  "break_price": 35,
  "days_to_close": 120,
  "dividends_target": 0.25,
  "dividends_acquirer": 0.4,
  "financing_rate_pct": 5,
  "borrow_bps": 50
}
```

## What the template gives

On these numbers, the offer is worth 50 against a target price of 47, a hypothetical gross return of 6.38% and 14.42% a year net if it closes in 120 days. The price implies 80% completion, and break-even after carry is 85.15%.

- Offer value: 50
- Hypothetical gross return to close: 6.383%
- Hypothetical gross annualized, simple: 19.41% a year
- Hypothetical net annualized, simple: 14.42% a year
- Implied completion probability: 80%
- Break-even probability after carry: 85.15%
- Loss on a break: 25.53% of target price
- Reward to risk: 0.25

Where it flips, with the other inputs held:

- `days_to_close` at 229.53608: At this many days, net annualized equals the 5% financing rate. Longer and it falls below.
- `break_price` at 20: At this break price the implied probability is 90%. Below it the implied probability is higher.

## Formula

V = cash + ratio * A. Gross return r = (V - T) / T, simple annual = r * 365 / days, compounded = (1 + r)^(365 / days) - 1. Carry = div_T - ratio * div_A - T * fin * days / 365 - ratio * A * borrow * days / 365. Net = (V - T + carry) / T. Implied p = (T - B) / (V - B). Break-even p = (T - B - carry) / (V - B).

## Assumptions

- The position is long one target share and short ratio acquirer shares, so the completion payoff V - T is fixed at today's acquirer price.
- Time is calendar days over 365. Financing and borrow accrue simply.
- Financing is charged on the whole target price. Short sale proceeds earn nothing and fund nothing.
- Dividends and borrow on the short scale with the ratio.
- Carry is the same whether the deal closes or breaks, as if a break came at the end of the period.
- On a break the acquirer stays at acquirer_price, so the short neither gains nor loses.
- Dividends stay fixed when the flip moves days_to_close.
- The sleeve is per 100 of target value, with the short at ratio * A against it.

## Not modeled

- Short rebate: in a stock deal the sale proceeds can offset most of the financing charge. The table shows what a rebate at the financing rate would add.
- How the acquirer moves on a break. If it rises, that adds to the loss on the short.
- Collars, walk-away rights, price adjustments, and competing bids.
- A break that comes early or late, and a close later than days_to_close.
- Recall of borrowed shares, slippage, commissions, fees and taxes.

## Call it

Every result has the same fields: summary, readings, tables, charts, flags, flips, formula, assumptions, not_modeled, hypothetical and inputs_hash. Read flags, flips and not_modeled with the summary, and pass them along together.

### HTTP

No key. The tools keep nothing you send. Send positions by POST, because a URL can land in a server log.

```bash
curl -s https://hedgefund.md/api/v1/merger_spread \
  -H 'content-type: application/json' \
  -d '{"deal_cash":20,"deal_stock_ratio":0.5,"acquirer_price":60,"target_price":47,"break_price":35,"days_to_close":120,"dividends_target":0.25,"dividends_acquirer":0.4,"financing_rate_pct":5,"borrow_bps":50}' \
  | jq '{summary, flags, flips, not_modeled, inputs_hash}'
```

### MCP

The tool is `merger_spread` on the server at https://hedgefund.md/mcp.

```bash
curl -s https://hedgefund.md/mcp \
  -H 'content-type: application/json' -H 'accept: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"merger_spread","arguments":{"deal_cash":20,"deal_stock_ratio":0.5,"acquirer_price":60,"target_price":47,"break_price":35,"days_to_close":120,"dividends_target":0.25,"dividends_acquirer":0.4,"financing_rate_pct":5,"borrow_bps":50}}}' \
  | jq '.result.structuredContent | {summary, flags, flips, not_modeled, inputs_hash}'
```

### The library

The same code on your own machine, with no dependencies, and nothing is sent anywhere.

```bash
curl -fsSL https://hedgefund.md/hedgefund.mjs -o hedgefund.mjs   # read it before you run it
node hedgefund.mjs template merger_spread > mine.json           # replace every number in it
node hedgefund.mjs run merger_spread mine.json | jq '{summary, flags, flips, not_modeled, inputs_hash}'
```

In a script:

```js
import { run, template } from "./hedgefund.mjs";

const inputs = template("merger_spread"); // replace every number in it
const { summary, flags, flips, not_modeled } = run("merger_spread", inputs);
```
