# 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"
```

**Response:**
```json
{
    "data": {
        "days": 365,
        "spot": 150,
        "source": "CARRY",
        "breakeven_spot": 142.5,
        "interpretation": "positive carry: the spot can move 5% against the long currency over 365 days before the trade nets a loss",
        "differential_pct": 5,
        "carry_yield_period_pct": 5,
        "breakeven_adverse_move_pct": 5
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:22.504Z",
        "request_id": "b70e4a84-d45e-4e38-8322-16aaa4b47885"
    },
    "status": "ok",
    "message": "Breakeven computed",
    "success": true
}
```

#### `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"
```

**Response:**
```json
{
    "data": {
        "days": 365,
        "note": "differential = rate_long - rate_short - financing_spread (annual %). Positive carry earns; negative pays. Returns leveraged by margin = notional / leverage.",
        "margin": 10000,
        "source": "CARRY",
        "leverage": 10,
        "notional": 100000,
        "direction": "positive_carry",
        "rate_long": 5.5,
        "rate_short": 0.5,
        "daily_carry": 13.69863,
        "differential_pct": 5,
        "financing_spread": 0,
        "carry_income_annual": 5000,
        "carry_income_period": 5000,
        "return_on_margin_annual_pct": 50,
        "return_on_margin_period_pct": 50
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:22.593Z",
        "request_id": "3f453786-03a0-48b7-a04a-d6f5e911719f"
    },
    "status": "ok",
    "message": "Carry computed",
    "success": true
}
```

#### `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"
```

**Response:**
```json
{
    "data": {
        "days": 365,
        "note": "Swap/rollover is the carry accrued per day = notional x differential / 365. Positive = you receive it, negative = you pay it.",
        "source": "CARRY",
        "leverage": 1,
        "notional": 100000,
        "direction": "receive",
        "daily_carry": 13.69863,
        "period_carry": 5000,
        "weekly_carry": 95.890411,
        "monthly_carry": 410.958904,
        "differential_pct": 5,
        "daily_carry_pct_of_margin": 0.01369863
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:22.697Z",
        "request_id": "14aeaeb0-3d2c-4356-ad24-71209c3edb70"
    },
    "status": "ok",
    "message": "Rollover computed",
    "success": true
}
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "rate_long = yield of the bought currency, rate_short = yield of the funding currency, both annual % (5.5 = 5.5%). notional, leverage, days and financing_spread optional.",
        "source": "Computed in-process from caller-supplied interest rates (no upstream)",
        "service": "carrytrade-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/carry": "Differential, carry income & leveraged return (rate_long=5.5&rate_short=0.5&notional=100000&leverage=10).",
            "GET /v1/rollover": "Daily/weekly/monthly swap (rate_long=5.5&rate_short=0.5&notional=100000).",
            "GET /v1/breakeven": "Adverse spot move the carry cushions (rate_long=5.5&rate_short=0.5&days=365&spot=150)."
        },
        "description": "Live carry-trade and rollover analytics computed on demand from two interest rates. The carry endpoint returns the interest-rate differential, the carry income over a period, the financing-adjusted yield and the leveraged return on margin; the rollover endpoint returns the daily/weekly/monthly swap (positive when you earn carry, negative when you pay); the breakeven endpoint returns how far the spot can move against the position before the carry is wiped out. An interest-rate / carry engine, distinct from pip/lot calculators and price tools. Computed locally, nothing stored.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-11T07:49:22.794Z",
        
…(truncated, see openapi.json for full schema)
```


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