# Python Quantlib : How to value the Non Deliverable currency Interest Rate Swaps?

I followed all the procedure in Quantlib to process interest rate swap valuation through Python Quantlib. I valued more than a million records. All the valuation is almost the expected amount. But 'Interest rate Swap' of these currencies ( CNY, KRW, THB, TWD) are way off than the expected valuation. Almost 100% variation in amount has been observed from the reported value.

Any suggestion on above currencies why their valuation are so different ? I read all the theories on Non Deliverable Swap currencies but I want to implement something in Quantlib to get the correct valuation. Please suggest.

## 1 Answer

The problem is quantlib supports only IRS. But you're trying to find NDS valuation.

• IRS valuation:

PV (present value) of the interest payments on the fixed leg: $$$$f(x) = \sum \limits_{i=1}^{n} \delta({T}_{j-1},{T}_{j}) \cdot K \cdot P(0, T_j)$$$$ PV (present value) of the interest payments on the floating leg:

$$$$f(x) = \sum \limits_{i=1}^{n} \delta({T}_{j-1},{T}_{j}) \cdot F({T}_{j-1},{T}_{j}) \cdot P(0, T_j)$$$$ where:

$$\delta({T}_{j-1},{T}_{j})$$ - day-count fraction

$$K$$ , $$F({T}_{j-1},{T}_{j}$$ - fixed and forward rates

$$P(0, T_j)$$ - discount factor (price of zero coupon bonds)

• For NDS (non-deliverable swap) formula:

$$$$F(0,T) - S_0 = S_0 \bigg(\frac {1 + r_d \cdot T}{1 + r_f \cdot T} - 1 \bigg) = \\ = \frac {S_0(r_d - r_f) \cdot T}{1 + r_f \cdot T} \approx S_0(r_d - r_f) \cdot T$$$$

But for NDS(floating for floating, fixed for floating) are usually used in emerging markets where the currency is illiquid, subject to exchange restrictions, or even non-convertible the quanto correction must be apply to foreign currency forward rates. For instance, if you want to evaluate cross currency swap the effective forward rate used in pricing:

$$$$f = (0, t_j, t_{j+1}) \cdot (1 + \rho_j \cdot \sigma_{f_j} \cdot \sigma_{FX} \cdot t_j)$$$$

where

$$\rho_j$$ - FX/Forward rate correlation

$$\sigma_{FX}$$ - forex rate volatility

More information: Boenkost, Schmidt "Notes on convexity and quanto adjustments for interest rates and related options" (2003), SSRN 1375570

• Do you have any link document or example to solve this one ? Commented Feb 28, 2020 at 13:55
• @Rahul, Sure: [VALUATION AND HEDGING OF DIFFERENTIAL SWAPS] (140.113.26.31/uploads/journal_paper_file/journal_file/…) Interest rate swap : quanto LIBOR and CMS rate Commented Feb 29, 2020 at 0:25
• Old thread, but can anyone comment how the quanto adjustment is carried out in practice. E.g. I have market quoted NDIRS (fix vs. compounded 7d Repo) in CNY. How would I bootstrap the curve and what's the result even? CNY forward rates that need to be quanto adjusted? or quanto-adjusted ones already? in case of the former, how would I adjust my CNY (USD) cashflows that I project off this curve? Commented Jul 12, 2023 at 8:08