# FX Carry Trade API
> Live carry-trade and rollover analytics that FX traders run before borrowing a low-yield currency to buy a high-yield one, computed on demand from the interest rates you pass in — no key, no cache, nothing stored. The carry endpoint returns the interest-rate differential, the carry income over a holding period, the financing-adjusted yield and the leveraged return on margin, so you see exactly what a position earns. The rollover endpoint returns the daily, weekly and monthly swap — positive when you receive carry, negative when you pay it — the number a broker debits or credits each night. The breakeven endpoint returns how far the spot rate can move against the position before the carry is wiped out: the cushion the carry buys you, and the break-even spot level. This is an interest-rate and carry engine, distinct from pip and lot calculators and price tools: it turns two yields, leverage and time into the income and the risk cushion of a carry trade. The carry trade is one of the most-used FX strategies (think funding in yen to hold a higher-yielding currency), and these are the numbers behind it. Computed locally and deterministically, so it is instant and private. Ideal for FX dashboards, strategy back-tests, position sizers and trading tools. Rates are annual percentages (5.5 = 5.5%). Live, nothing stored. 3 compute endpoints. For live policy rates feed them in from a central-bank or rates API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/carrytrade-api/..."
```

## Pricing
- **Free** (Free) — 4,600 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 90,000 calls/Mo, 6 req/s
- **Pro** ($22/Mo) — 470,000 calls/Mo, 18 req/s
- **Business** ($52/Mo) — 2,900,000 calls/Mo, 45 req/s

## Endpoints

### Carry

#### `GET /v1/breakeven` — Adverse spot move the carry cushions

**Parameters:**
- `rate_long` (query, required, string) — Annual yield of the bought currency (%) Example: `5.5`
- `rate_short` (query, required, string) — Annual yield of the funding currency (%) Example: `0.5`
- `days` (query, optional, string) — Holding days (default 365) Example: `365`
- `spot` (query, optional, string) — Spot rate for break-even level Example: `150`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/carrytrade-api/v1/breakeven?rate_long=5.5&rate_short=0.5&days=365&spot=150"
```

#### `GET /v1/carry` — Differential, carry income & leveraged return

**Parameters:**
- `rate_long` (query, required, string) — Annual yield of the bought currency (%) Example: `5.5`
- `rate_short` (query, required, string) — Annual yield of the funding currency (%) Example: `0.5`
- `notional` (query, optional, string) — Position notional (default 100000) Example: `100000`
- `leverage` (query, optional, string) — Leverage (default 1) Example: `10`
- `days` (query, optional, string) — Holding days (default 365) Example: `365`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/carrytrade-api/v1/carry?rate_long=5.5&rate_short=0.5&notional=100000&leverage=10&days=365"
```

#### `GET /v1/rollover` — Daily/weekly/monthly swap

**Parameters:**
- `rate_long` (query, required, string) — Annual yield of the bought currency (%) Example: `5.5`
- `rate_short` (query, required, string) — Annual yield of the funding currency (%) Example: `0.5`
- `notional` (query, optional, string) — Position notional (default 100000) Example: `100000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/carrytrade-api/v1/rollover?rate_long=5.5&rate_short=0.5&notional=100000"
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/carrytrade-api/v1/meta"
```


---
Marketplace page: https://www.oanor.com/api/carrytrade-api
OpenAPI spec: https://www.oanor.com/api/carrytrade-api/openapi.json
