Financial Python

Studies in Finance and Python

Archive for March 2009

AIG Fuels Bank Profits

leave a comment »

Tyler Durden at Zero Hedge publishes a provocative post regarding bank profitability and AIG CDS payouts. In some ways, this should not be a surprise. As described in my previous Soros post, AIG was long lots of credit risk by selling protection to banks. Given how far credit has deteriorated, banks SHOULD be deeply in-the-money on those contracts. Indeed, these contracts are precisely why AIG has been bailed out multiple times by the government. So as these contracts get unwound, a significant amount of P&L should be flowing to the banks.

Nevertheless, Tyler always offers an interesting opinion, so have a look.

Written by DK

March 30, 2009 at 10:56 pm

Posted in Finance

Tagged with , ,

Fixed Coupon CDS is the same as CDX

leave a comment »

Everyone is quoting A Credit Trader these days! Felix Salmon of Portfolio (soon moving to Reuters), attempts to communicate the bottom-line of ACT’s post on the duration risk of CDS. Felix usually does a fantastic job with credit derivatives, but I thought a little helping hand might be useful on this coupon issue. If you understand how the CDX index is quoted, you already understand the fixed coupon, since it’s basically the same idea. The fixed coupon mechanism simply takes standardization a step further.

For example, the CDX index trades at a spread determined by the market, but also features a fixed coupon, or strike. This coupon is set at the beginning of each series (so the IG12 coupon was set when it was launched as the new on-the-run index). I don’t know what the new coupon is at the moment, but let’s say the coupon is set at 250 bps, and the index is trading at 250bps as well. In this case, the index is essentially trading at par since the market spread equals the coupon. Now, let’s assume the index widens to 300 bps and you want to buy protection at this level. There’s obviously a mismatch: the market wants 300 bps but the contract only demands 250 bps. What do you do? You make a small upfront payment to the dealer to clean up the mismatch (basically the present value of the difference between 300 bp and 250 bp payments). Trading upfront eliminates fiddling with duration assumptions and makes the transaction “cleaner.” This can be troublesome when trading the synthetic tranches as well, and there have been proposals to make similar changes to tranche quotes.

The “clean-up” upfront payment can get large when spreads widen a lot, thus introducing a technical slowdown in short trading since a large difference between the coupon and the market spread can make for expensive shorts. The opposite, of course, is also possible. If the index is trading tighter than the coupon, the dealer needs to pay you an upfront payment when you buy protection.

The big bang fixed coupon described by A Credit Trader and Felix follows the same logic as the index, but with standard 100bp/500bp coupons. If you are trading CDS with a 100bp coupon, you could say the CDS is trading at par when the market spread is 100bp (or trading at a discount when the market spread > 100 bp coupon). As a result, the CDS contract has become more bond-like.

See? Easy peasy.

Update: It occurs to me you can see this in action in a previous post. The CDSW screenshot shows IG11 trading at 237bps, with a coupon of 150bps. Looking at the numbers to the left of the green circle, you can see that the CDX is trading at a discount (~96) and that you need to pay ~$300k upfront to clean up the mismatch

Written by DK

March 30, 2009 at 10:32 pm

Posted in Finance

Tagged with , , , ,

Soros Doesn't Understand CDS

leave a comment »

A friend of mine once pointed out to me, years ago, that Warren Buffet was an investor in Dairy Queen. I replied, “Warren may know a lot about stocks, but he doesn’t know $#% about food!”

As the man who broke the pound, multi-billionaire George Soros obviously has nothing to fear from me. His editorial on the WSJ, however, makes it clear he doesn’t understand CDS.

A couple thoughts:

  • What about IRS? If George has problems with CDS, it seems he should be even more concerned with the interest rate swap market. I don’t know exactly how large it is, but I imagine it’s at least an order of magnitude larger than the credit default swap market.
  • Asymmetric Risks? George argues that asymmetric risk profiles promote the shorting of credit risk and speculation. Yet he ignores the fact that AIG got into trouble because it established massively LONG credit risk positions by selling protection during one of the tightest spread environments in history. How then, could one argue that “CDS [was] outrageously overpriced?” Anyone who has done even the most cursory research on CDS understands that the investor is long credit risk when selling protection. That’s why they are called synthetics. You can synthesize/approximate a long bond postion by buying Treasuries and selling credit protection. Furthermore, AIG sold protection on structured products/tranches, not individual corporate names (directly, at least). Single name CDS is governed by standard ISDA agreements and collateral requirements.

I place the blame for AIGs predicament squarely on the executives involved, risk management, and the senior management of the firm. Clearly, those directly responsible were gaming the system and AIG’s rating. Nevertheless, risk management, accountants, and senior management didn’t have to know anything about correlation or complicated structures to recognize AIG was long billions of dollars of unhedged credit risk. That’s what’s most infuriating to me.

It’s also infuriating that some people equate CDS contracts with irresponsible casino gambling because you don’t own the underlying asset. Let’s make this clear: If you own an ETF, trade equity options, or even buy coupons online, you are dealing with derivatives!Even ‘complicated’ index tranches can be described as call spreads on porfolio loss (see the previous post on Delta and Mark To Market).

Written by DK

March 26, 2009 at 10:34 pm

Posted in Finance

Tagged with , ,

Delta, Synthetic Tranches, and Mark to Market

with one comment

A Credit Trader recently posted a very nice exposition of AIGs mistakes in the credit default swap arena. Describing a meeting with AIG at the beginning of the post, he says:

Though mostly unmemorable, there was one moment in the meeting that I will never forget. As the marketing guys were pitching mezz tranches to the PM, I threw in a comment that if credit spreads were to widen the delta of the tranche would go up thus increasing the mark-to-market (MTM) sensitivity, and thus net credit exposure, of the trade. This the PM calmly brushed aside responding “we are not MTM sensitive” as he reached for another piece of fruit.

He goes on to discuss correlation of the underlying assets in CDOs and AIGs inability to appreciate the mark-to-market nature of synthetics. One thing he doesn’t explain, however, is the basic concept of mezzanine tranche deltas increasing as spreads widen. The relationship between tranche deltas and spreads isn’t well-understood (even among those in the credit derivative business), so here’s a shot at providing some intuition.

Expected Loss and Delta

Let’s use the standard IG11 index tranches as an example (though they were never really liquid, but whatever). The IG11 index is based on a portfolio of 125 investment grade credits. The spread of the 5Y index, currently around 237bps, reflects the market’s view of default probability, liquidity, etc. For argument’s sake, let’s just focus on implied default probability. Assuming some recovery rate, we can use the spread and a measure called SDV01 (dollar value of a basis point) to calculate an expected loss (EL) for the portfolio. EL just refers to the amount of money the market expects to lose given current spreads. As the screenshot shows, the SDV01 (circled in green) is about $4035. 237bps x $4035 gives us an expected loss of about $956,295 out of a notional of $10M, or 9.56%. Tuck this number away for later.

Technically speaking, SDV01s decrease as spreads increase, but the important thing to note is expected loss increases as spreads increase. Makes sense, right? Your expected loss should increase if you believe there’s a higher chance of default. Taking it to the extreme, if we assume an aggregate recovery of 40% for the portfolio (just roll with it), the maximum loss is 60%, even if every company in the index defaults.

An index tranche is defined by its attachment and detachment points. The equity tranche covers the first 0-3% of loss, the junior mezz 3-7% of loss, etc. The delta of a tranche describes the leverage of a tranche relative to the underlying portfolio. So if a given tranche has a delta of 3x, a one dollar swing in the underlying portfolio should result in a roughly $3 dollar swing in the value of the tranche.

Now, remember that index expected loss of 9.56% we calculated? You can map this to the attachment and detachment points of each index tranche. Without seeing any runs, we can guess that the 7-10% tranche probably has the highest delta (or close to it). Why? You could call it the “at-the-money tranche” since, intuitively speaking, the value of the 7-10% tranche is most sensitive to spread movements from current levels. Another way to look at it – index spreads are implying that the equity tranche will get wiped out (9.56% > 0-3%). As such, the equity tranche delta should be low as it is pretty much saturated in terms of loss.

If you look back at equity tranche deltas when spreads were low (sub-100bps), you’ll find that the equity tranche actually exhibited the highest delta of all the tranches (in the high teens). This high delta reflects the low level of expected loss implied by the index (<3%). I’m ignoring the impact of correlation right now, but basically all the loss was in the equity tranche. Thus, any change in expected loss would have the greatest impact on the equity tranche.

And that’s why mezz tranches gain sensitivity as spreads widen a lot. The junior-most tranches lose delta as they get saturated with loss while the “at-the-money” tranches gain delta since they are now the “new” first loss slices.

Written by DK

March 17, 2009 at 10:36 pm

Posted in Finance

Tagged with , , , , , ,

Using Google Apps Python Provisioning API

leave a comment »

I’ve gotten my church staff to use Google Apps for email and collaboration (sort of). Unfortunately, the Google Apps admin web tool is a bit inflexible (though it’s improving). In an effort to get more control over the data, I put together a little script that pulls all the users, distribution list names, and distribution list constituents into a google spreadsheet. The program uses two nice python libraries, xlrd and xlwt, to read and write to intermediary excel files since it’s not possible to directly create google spreadsheets (the workaround I used is to upload an xls file).

The documentation for xlrd is quite good. The documentation for Google’s Python Provisioning API is ok, but not particularly well organized. For example, I was trying to figure out the attributes for the different XML feed objects and was told no documentation existed (by a Google employee, no less). After hours of trial and error, I found the PrintFeed function below in a separate piece of Google documentation that made it clear it was possible to use a generic attribute. I accept the possibility I was being a idiot. Anyway, the documentation for xlwt is not good, but the code below should give you a decent start and a few fruitful search terms.

The script basically makes a spreadsheet with a summary tab that lists the name of each distribution list and the number of members in each list. It also creates a tab for each distribution list containing the email addresses of the list. Pretty basic, but handy if people (that aren’t admins) need to know what email lists are available (and their constituents).

I’m sure there are better ways to code this, but what the heck, it worked for me. But I make no guarantees! (UPDATE, see post with updated code.)

Written by DK

March 11, 2009 at 10:39 pm

Posted in Python

Tagged with ,