Brazilian Derivatives and Securities This page intentionally left blank Brazilian Derivatives and Securities Pricing and Risk Management of FX and -Rate Portfolios for Local and Global Markets

Marcos C. S. Carreira Quantitative Practitioner, Brazil

Richard J. Brostowicz Executive Director and Head of Brazil Quants, Banco Morgan Stanley, Brazil © Marcos C. S. Carreira and Richard J. Brostowicz 2016 Foreword © Peter Carr 2016

All rights reserved. No reproduction, copy or transmission of this publication may be made without written permission. No portion of this publication may be reproduced, copied or transmitted save with written permission or in accordance with the provisions of the Copyright, Designs and Patents Act 1988, or under the terms of any licence permitting limited copying issued by the Copyright Licensing Agency, Saffron House, 6–10 Kirby Street, London EC1N 8TS. Any person who does any unauthorized act in relation to this publication may be liable to criminal prosecution and civil claims for damages. The authors have asserted their rights to be identified as the authors of this work in accordance with the Copyright, Designs and Patents Act 1988. First published 2016 by PALGRAVE MACMILLAN Palgrave Macmillan in the UK is an imprint of Macmillan Publishers Limited, registered in England, company number 785998, of Houndmills, Basingstoke, Hampshire RG21 6XS. Palgrave Macmillan in the US is a division of St Martins Press LLC, 175 Fifth Avenue, New York, NY 10010. Palgrave Macmillan is the global academic imprint of the above companies and has companies and representatives throughout the world. Palgrave® and Macmillan® are registered trademarks in the United States, the United Kingdom, Europe and other countries

ISBN 978-1-137-47726-2 ISBN 978-1-137-47727-9 (eBook) DOI 10.1057/9781137477279 This book is printed on paper suitable for recycling and made from fully managed and sustained forest sources. Logging, pulping and manufacturing processes are expected to conform to the environmental regulations of the country of origin. A catalogue record for this book is available from the British Library. Library of Congress Cataloging-in-Publication Data Brostowicz, Richard J., author. Brazilian derivatives and securities : pricing and risk management of FX and interest-rate portfolios for local and global markets / Richard J. Brostowicz, Marcos Carreira. pages cm

1. Foreign exchange market–Brazil. 2. securities–Brazil. 3. Investments–Brazil. 4. Finance–Brazil. I. Carreira, Marcos, author. II. Title. HG3933.B76 2015 332.64’570981–dc23 2015033263 Contents

List of Figures xiv

List of Tables xvii

Foreword xviii Peter Carr

Preface xx

Acknowledgments xxi

1 Financial Archeology 1 1.1 Interest rates and inflation 1 1.1.1 Record levels (the old days of overnight rates of 2% per day and the Real Plan); desperate times call for desperate measures 1 1.1.2 COPOM (the Brazilian FOMC): behavior, language, influence, targets and bands 9 1.1.3 The Brazilian Payment System (SPB): the end of the dual cash regime; CDI and Selic 16 1.1.4 A new era? What has changed under Tombini? Coordination and communication, or more subtle changes? 22 1.2 Foreign exchange 24 1.2.1 Testing the waters 24 1.2.2 Pegs and multiple currencies 26 1.2.3 Indexing of local instruments 28 1.2.4 Floating, ballast and hot air (on the different mechanisms to manage a floating currency) 28 1.2.5 Paganism (on how to avoid conversion, and the history of offshore x onshore spreads) 34 1.2.6 A bit of a fit (on the 2008 crisis) 37

2 We Mean Business 40 2.1 Calendars 40 2.1.1 Banking calendars and fixings 40 2.1.2 Trading and listed contracts 41 2.1.3 New York, Rio, São Paulo – the FX combined calendar 41

v vi Contents

2.1.4 Notation used for moving forward or backward business days in a specified calendar 42 2.2 Interest rate fixings 42 2.2.1 Selic target 42 2.2.2 Selic 43 2.2.3 CDI 45 2.2.4 TJLP 46 2.2.5 TR 47 2.3 Inflation fixings 48 2.3.1 IPCA 48 2.3.2 IGP-M 52 2.4 Foreign exchange fixings 55 2.4.1 PTAX 55 2.4.2 EMTA 56 2.4.3 WMR 56 2.4.4 Observability for barriers 57 2.5 The 3 Ts in FX pricing: a more precise version of the Black Formula 57

3 Interesting BRL Interest Rates 60 3.1 3 months in the life of an IR 60 3.2 3 months in the life of a DI Future 68 3.3 Explaining it all 69 3.4 A simple swap 72 3.5 A promising future – The DI1 Future 72 3.6 My first numéraire – a more mathematical framework for DI Futures (DI1) 75 3.7 The still promising Future -> The Selic Futures (OC1) 78 3.8 Pricing BRL interest rate futures 79 3.8.1 DI Future (DI1) pricing 79 3.8.2 BRL onshore CDI curve construction 80 3.8.3 Selic Future (OC1) pricing 82 3.8.4 BRL onshore Selic spread curve construction 82 3.9 Giving 110% 83 3.10 The CDI+Spread is a multiplicative spread 84 3.11 How to price the 3 possible BRL Fixed X Float payoffs? 84 3.11.1 100% CDI case 84 3.11.2 CDI+Spread case 85 3.11.3 Percentage of CDI case 86

4 BRL Interest Rate Market and Credit Risk 87 4.1 Historical spreads 87 4.2 The term structure of 89 Contents vii

4.2.1 Slope 89 4.2.2 Covariance 95 4.2.3 Principal components 95 4.3 Potential exposures 97 4.4 Zero curve: and the winner is ... 98 4.4.1 Linear Interpolation (LI) 100 4.4.2 Flat Forward (FF) 101 4.4.3 Cubic Spline (CS) 102 4.4.4 Which is better? 102 4.5 Smooth operator 102 4.6 Sensitivities 105 4.6.1 Zero 105 4.6.2 Forward 106 4.7 A framework for risk 107 4.7.1 Minimal description 107 4.7.2 The envelope and liquidity risk 108 4.7.3 The first, the last and the ugly 108 4.8 Trading forwards 108 4.9 Risk and P&L attribution 109

5 A Man with Two Clocks ... Foreign Exchange in Brazil 110 5.1 FX Spot 110 5.1.1 Who can trade it 110 5.1.2 How, when and where to trade it 110 5.1.3 Observability 111 5.2 DOL 111 5.2.1 Contract details 111 5.2.2 Liquidity 111 5.2.3 DR1 and the roll 112 5.2.4 Payoff of DOL contract 112 5.2.5 Pricing a DOL contract based FRC, DI’s, nearest maturity FXFUT and CASADO quotes 113 5.2.6 Apples and oranges 113 5.2.7 Convexity corrections 114 5.3 Forward points strategies 115 5.3.1 FRP 115 5.3.2 “Casado” 116 5.4 FX Future crosses 116 5.4.1 Payoff 117 5.4.2 Pricing and hedging 117 5.4.3 Convexity corrections 119 viii Contents

6 And the Even More Interesting USD Onshore Interest Rates . . . 120 6.1 3 months in the life of a FX Swap 120 6.2 3 months in the life of a DDI Future 120 6.3 Explaining it all 120 6.4 The DDI Futures (DDI) -> Why they were designed this way? 121 6.5 The mathematical derivation of a DDI contract price 125 6.5.1 DDI Future pricing 127 6.6 It takes two (DDI contracts) to (con)tango -> The FRA de CUPOM strategy (FRC) 131 6.6.1 FRC Future pricing 132 6.6.2 Handling a FRC trade before BVMF publication of the first DDI closing price 133 6.7 Calibration of the cupom curve 134 6.7.1 Calibration of the cupom curve on the short end 134 6.7.2 Calibration of the cupom curve on the long end 135 6.8 How to compute cupom interest rate risk? 137 6.9 Interpolation choices for the cupom curve 139 6.9.1 Log-linear interpolation of cupom curve forward discount factors curve in business days 139 6.9.2 Log-linear interpolation of cupom curve forward discount factors curve in calendar days 140 6.9.3 Log-linear interpolation of cupom curve in FX forward prices 140 6.10 The SCC contract 141 6.11 The mathematical derivation and pricing of a SCC contract price 142 6.12 The SCS contract – a modern, but exotic, cousin 143 6.13 The mathematical derivation of a SCS contract price 143 6.14 SCS Future pricing 145 6.15 Forward starting SCS contracts 150 6.16 A much simpler alternative to FRC contracts 150 6.17 A BRL Float or Fixed X USD onshore Fixed swap 152 6.17.1 Coupon payoff specification 152 6.17.2 Coupon pricing 153

7 Too Many Options? 154 7.1 IDI options 156 7.1.1 IDI options available indices and compounding methodology 156 7.1.2 IDI options payoff and other contractual information 157 7.1.3 IDI options common trading strategies 158 Contents ix

7.1.4 A simple Black pricing formula for an IDI option assuming the IDI index as its main underlying 159 7.1.5 How to fit a volatility smile for an IDI option assuming the IDI index as its main underlying 161 7.1.6 A simple Black pricing formula assuming the IDI index equivalent realized interest rate as the underlying 161 7.1.7 Is the IDI option smiling at you now? 163 7.1.8 Or is it smirking? 164 7.1.9 A discrete tree model that could fit the smirk volatility surface shape for IDI options 165 7.1.10 Delta hedging IDI options under the discrete tree model 167 7.1.11 Delta hedging IDI options under the SABR model 168 7.1.12 IDI options pricing under HJM model 169 7.1.13 IDI options historical volatility computation – how to price an IDI option if only the DI Futures market was liquid? 174 7.1.14 IDI digital options – limitations and applicability 176 7.1.15 OTC IDI options at Cetip 177 7.2 DI Future options 177 7.2.1 Basic trading information and definition of the contract codes 178 7.2.2 DI Future options payoff – smells like ? 178 7.2.3 DI Future options most common trading strategies 180 7.2.4 A simple Black pricing formula for DI Future options 180 7.2.5 Can DI Future options smile with the SABR model? 181 7.2.6 DI Future options pricing under HJM model – where’s the smile? 182 7.2.7 What about DI Future options under the BGM a.k.a Libor Market Model? 184 7.2.8 DI Future options historical volatility computation – how to price a DI Future option if only the DI Futures market was liquid 185 7.3 IR option strategies – VTF and VID 188 7.3.1 VTF 188 7.3.2 DI Future delta hedge computation by BVMF 189 7.3.3 VID 190 7.3.4 DI Future delta hedge computation by BVMF 191 7.4 Jabuticabas: risk management of options on interest rates 191 7.4.1 IDI options 191 BRL 7.5 USD Listed FX options 192 7.5.1 Contract details 193 x Contents

BRL 7.5.2 USD Listed FX options payoff 193 BRL 7.5.3 A simple Black pricing formula for USD Listed FX options 194 7.5.4 Volatility surface based on SABR model 194 7.5.5 Volatility surface based on polynomial on FX delta 195 BRL 7.6 USD Listed FX options with daily margining 196 BRL 7.7 USD FX options: strategies 196 7.7.1 VTC 196 7.7.2 FX Future delta hedge computation by BVMF 197 7.7.3 Do you believe you are delta hedged? 197 7.8 OTC IR and FX options 198

8 The Mountain Goes to . . . Foreign Exchange Contracts Offshore 200 BRL 8.1 CME USD FX Futures 201 8.1.1 Contract details 201 8.1.2 Payoff 201 8.1.3 Pricing 202 8.2 OTC – NDFs 202 BRL 8.2.1 USD offshore NDFs – payoff and differences for the equivalent onshore NDF contract 202 8.2.2 A quick detour for pricing collateralized derivatives 206 8.2.3 Pricing a collateralized NDF contract offshore 208 8.2.4 How offshore NDFs are usually traded in the interbank market? 210 8.2.5 Revisiting the cupom curve construction based on NDF spread strategies 211 8.2.6 The mythical offshore BRL discounting curve 211 8.3 OTC – BRL/USD options 212

9 Start from Where? Constructing Markets for FX Forwards, Futures, Onshore USD Interest Rates and Offshore Instruments 217 9.1 Observability of contracts 217 9.1.1 Spot x DOL 217 9.1.2 FRC x Forward x DOL 217 9.1.3 NDFs and forward points 218 9.2 Structures 218 9.2.1 Dates 218 9.2.2 Events (breaks, fixings, market points) 218 9.2.3 “The Triangle” 219 9.3 Curve construction 220 9.3.1 Cupom Cambial 220 Contents xi

9.3.2 Forwards 220 9.4 The offshore x onshore spread 220 9.4.1 Changing standards 220 9.4.2 Convertibility, demand and taxes 221 9.5 The mythical offshore BRL discounting curve 221

10 Offshore IR Products Based on CDI Fixings 222 10.1 Offshore BRL Fixed-Float swaps 222 10.1.1 Offshore BRL Fixed-Float swaps payoff 223 10.1.2 Foreign market participants appetite for offshore BRL Fixed-Float swaps 223 10.1.3 Which discounting curve to use for offshore BRL Fixed-Float swaps pricing? 224 10.1.4 Is this a quanto swap? Let’s analyze it from a hedging perspective 224 10.1.5 Now let’s analyze it from a mathematical perspective 225 10.1.6 BRL Fixed-Float offshore breakeven historical swap rate 229 10.1.7 Calibrating an offshore BRL Fixed-Float swap basis curve 230 10.2 Offshore BRL Fixed-Float 230 10.2.1 BRL Fixed-Float offshore swaption payoff and specification 231

11 The Dual Case – US Libor Onshore Swaps 234 11.1 Payoff of US Libor onshore swaps 234 11.2 Pricing of US Libor onshore swaps 234

12 FX Trading (Interest Rate and Fixing) Market and Credit Risk 237 12.1 Fixing 237 12.2 The term structure of the Cupom Cambial 238 12.2.1 Slope 238 12.2.2 Casado 238 12.3 Potential exposures 238 12.4 Interpolation and sensitivities 240 12.5 A framework for risk 241 12.6 Trading forwards 241 12.7 Risk and P&L attribution 242 12.8 DOL convexity correction to a FX 243

13 A Skewed Perspective of the World: FX Options 246 13.1 Starting from the end (market standards for offshore FX options) 246 13.1.1 Weightlifting 246 13.1.2 Reversal of fortune 248 xii Contents

13.1.3 The locals are friendly 253 13.1.4 Thin tails wagging the dogs 254 13.1.5 The couple, decoupled 255 13.2 Back to the beginning (What is different in onshore FX options?) 256 13.2.1 Uncertain smile 256 13.2.2 Fixing the averaging 256 13.2.3 I’d risk everything 257 13.2.4 Look in the mirror 258 13.3 Risk management 266 13.4 Risk and P&L attribution 268

14 Some Cash Is Better Than Nothing – What You Need to Know about Cash Products 270 14.1 Local government bonds 270 14.1.1 Floating to the top – LFTs 270 14.1.2 The name of the game – LTNs and NTN-Fs 270 14.1.3 Making it real – NTN-Bs 271 14.1.4 Living fossils – NTN-As 271 14.1.5 Reading the fine print 271 14.2 Local corporate bonds 272 14.3 Local funding practices 272 14.4 Offshore government and corporate bonds 272 14.5 Liquidity (or lack thereof) 272 14.6 The Brazilian repo market (Compromissadas) 273

15 Index of Choice . . . Inflation-Linked Products and Curves 276 15.1 Government inflation-linked bonds 276 15.2 Inflation-linked swaps 278 15.2.1 IGPM and IPCA publication 278 15.2.2 IGPM and IPCA swaps payoff 279 15.2.3 Dirty and clean rates . . . again 279 15.2.4 Trading conventions for IGPM and IPCA swaps. Are they liquid? 279 15.2.5 IPCA swaps pricing – the market approach 281 15.2.6 IPCA swaps pricing – the foreign currency analogy approach and why it’s complicated 281 15.2.7 IPCA swaps pricing – the IPCA forwards calibration approach 283 15.2.8 IPCA index forwards interpolation without seasonality 284 15.2.9 Adding seasonality 285 Contents xiii

15.2.10 Joint calibration of IPCA curve with NTN-B bond quotes (reduced by asset-swap spread) and IPCA swap rate quotes 285 15.2.11 The IGPM market 287 15.3 Exchange traded inflation-linked Futures 288

16 Microstructure of the Listed Derivatives 289 16.1 Microstructure: concepts 289 16.2 Can durations be estimated? 290 16.3 What happens in practice? 291 16.4 What is the importance of the tick size? 292 16.5 The model with uncertainty zones (Robert and Rosenbaum) 294 16.5.1 Description of the model 294 16.5.2 What can we do with this model? 295 16.6 DOL 296 16.7 DI 296

17 Unlucky End: On the Obsolescence of Products and Books 297

References 298

Index 300 List of Figures

1 Selic target 5 2 Selic since 1986 5 3 Selic (log scale) 6 4 CDI (daily rate) 7 5 Change in overnight rates with the Real Plan (Jul-1994) 7 6 Overnight rates after the Real Plan (1994) 8 7 Overnight rates from Jul-1994 to Jul-1999 8 8 Effective Selic rate 12 9 CDI standards in 1986 13 10 CDI standards in 1990 13 11 Words of each COPOM statement (not counting the votes tally) since 2003 23 12 PTAX since 1986 25 13 Log10(PTAX) since 1986 25 14 PTAX (adjusted) since 1986 26 15 USDBRL % returns (rolling mean over 21 bd) 27 16 DOL x PTAX in Jan-1999 29 17 Contracts traded in DOL futures (expiries Feb. and Mar.) in Jan-1999 30 18 DOL prices (Feb-1999 expiry) 30 19 Reserves (liquidity) in USD billions 31 20 Interventions of the BCB on the FX Spot market by quarter, in USD billions 32 21 PTAX from 2011 to 2013 35 22 Gamma profile of hedged forward options 38 23 Daily changes in SETA 44 24 Spread SETA-Selic 44 25 Daily changes in Selic 45 26 Spread between Selic and CDI 46 27 Daily changes in CDI 46 28 TJLP (monthly) 47 29 TJLP and SETA (monthly average) 48 30 TR since 1991 49 31 TR since 2000 49 32 TR in 2012 and 2013 50 33 IPCA yoy since 1980 51 34 IPCA yoy after the Real Plan 52

xiv List of Figures xv

35 IPCA mom since 2000 53 36 IPCA mom since 2010 53 37 IGP-M mom compared with IPCA 54 38 IGP-M components 54 39 DI1 futures 01-Aug-2011 61 40 First DI1 futures 01-Aug-2011 61 41 Weighted DI1s 01-Aug-2011 62 42 3 DIs maturing in our 3m window 65 43 CDI for the 2nd half of 2011 66 44 Realized accrual for the 3m window 66 45 f (τ,τ,T) for the 3m window 67 46 PV for the 3m IR Swap 68 47 Daily cashflows for the DI 69 48 DI1 as of 19th May of 2014 70 49 Selic futures OC1 contract open interest on 19th of May 2014 70 50 DI1 Closing prices at 19th of May 2014 74 51 Annualized 3m “average” rates 88 52 Annualized 3m “average” rates for the second half of 2011 88 53 Annualized 3m “average” rates for the first half of 2012 89 54 Annualized 3m “average” rates for the second half of 2012 89 55 Annualized 3m “average” rates for the first half of 2013 90 56 Spreads between the realized 3m accruals of SETA, Selic and CDI 90 57 DI curve before and after the 1st round of the 2014 presidential elections 91 58 Absolute changes for the DI curve after the 1st round of the 2014 presidential elections 91 59 Relative changes for the DI curve after the 1st round of the 2014 presidential elections 92 60 DI curve in Jun-2013 93 61 Changes in curve after the 31 August 2011 surprise 93 62 Changes in curve after the 17 March 2010 surprise 94 63 Interpolating short rates 106 64 Sensitivities for local interpolations 106 65 Sensitivities for non-local interpolations 107 66 Behavior of the roll DR1 and casado (spread) from 2002 to 2004 114 67 DDI Futures contracts open interest on 19 May 2014 122 68 NDFOnOff Spread for 3m since 2010 204 69 NDFOnOff Spread for 6m since 2010 204 70 NDFOnOff Spread for 1y since 2010 204 71 NDFOnOff Spread for 2y since 2010 205 72 NDFOnOff Spread for 2y from Jul-2008 to Jul-2009 206 73 A simple smile using Malz 248 xvi List of Figures

74 Delta forward of an ATMF with =16% 250 75 Delta forward of an ATMF straddle with implied volatility=30% 250 76 RKO, strike 100, barrier 90 255 77 Strikes for a 25 delta USD Call 260 78 Strikes for a 25 delta USD Put 260 79 Interpolation according to Malz; (ATM, RR, ST)=(16, 3, 1)% 263 80 Modified Malz interpolation 263 81 Strikes for each delta 264 82 Implied volatility as a function of strike 264 83 Strikes for deltas (onshore and offshore) 265 84 Implied volatility (onshore and offshore) 265 85 Differences between onshore and offshore implied volatilities 266 86 Visualization of vanillas 267 87 Vanillas and strikes 267 List of Tables

1 Presidents of Brazil’s Central Bank since 1965 2 2 Brazil’s Finance Ministers since 1965 3 3 Brazil’s currencies since 1942 3 4 Interest rate decisions before the inflation targeting regime 10 5 Interest rate decisions under Arminio Fraga (1999–2000) 14 6 Interest rate decisions under Arminio Fraga (2001–2002) 15 7 Interest rate decisions under Henrique Meirelles (2003–2005) 17 8 Interest rate decisions under Henrique Meirelles (2006–2010) 19 9 Interest rate decisions under Alexandre Tombini 21 10 Interest rates before the SPB 21 11 Interest rates after the SPB 22 12 Holidays (partial) 41 13 Holidays (total) 42 14 Month codes for listed contracts 70 15 Scenarios for potential exposures 99 16 FFC algorithm (simple) 103 17 FFC algorithm (simple, numeric) 103 18 FFC algorithm (complex) 104 19 FFC algorithm (fit and curvature) 104 20 Limits hit by DOL in October 2008 243

xvii Foreword

My first encounter with Brazilian derivatives and securities arose when I was a doctoral student in finance at UCLA 32 years ago. I was fortunate enough to share an office with a gentleman named Eduardo Facó Lemgruber, whose disser- tation covered the valuation of executive stock options (ESOs). In the mid 1980s, a strong theory had developed for pricing exchange-traded options. However, the applicability of this theory for off exchange ESOs was far from immediate. In his UCLA dissertation, my enterprising office-mate showed how to adapt the standard theory to cover ESOs. Dr. Lemgruber is now a much sought after man- agement consultant, after spending 31 years as a distinguished academic. We meet from time to time at international conferences, and reminisce about the glory days, a past time especially appealing to people of our vintage. Fast forward 32 years and the Brazilian has become the largest in Latin America. BM&FBovespa is the only Latin American exchange to crack the top ten largest derivatives exchanges in the world. The prominence of the Brazilian derivatives and securities market tracks larger trends. The Feder- ative Republic of Brazil is the largest country in both South America and in the Latin American region. Brazil is the world’s fifth largest country, both by geo- graphical area and by population. It is the largest Portuguese-speaking country in the world, with roughly 20 times the population of Portugal. The 2014 FIFA World Cup was held in Brazil and the next summer Olympics are scheduled for Rio in 2016. Given these trends, it is only fitting that we have now been blessed with the first book to take a serious look at the Brazilian derivatives and securities market. Brazilian financial markets have been criticized in the past for a lack of trans- parency, so it is exciting to see the curtain pulled back by our two esteemed co-authors. It is quite rare to find a pair of practitioners with the requisite energy needed to share their deep understanding of financial markets in book form, while somehow managing to keep the lights on in their day jobs. It is equally rare to find a pair of financial institutions willing to stand up to the culture of closedness that permeates typical institutional mindsets. This book adapts the theory of mathematical finance to the realities of the Brazilian financial marketplace. Since its development at MIT in the early 1970s, mathematical finance has led to a deepened understanding of derivatives mar- kets, which in turn has had a profound impact on financial markets as a whole. The pioneers in the field of mathematical finance were compelled to posit sev- eral simplifying assumptions, in order to expose the basic intuition underlying

xviii Foreword xix derivatives pricing. While not necessarily relevant to Brazilian financial markets, these assumptions included price transparency and the continuity of asset prices over time. Price or rate jumps of Poisson type were later added to extend the theory, but price or rate jumps occurring at known times are not considered part of the mainstream. These latter type of jumps have come to be known as events, which are all too important in Brazilian securities markets. Included in events are discrete changes in interest rates or jumps in FX rates that arise due to skipped interest and principal payments on sovereign borrowing. While the Brazilian government’s credit has substantially improved over time, there remains a vibrant market in hedges against a possible default. About ten years ago, I co-authored a paper with Liuren Wu that compared the implicit pricing of sovereign default event risk in both (CDS) and foreign exchange (FX) markets. Our research led to a Bloomberg function called CDFX that compares the implied risk-neutral probabilities from the two markets. The interest in applying mathematical finance to Brazilian financial markets is stronger than ever. My former Bloomberg colleague Bruno Dupire studied in Brazil for three years and has for the last nine years co-organized a highly regarded annual conference called Research in Options (RIO!) at IMPA with Jorge Zubelli. It is just a matter of time before specialized journals emerge to cover this growing field. The contents of this book reflect almost half a century of com- bined experience of the two co-authors. I truly hope that the current generation of traders and risk managers will take the lessons of the ensuing pages to heart. Our shared financial future depends on it.

Peter Carr, PhD, Managing Director at Morgan Stanley, Global Head of Market Modeling, and Executive Director of NYU Courant’s Masters in . Preface

Brazil is not a simple country; one could say that for any other country, but Brazilians seem to utter this evocation with a quite peculiar sort of resignation, as if giving up hope that the country will ever change to become more standardized. Anyone who sees the electrical plugs mandated by law will understand that. And yet it is a fascinating country, where you could find double-digit interest rates and an investment grade (maybe not for long). The history and products of this financial market are quite unique, and we are glad to help the reader understand this corner of the world a bit better. This book will refer to other books that already explain concepts like managing option risks and stochastic calculus instead of repeating them, but once we delve into the details of the products we will provide the mathematical background and the heuristics for these, in a level somewhat beyond an undergraduate course. In fact, we used the draft of this book as the reference for a Masters’ course. Chapter 1 introduces the history of the markets over the past 20–30 years, and some definitions and concepts will be detailed later. In Chapter 2 we define the main fixings, for which the markets and curves described in Chapters 3 through 6, 9 and 15 will provide a framework for trading and hedging. Chapters 7 and 13 cover IR and FX options, respectively. Much more could have been written on FX options, but again we defer to other excellent books on this subject. The link between local fixings and offshore markets is discussed in Chapters 8 and 10; Chapter 11 covers the opposite case (onshore markets and offshore fixings). We briefly cover cash products in Chapter 14, mainly worried about market dynamics rather than trying to exhaust all possible cash instruments available. The microstructure of the Brazilian markets has been sadly underrepresented in the literature, and Chapter 16 is a brief introduction to our work in this subject. The (hopefully satisfied but still curious) reader should finish the book at Chapter 17 with the reminder that some of the rules, products and markets described in the book are subject to sudden and puzzling changes, and we swear that these are not our fault. In fact, they will provide us with an opportunity to publish further editions of the book, and we will be glad to receive any feed- back that might improve those future versions. The publisher’s website will help with that.

xx Acknowledgments

Richard thanks Dorival Leão for interesting discussions regarding financial topics and for asking him to be a lecturer on the new MECAI Master’s course in Brazil. He also thanks Stefan Andreev, an outstanding quant who has been very patient with Stefan since his first days at Morgan Stanley and a very good friend. A special thank you also goes to the triplet, Dolina, Nina and Ruby, who, rock his life like a free jazz trio. Dolina keeps the rhythm like a steady bass player, Nina is the sax player, with Coltrane-like improvisation, and Ruby is the hard hitting drum player. Last but not least, a big thank you goes to his tight, warm and small family nucleus: Mama, Baba, Bisna and Brígida [R.I.P.]. You are all great! Marcos thanks Emanuel Derman for, among other things, showing that most of quantitative finance is just a way to find the price of fruit salad, and for the encouragement and help with the decision to write this book. He also thanks Robert Almgren for the advice on learning Python, for pointing out Mathias Rosenbaum’s work on market microstructure and more useful advice. Special thanks to Kathya, Gabriel and Gustavo, for understanding the time spent away from family while at the same time making sure I kept the focus on writing the book, which could not have been written without Kathya’s energy and support.

xxi Disclaimer

The views represented are the authors’ own and do not necessarily represent the views of Morgan Stanley or its affiliates, and are not a product of Morgan Stanley Research. The information herein has been prepared solely for informational purposes and is not an offer to buy or sell or a solicitation of an offer to buy or sell any secu- rity or instrument or to participate in any trading strategy. Any such offer would be made only after a prospective participant had completed its own indepen- dent investigation of the securities, instruments or transactions and received all information it required to make its own investment decision, including, where applicable, a review of any offering, circular or memorandum describing such security or instrument, which would contain material information not contained herein and to which prospective participants are referred. No representation or warranty can be given with respect to the accuracy or completeness of the infor- mation herein, or that any future offer of securities, instruments or transactions will conform to the terms hereof. Morgan Stanley and its affiliates disclaim any and all liability relating to this information. Morgan Stanley, its affiliates and others associated with it may have positions in, and may effect transactions in, securities and instruments of issuers mentioned herein and may also perform or seek to perform investment banking services for the issuers of such securities and instruments. The information herein may contain general, summary discussions of certain tax, regulatory, accounting and/or legal issues relevant to the proposed transac- tion. Any such discussion is necessarily generic and may not be applicable to, or complete for, any particular recipient’s specific facts and circumstances. Morgan Stanley is not offering and does not purport to offer tax, regulatory, account- ing or legal advice and this information should not be relied upon as such. Prior to entering into any proposed transaction, recipients should determine, in consultation with their own legal, tax, regulatory and accounting advisors, the economic risks and merits, as well as the legal, tax, regulatory and accounting characteristics and consequences, of the transaction. Notwithstanding any other express or implied agreement, arrangement, or understanding to the contrary, Morgan Stanley and each recipient hereof are deemed to agree that both Morgan Stanley and such recipient (and their respec- tive employees, representatives, and other agents) may disclose to any and all persons, without limitation of any kind, the U.S. federal income tax treatment

xxii Disclaimer xxiii of the securities, instruments or transactions described herein and any fact relat- ing to the structure of the securities, instruments or transactions that may be relevant to understanding such tax treatment, and all materials of any kind (including opinions or other tax analyses) that are provided to such a person relating to such tax treatment and tax structure, except to the extent confiden- tiality is reasonably necessary to comply with securities laws (including, where applicable, confidentiality regarding the identity of an issuer of securities or its affiliates, agents and advisors). The projections or other estimates in these materials (if any), including esti- mates of returns or performance, are forward-looking statements based upon certain assumptions and are preliminary in nature. Any assumptions used in any such projection or estimate that were provided by a recipient are noted herein. Actual results are difficult to predict and may depend upon events outside the issuer’s or Morgan Stanley’s control. Actual events may differ from those assumed and changes to any assumptions may have a material impact on any projec- tions or estimates. Other events not taken into account may occur and may significantly affect the analysis. Certain assumptions may have been made for modeling purposes only to simplify the presentation and/or calculation of any projections or estimates, and Morgan Stanley does not represent that any such assumptions will reflect actual future events. Accordingly, there can be no assur- ance that estimated returns or projections will be realized or that actual returns or performance results will not be materially different than those estimated herein. Any such estimated returns and projections should be viewed as hypotheti- cal. Recipients should conduct their own analysis, using such assumptions as they deem appropriate, and should fully consider other available information in making a decision regarding these securities, instruments or transactions. Past performance is not necessarily indicative of future results. Price and availability are subject to change without notice. The offer or sale of securities, instruments or transactions may be restricted by law. Additionally, transfers of any such securities, instruments or transactions may be limited by law or the terms thereof. Unless specifically noted herein, neither Morgan Stanley nor any issuer of securities or instruments has taken or will take any action in any jurisdiction that would permit a public offering of securities or instruments, or possession or distribution of any offering material in relation thereto, in any country or jurisdiction where action for such purpose is required. Recipients are required to inform themselves of and comply with any legal or contractual restrictions on their purchase, holding, sale, of rights or performance of obligations under any transaction. Morgan Stanley does not undertake or have any responsibility to notify you of any changes to the attached information. With respect to any recipient in the U.K., the information herein has been issued by Morgan Stanley & Co. International Limited, regulated by the U.K. xxiv Disclaimer

Financial Services Authority. This communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK financial servises authority’s rules). Additional information is available upon request.