# QuantOracle FX Carry Trade Calculator

> QuantOracle FX Carry Trade Calculator is a paid API for AI agents from api.quantoracle.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Computes FX carry trade P&L, spot/carry returns, levered returns, annualized total return, and breakeven depreciation for a currency position given entry/exit prices and interest rate differentials.

## Facts

- Endpoint: POST https://api.quantoracle.dev/v1/fx/carry-trade
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-quantoracle-dev-1907e2da
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dvqsmQ15YVew1mpi5u4on

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-quantoracle-dev-1907e2da -d '<json body>'
```

Example prompt: I entered a EUR/USD carry trade at 1.25 and plan to exit at 1.26 with a $50,000 notional and 2x leverage held for 30 days — the borrow rate is 2% and the invest rate is 5%. Can you break down the spot return, carry return, total return, levered return, annualized return, and the breakeven depreciation for me?

## When to prefer this

Use this endpoint when you need a full decomposition of an FX carry trade's return profile — separating spot and carry contributions, computing leverage effect, and annualizing returns — rather than a simple spot FX gain/loss calculator. Ideal for quantitative traders, portfolio analysts, or AI agents modeling currency strategies with interest rate differentials.

## Known failure modes

- Missing required fields (leverage, notional, spot_entry, spot_exit, holding_period_days, borrow/invest rates) returns validation error
- Leverage or notional of zero or negative may cause division errors or unexpected results
- Invalid rate values (e.g. rates > 1 if interpreted as decimals vs percent) may yield nonsensical annualized returns
- Network timeout or service unavailability returns 5xx
- Insufficient USDC balance for x402 payment results in 402 Payment Required

## How this service works

QuantOracle: fx/carry-trade

## Output

Returns a JSON object with: P&L in dollar amount, spot return percentage, carry return percentage, total return percentage, levered return percentage, annualized total return, and the breakeven depreciation percentage — decomposing exactly how much of the trade's performance came from spot movement vs the interest rate differential.

## Example request

```json
{
 "leverage": 2,
 "notional": 50000,
 "spot_exit": 1.26,
 "spot_entry": 1.25,
 "holding_period_days": 30,
 "borrow_currency_rate": 0.02,
 "invest_currency_rate": 0.05
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "leverage": {
   "type": "number",
   "title": "Leverage",
   "default": 1,
   "description": "Leverage multiplier"
  },
  "notional": {
   "type": "number",
   "title": "Notional",
   "default": 100000,
   "description": "Notional trade amount"
  },
  "spot_exit": {
   "type": "number",
   "title": "Spot Exit",
   "description": "Spot rate at exit"
  },
  "spot_entry": {
   "type": "number",
   "title": "Spot Entry",
   "description": "Spot rate at entry"
  },
  "holding_period_days": {
   "type": "integer",
   "title": "Holding Period Days",
   "description": "Holding period in days"
  },
  "borrow_currency_rate": {
   "type": "number",
   "title": "Borrow Currency Rate",
   "description": "Interest rate of the funding (borrow) currency"
  },
  "invest_currency_rate": {
   "type": "number",
   "title": "Invest Currency Rate",
   "description": "Interest rate of the investment currency"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-quantoracle-dev-1907e2da/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.quantoracle.dev](https://www.zero.xyz/host/api.quantoracle.dev/llms.txt)
