К основному содержанию
скилл CX Codex

currencies-and-fx — скилл для Claude Code: валюты и FX-риск

Разбирает валютные курсы, форварды, паритет ставок и хеджирование валютного риска в международном портфеле.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add JoelLewis/finance_skills --skill currencies-and-fx -a claude-code
Открыть на GitHub

Что делает currencies-and-fx

Скилл даёт агенту справочник по валютному рынку: спот и форвардные курсы, покрытый и непокрытый паритет процентных ставок, форвардная премия, кросс-курсы, кэрри-трейд, реальный курс и паритет покупательной способности. Внутри — таблица формул с областью применения и разобранные примеры расчётов.

Примеры считают форвардный курс по спот-курсу и ставкам двух валют, а также выгоду или издержки хеджирования. Отдельный раздел разбирает типичные ошибки: путаницу в соглашениях котировок вроде EUR/USD и USD/JPY, смешение номинальных и реальных ставок, риск резкого сворачивания кэрри-трейда. Форвардный курс здесь не прогноз будущего спота, а арбитражная цена.

Скилл ссылается на другие скиллы плагина wealth-management: historical-risk, equities и fixed-income-sovereign. Если ставите его отдельно, эти перекрёстные ссылки ни на что не опираются. Материал обрывается на разделе с перекрёстными ссылками.

Какие задачи решает

  • посчитать форвардный курс по спот-курсу и ставкам двух валют
  • оценить, сколько стоит хеджирование валютной позиции
  • вывести кросс-курс через общую третью валюту
  • объяснить разницу между покрытым и непокрытым паритетом ставок
  • разобрать риск кэрри-трейда при резком сворачивании

Примеры запросов агенту

  • Посчитай форвардный курс USD/JPY на год, если спот 150, ставка США 5%, ставка Японии 0.5%
  • Стоит ли хеджировать мои европейские акции обратно в доллары и во сколько это обойдётся
  • Выведи EUR/GBP через EUR/USD и GBP/USD

Как установить currencies-and-fx

1Через Skills CLI (Vercel)

npx skills add JoelLewis/finance_skills --skill currencies-and-fx -a claude-code

2Вручную: положить файлы

~/.claude/skills/currencies-and-fx/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/currencies-and-fx/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Из того же набора59

order-lifecycle Скилл ведёт проектирование состояний заявки и потоков FIX-сообщений: от NewOrderSingle до ExecutionReport, отмены и замены. Пригодится, если вы пишете OMS или EMS. CX Codex +1 743установок market-data Скилл для проектирования инфраструктуры рыночных данных: реальные и отложенные фиды, глубина книги, вендоры, лицензии. CX Codex +1 742установок debt-management Скилл для разбора личных долгов: стратегии avalanche и snowball, рефинансирование, консолидация, DTI и расчёт срока выплаты. CX Codex +1 740установок rebalancing Скилл для ИИ-агента, который помогает держать целевые доли активов: календарная, пороговая и налогоэффективная ребалансировка. CX Codex +1 734установок diversification Скилл для расчёта диверсификации портфеля: корреляции, эффективная граница, минимальная дисперсия и вклад активов в риск. CX Codex +1 724установок account-transfers Скилл для работы с переводами клиентских счетов: ACAT, не-ACAT, внутренние журнальные проводки, ролловеры и базис стоимости. CX Codex +1 722установок bet-sizing Считает, какую долю капитала отдать одной позиции: критерий Келли, дробный Келли, риск-бюджет, лимиты концентрации. Пригодится, когда портфель надо разложить по весам, а не на глаз. CX Codex +1 718установок liquidity-management Помогает планировать денежные потоки, распределять резервы по уровням доступа и строить лесенки депозитов без потери доходности. CX Codex +1 711установок

Похожие

risk-manager Seth Hobson Субагент оценивает риск портфеля, размер позиций и сделки в R-мультипликаторах. Подходит для контроля лимитов, хеджирования и стоп-лоссов. CX Codex 550установок portfolio-risk-management официальный OpenAI Скилл превращает инвестиционный тезис по акции в конкретную позицию: сколько держать, чем хеджировать и когда пересматривать. CX Codex GP ChatGPT ★ 7 596звёзд репо golang-dependency-injection samber Помогает организовать внедрение зависимостей в Go-проектах: от ручных конструкторов до библиотек wire, dig, fx и do. CX Codex +1 39 500установок golang-uber-fx samber Скилл для работы с uber-go/fx — фреймворком зависимостей с lifecycle-хуками, модульной системой и graceful shutdown. Пригодится, если в проекте уже используется fx или вы переходите на него для long-running сервисов. CX Codex +1 36 600установок affiliate-payout-audit Maya-Beth Finotti Проверяет расчёт партнёрских комиссий до перевода денег: пересчитывает ставки и уровни, ищет дубли конверсий, проверяет окна валидации и налоговые формы. CX Codex +1 13 500установок k-dart NomaDamas Скилл для поиска данных в DART (Электронная система공시 Корейской комиссии по финансовому надзору). Ищет публикации, финансовые отчёты и сведения о компаниях через OpenAPI. CX Codex +1 6 500установок

Вопросы о currencies-and-fx

Как установить currencies-and-fx в Claude?

Выполните npx skills add JoelLewis/finance_skills --skill currencies-and-fx -a claude-code. Скилл встанет в ~/.claude/skills/currencies-and-fx/SKILL.md.

Что делает currencies-and-fx?

Даёт агенту формулы и примеры по валютным курсам: форварды, паритет процентных ставок, кросс-курсы, кэрри-трейд, хеджирование и паритет покупательной способности.

Чем форвардный курс отличается от прогноза спота?

Форвард определяется разницей ставок двух валют и держится арбитражем, а не ожиданиями рынка. Непокрытый паритет ставок как теория на практике часто не срабатывает.

Исходный текст

SKILL.md · MIT
---
name: currencies-and-fx
description: "Analyze currency markets, exchange rate mechanics, and FX risk management for international portfolios. Use when the user asks about exchange rates, FX hedging, interest rate parity, carry trades, forward premiums, cross rates, or currency overlay programs. Also trigger when users mention 'strong dollar', 'weak euro', 'hedging foreign stocks', 'purchasing power parity', 'currency risk in my portfolio', 'EUR/USD', 'yen carry trade', or ask whether to hedge international investments."
---

# Currencies and FX

## Core Concepts

### Spot Rate
The price of one currency in terms of another for immediate delivery (T+2 settlement). Quoting convention: EUR/USD = 1.10 means 1 euro costs 1.10 US dollars. Some pairs are quoted as the number of foreign currency units per dollar (USD/JPY = 150), while others are quoted as dollars per foreign unit (EUR/USD = 1.10, GBP/USD = 1.27).

### Forward Rate
The agreed exchange rate for a future currency transaction, determined by the interest rate differential between the two currencies. Forward rates are not forecasts of future spot rates — they are arbitrage-determined prices that reflect the cost of carry.

### Covered Interest Rate Parity (CIP)
An arbitrage condition that must hold (and empirically does, closely):

F/S = (1 + r_d) / (1 + r_f)

where F = forward rate, S = spot rate, r_d = domestic interest rate, r_f = foreign interest rate (for the same period). If CIP were violated, riskless arbitrage would be possible by borrowing in one currency, converting, investing, and locking in the return with a forward.

### Uncovered Interest Rate Parity (UIP)
A theoretical (not arbitrage-enforced) condition:

E(S_t) / S_0 = (1 + r_d) / (1 + r_f)

UIP predicts that the expected future spot rate adjusts to offset interest rate differentials. Empirically weak — high-interest-rate currencies tend to appreciate rather than depreciate as UIP predicts, which is why carry trades can be profitable.

### Forward Premium/Discount
Forward Premium = (F - S) / S = (r_d - r_f) / (1 + r_f)

If the domestic interest rate exceeds the foreign rate, the forward rate is at a premium to spot (the foreign currency is more expensive forward). If the domestic rate is lower, the forward is at a discount.

### Carry Trade
Borrow in a low-interest-rate currency and invest in a high-interest-rate currency, profiting from the interest rate differential. Profitable when UIP fails (i.e., the high-rate currency does not depreciate enough to offset the interest differential). Carry trades exhibit positive returns on average but with significant tail risk — sudden unwinds during risk-off episodes can cause severe losses (negative skewness, fat tails).

### Cross Rate
Derive the exchange rate between two currencies using their rates against a common third currency:

EUR/GBP = (EUR/USD) / (GBP/USD)

For example, if EUR/USD = 1.10 and GBP/USD = 1.27, then EUR/GBP = 1.10 / 1.27 = 0.8661.

### Currency Hedging
Use forward contracts to eliminate FX risk in international investments. A US investor with EUR assets can sell EUR forward to lock in the conversion rate. The hedging cost equals the interest rate differential between the two currencies (per CIP). When the domestic rate exceeds the foreign rate, hedging earns a positive return; when it is lower, hedging has a cost.

### Real Exchange Rate
Adjusts the nominal exchange rate for relative price levels:

Real Rate = Nominal Rate × (Foreign Price Level / Domestic Price Level)

Changes in the real exchange rate reflect changes in competitiveness. If the real rate appreciates, domestic goods become more expensive relative to foreign goods.

### Purchasing Power Parity (PPP)
The long-run anchor for exchange rates. PPP posits that exchange rates should adjust so that identical goods cost the same across countries. Empirically, PPP holds poorly in the short run but provides a reasonable guide to fair value over decades. Deviations from PPP can persist for years.

### Currency Overlay
A systematic hedging program for international portfolios, managed separately from the underlying asset allocation. Overlay managers implement hedging ratios (e.g., hedge 50% of foreign exposure) and may make tactical adjustments based on valuation, carry, and momentum signals.

## Key Formulas

| Formula | Expression | Use Case |
|---------|-----------|----------|
| CIP Forward Rate | F = S × (1+r_d)/(1+r_f) | Arbitrage-determined forward |
| UIP Expected Spot | E(S_t) = S_0 × (1+r_d)/(1+r_f) | Theoretical future spot |
| Forward Premium | (F-S)/S = (r_d-r_f)/(1+r_f) | Forward vs spot differential |
| Cross Rate | A/B = (A/C) / (B/C) | Derive from common currency |
| Real Exchange Rate | q = e × (P*/P) | Competitiveness measure |
| Hedging Cost | ≈ r_d - r_f (annualized) | Cost to hedge FX exposure |

## Worked Examples

### Example 1: Forward Rate Calculation
**Given:** USD/JPY spot = 150, US 1-year rate = 5%, Japan 1-year rate = 0.5%
**Calculate:** 1-year forward rate
**Solution:**
F = S × (1 + r_JPY) / (1 + r_USD)
F = 150 × (1 + 0.005) / (1 + 0.05)
F = 150 × 1.005 / 1.05
F = 150 × 0.95714 = 143.57

The forward rate is 143.57 JPY/USD. The yen is at a forward premium (fewer yen per dollar forward than spot) because Japanese rates are lower. A US investor hedging yen assets back to dollars would receive this favorable forward rate, effectively earning the interest rate differential.

### Example 2: Hedging Cost for EUR Investor
**Given:** EUR/USD spot = 1.10, EUR 1-year rate = 3%, USD 1-year rate = 5%
**Calculate:** Annual cost/benefit of hedging USD exposure back to EUR
**Solution:**
Forward rate: F = 1.10 × (1.03)/(1.05) = 1.10 × 0.98095 = 1.0790

A EUR investor hedging USD assets sells USD forward at 1.0790 EUR/USD.
Hedging benefit = (S - F) / S = (1.10 - 1.079) / 1.10 = 1.91%

Because EUR rates (3%) are lower than USD rates (5%), the EUR investor earns a positive hedging return of approximately 2% (the interest rate differential). The hedged return on USD assets for a EUR investor is the USD return plus approximately 2% from the hedge.

## Common Pitfalls
- Currency quoting conventions — EUR/USD vs USD/JPY use opposite conventions; always clarify which currency is base and which is quote
- Confusing nominal and real interest rate differentials — CIP uses nominal rates; real rate differentials affect real exchange rates differently
- Carry trade crash risk — carry strategies exhibit negative skewness and fat tails; profits accumulate slowly but losses can be sudden and severe
- CIP holds by arbitrage; UIP is a theory that often fails empirically — do not assume forward rates predict future spot rates

## Cross-References
- **historical-risk** (wealth-management plugin): return measurement in multi-currency portfolios
- **equities** (wealth-management plugin): international equity investing and currency effects
- **fixed-income-sovereign** (wealth-management plugin): international bond investing and rate differentials
- **asset-allocation** (wealth-management plugin): currency hedging decisions in portfolio context

## Running the Script

```bash
uv run scripts/currencies_and_fx.py            # run the demo (uses PEP 723 inline deps)
uv run scripts/currencies_and_fx.py --verify   # check demo outputs against the worked examples (exit 1 on mismatch)
python3 scripts/currencies_and_fx.py            # alternative (stdlib only, no installs needed)
```

The demo prints the calculations covered above; its values match the worked examples in this skill. Run `--help` for a list of the classes and functions. For programmatic use, import the module rather than running it — the demo only executes under `python currencies_and_fx.py`.

© JoelLewis · MIT · JoelLewis/finance_skills

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой