# FX Cross-Rate & Triangular Arbitrage API
> Live cross-rate, triangular-arbitrage and conversion-path maths that FX desks and trading bots run on a set of quoted rates, computed on demand from the legs you pass in — no key, no cache, nothing stored. The cross endpoint chains two pairs that share a currency into the implied third rate (EUR/USD x USD/JPY gives EUR/JPY) and, if you supply the quoted cross, returns the discrepancy in basis points and whether it is arbitrageable. The triangular endpoint takes a closed loop of three rates and detects a triangular-arbitrage opportunity — the cycle product, the profit in percent, the winning direction (forward or reverse) and the payout on a notional. The chain endpoint converts an amount along a path of pairs and returns the amount at every hop with the effective rate. Each leg is written FROMTO:rate, meaning one unit of FROM buys that many of TO (e.g. EURUSD:1.08). This is an FX cross-rate and arbitrage engine that reasons across several pairs at once, distinct from pip/lot calculators and single-pair converters. Computed locally and deterministically, so it is instant and private. Ideal for FX arbitrage scanners, multi-currency pricing, treasury routing and trading dashboards. Live, nothing stored. 3 compute endpoints. For live quotes feed in rates from an FX or exchange 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/fxcross-api/..."
```

## Pricing
- **Free** (Free) — 4,500 calls/Mo, 2 req/s
- **Starter** ($8/Mo) — 88,000 calls/Mo, 6 req/s
- **Pro** ($23/Mo) — 465,000 calls/Mo, 18 req/s
- **Business** ($53/Mo) — 2,850,000 calls/Mo, 45 req/s

## Endpoints

### FX

#### `GET /v1/chain` — Convert an amount along a path of pairs

**Parameters:**
- `legs` (query, required, string) — Chained pairs FROMTO:rate Example: `EURUSD:1.08,USDJPY:150`
- `amount` (query, required, string) — Amount in the first currency Example: `1000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxcross-api/v1/chain?legs=EURUSD%3A1.08%2CUSDJPY%3A150&amount=1000"
```

#### `GET /v1/cross` — Implied cross rate from chained pairs

**Parameters:**
- `legs` (query, required, string) — Chained pairs FROMTO:rate, comma-separated Example: `EURUSD:1.08,USDJPY:150`
- `quoted` (query, optional, string) — Quoted cross to compare against Example: `163`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxcross-api/v1/cross?legs=EURUSD%3A1.08%2CUSDJPY%3A150&quoted=163"
```

#### `GET /v1/triangular` — Triangular-arbitrage detection

**Parameters:**
- `legs` (query, required, string) — Closed 3-rate loop FROMTO:rate Example: `EURUSD:1.08,USDJPY:150,JPYEUR:0.00617`
- `notional` (query, optional, string) — Notional to compute payout on (default 1) Example: `10000`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/fxcross-api/v1/triangular?legs=EURUSD%3A1.08%2CUSDJPY%3A150%2CJPYEUR%3A0.00617&notional=10000"
```

### Meta

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

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


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