Industry Open-Sources Model For Infamous CDS
GlobalEcho writes "Credit default swaps (CDS) are infamous for bringing down AIG and requiring a bailout of hundreds of billions of dollars. Because the market for these was so murky, the US government has insisted that Wall Street create a clearinghouse for these contracts. In a fresh twist, part of the deal is that the models used to price CDS have been standardized, and that the pricing code was made open source, under a somewhat BSD-like license. The source code (originally written by JPMorgan) provides the basic pricing routines, plus an Excel interface. To my knowledge this is the first significant migration of an investment bank product platform from its usual super-secret proprietary home to the rest of the world."
Not sure if a direct link will work:
http://www.markit.com/information/cds-model/download/contentParagraphs/00/document/isda_cds_model_c_v1.7.zip
http://www.markit.com/information/cds-model/download/contentParagraphs/01/document/cds.xll (excel)
http://www.cdsmodel.com/
Microsoft has said that Open Source is communist and Anti-American! How can the business community survive, now that their broken algorithms have been published? We're doooooooomed!
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
Great ! Now we can all go bankrupt the open source way ! Isn't open source grand ?
I call upon my OSS brethren to join me in the working on the new fraudlib project and rebuild this package as a proper reusable library!
You shouldn't need super-secret proprietary Ultra Code in order to price an issue, it just requires a market and the means to discover a price. Of course, that doesn't help if you're selling the cash-stream leg of the derivative to yourself, so you need a very sophisticated process to discover how much a 3rd person would pay if you weren't self-dealing, which you might not be doing as much of if your issue was an actual item of intrinsic value, and not little more than a side bet you invented to mollify CDO investors...
Am I getting anything wrong here?
Don't blame me, I voted for Baltar.
My 401k was.
Maybe financial institutions are catching on to the idea that open source provides a far greater degree of security, accountability, and maintainability than closed source? Just a thought. Because part of the reason why this situation arose is because of black-box money transfers that didn't have any oversight, and were largely automated. This way, financial institutions can get a far better picture of risk exposure -- and know that everyone else is doing the transactions in the same fashion. In short, everybody knows the rules of the game and who the teams are, unlike before where the rules weren't known until a referee called a foul.
#fuckbeta #iamslashdot #dicemustdie
So if the Credit Transaction Software is Open Source... anyone can modify it, right?
Let's change it. I've got this idea regarding fractions of a penny...
as traditionally understood: everyone owns it
its more like open source, as in the government, our representatives, literally own the source
along with every other financial institution and all of their intellectual property since they all went belly up
(the term "intellectual" property as applied to the product of financial analysts being used very loosely)
intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
Tried to download the source from www.cdsmodel.com (where the TFA) points you.
Wants an email address
"I Accept
Please keep me Informed about changes to the Standard Model:
Email Address:
"
If you choose not to be informed it asks for an address anyway.
If you add an email address - I used a gmail address - it asks for a work address. emailsucks@jpmorganblows.com now has a copy of the source.
The Singularity is closer than you think
Quant
I think they got it backwards.
If I go to www.cdsmodel.com, it works fine. If I go to www.cdsmodel.com., which should be identical, I get to a completely different parked site. What the heck - this isn't supposed to happen. Then again, we're talking about the same people who use an Excel add-in within 5 miles of a billion dollar transaction, so go figure.
One of the largest financial firms in the world is using Excel instead of Calc to manipulate their financial data. Damn Microsoft and their market dominance. We wouldn't be in the situation we're in if they had been using OSS and Calc!
The 'for' loop below should use less than, not less-than-or-equal. That caused everybody to have a Very Bad Day.
*
* ISDA CDS Standard Model
*
* Copyright (C) 2009 International Swaps and Derivatives Association, Inc.
* Developed and supported in collaboration with Markit
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the ISDA CDS Standard Model Public License.
*/
#include "cerror.h" // This function converts a bad day to a good one (if it's in list).
#include "convert.h"
#include "bastypes.h"
#include "date_sup.h"
#include "cmemory.h"
#include "badday.h"
#include "macros.h"
#include
TDate JpmcdsBad2GoodBadDayList( /* (I) bad day list */ /* (I) bad date to convert */
TBadDayList *bdl,
TDate d)
{
int i;
if (bdl==NULL) /* allow NULL to ignore list */
{
return d;
}
for (i=0; icount; i++)
{
if (bdl->badDay[i]==d)
{
return bdl->goodDay[i];
}
}
return d;
}
CDSs, priced with open software or not, are the ticking time bomb of the world economy. Nothing better than bookie betting they have created an inflated payout of $50 trillion dollars worldwide that only takes the fall of a few big banks to start. I highly recommend listening this episode of "This American Life" which explains this situation and how it happened in terms just about anybody can understand. http://www.thislife.org/radio_episode.aspx?sched=1263
"They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety" Franklin
I downloaded the stuff (see down page) and I also just checked the Ac's links they are good
The Singularity is closer than you think
Quant
That got us in this mess. Using math for social problems might not always be the best way to do things. It's just bookmaking, that's all.
http://www.wired.com/techbiz/it/magazine/17-03/wp_quant?currentPage=3
I work in this area, and this isn't really that big of a deal, regardless of the spin they put in the announcement.
This is about publishing a reference implementation of an already widely published model so that when party A does a particular calculation, related to a settlement amount for a particular trade, and party B does the same calculation, the values match.
Qualitatively, and to a large extent quantitatively, everybody on the street has been using the same model all along. The idea of publishing a reference implementation is meant to minimize conflicts in settling trades.
The accuracy of the valuation model here is not at the heart of any of the problems that AIG -- or any other firm, for that matter -- have experienced. That's more aligned with a simple lack of oversight on exposure.
QuantLib is a nice open source quantitative finance framework. I think it's mainly written by academics rather than the banks but it's presumably similar to what they use.
The "JP Morgan" model is used by most people to generate credit yield curves, and then prince single-name credit default swaps.
I've worked on credit pricing code in my day job. So I was very curious to take a look at the source code, if only to see how the big boys code. I haven't gotten around to looking at the numbers it generates yet, but it's nice to know I can check my code against the standard implementation if I need to.
A peek at the source code is quite interesting. I've just had a chat with one of the finance wonks at work, and he reckons that much of the source comes from a library called ALib (which is a cheap, if somewhat proprietary financial analytics library), and they've just gone and renamed identifiers all over the source code -- you can tell where, because they haven't reindented the right hand side of the source code comments where they've made the changes....
I've been told that some banks are famous for writing rubbish code, but this looks like a pretty respectable effort. I could follow the example and library code fairly easily, which makes a refreshing change from my day job. Although they've got this really weird idiom with GOTOs all over the place, which in my years of C, have not managed to come across. I've been assured, however, that the original coders knew what they were doing.
From cds.c:
if (fl == NULL)
goto done;
if (JpmcdsFeeLegPV (fl, today, stepinDate, valueDate, discCurve, spreadCurve, cleanPrice, pv) != SUCCESS)
goto done;
status = SUCCESS;
done:
if (status != SUCCESS)
JpmcdsErrMsgFailure (routine);
What is a potential purchaser going to want to know before deciding how much to offer for a security? Well, something about its characteristics. If it's a derivative of other securities, they might want to know how its value relates to the values of underlying securities.
You first need to know the qualitative information of course: how does a change in the underlying securities result in a change in its price? What additional risk components (such as counterparty risk) does it have? Etc. Then the potential purchaser might want to a way to estimate how much they ought to pay for the derivative given some numbers for the values they place on risk, the inflation they expect, etc. That's what pricing models are. Unless you can actually work through all these interrelations in your head, you need some sort of model to even figure out what a reasonable offer for the security is.
Now maybe markets could also discover this through trial and error. Securities are valued in one way, and it turns out (as it recently did) that they were actually overvalued, because they failed to sufficiently factor in a significant component of risk. Refine for the next iteration. But this also requires infinite time to get it right, or at the very least a few major business cycles (i.e. decades). In this case, I'm not actually sure the market discovered a flaw in the previous pricing model per se, but rather in the parameters people were commonly plugging in: models generally have terms for estimates of underlying default rates, counterparty default rates, etc. and they were all massively underestimated (by the market).
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
Bah. CDS == Misapplication of Kalman Filtering.
Sumanth Peddamatham @ bafoontecha.com: Theory meets application.
for those who don't want to RTFA: http://www.cdsmodel.com/
"I am Dr. Freud, but you may call me.siggy."
... the government handed them $350 billion with no strings attached (which they promptly spent on ... buying distressed companies).
It's not clear that the "buying distressed companies" part is being done with bailout money.
As part of the same legislation, the government changed the tax rules. Now if a successful bank buys a failing bank it can use all of the losses of the failing bank to offset its profits for computing taxes. (IMHO that always should have been the case and the previous regulations to the contrary were an arbitrary distortion of the market.)
The failing banks' stock prices were so depressed that non-failing banks could buy them outright for less than the tax reduction of the merged company versus the original successful bank. So there was no issue with trying to evaluate the quality of the bank's assets (especially the mortgages). Any value at all was added profit. If the tax savings plus the residual asset value is greater than the cost of the merger there's no bailout money spent (though it might have been borrowed from other uses until tax settlement time).
Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
Please, try NOT to emulate the senile economist and former presidential contender John McCain.
If Wall Street were run LIKE a casino, they WOULD NOT
lose money.
For bookmakers to profit, they must be fully hedged by trying to balance betting on both sides of a wager. This is done with the "spread".
Yours In Communism,
Kilgore Trout
Legitimization of the CDS market is absolutely not a solution. As it is now, it is nothing more than fraud. But even with a clearing house, it is little more than unregulated insurance. Any bank or company stupid enough to have participated in it should have been sent to bankruptcy.
The same goes for the stock market, by the way. You idiots complaining that your 401k's have tanked, because your government encouraged you to invest in a derivative market of which 90% of people are completely ignorant, get what you deserve. We would all be better off if you invested in something more tangible.
That's right, I said stocks were derivatives. The value of a stock is dependent upon the first order derivative, or rate of change, of a company's assets. You are not buying a part of a company. You are betting that it's sales will go up.
"I assumed blithely that there were no elves out there in the darkness"
For those who don't have time to read all the code...
This is an important point that people don't seem to understand, probably because Marxist theory is not really taught except in specialist university level classes.
Here's the basic idea. Under Capitalism, business owners make a profit by paying their workers less than their labor is worth (so all profit is exploitation), and the business owners are able to do this because racism &c. divides the workers. Eventually, the exploitation of workers gets so bad that they develop a class consciousness on the basis of their economic status that trumps racial &c. divides, and they (forcefully) take power from the business owners. The final stage of Marxist communism is really a form of anarchy, where the means of production are owned by workers in a distributed fashion.
Agree with Communism or not, at least keep in mind that any top-down government aid paid for by workers to huge corporations is basically the opposite of Communism.
The US Treasury Department's "TARP" economic recovery plan revolves around pricing and buying these so-called "toxic" assets. Presumably they need to create a market for them in order to price them. There can't be a market if no one knows how to price them. Hence -- JPMorgan releases their "super-secret" code. It would be interesting to compare JPMorgan's price model to Quantlib. (http://quantlib.org). I suspect that JPMorgan would be trying to inflate the price that they get for their CDSs !
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
Microsoft's real problem with Open Source is the language it's written in; if you translate it into a language they like better, they're not as concerned with the actual license. So here's a MS-friendly version of the code:
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
CDS pricing is now a matter of Federal law, and will surely be evaluated with this software as the legal rules for enforcing pricing.
I hope this event marks a watershed in our progress towards making all truly formulaic and deterministic laws, or those portions of any laws, validated compilable software. The laws should specify the software's policies, against which claims of bugs should be argued. But the actual execution of the software should let anyone who wants anticipate how a court would rule that part of the law should be applied.
Too much lawyering and weasel words make too many badly written laws merely risks for the public. Even though the software will have bugs, the "bugs" in many current laws are much worse, and much harder to prove in any conclusive way.
--
make install -not war
Sweden had a smaller version of a banking crisis a few years back (90s, I think, or maybe early 00s.) They gave the banks more capital by having them issue stock which the government bought; it diluted the original shareholders' stock, and the government could have theoretically run the bank operations as a big stockholder, but once the banks recovered the government made a profit on the deal so the taxpayers actually got something back. I think it was around the timeframe that I was bumming around Scandinavia on vacation, and the Swedish currency was worth about 2/3 of what the Norwegian and Danish currencies were, but they got over it.
As to whether stocks or bonds in a distressed company are worth more, that's hard to say - both can lose pretty badly. And then there's the car companies - when they were asking for a bailout, the amount they wanted was something like 10x the market cap of all of GM's stock.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
This is a really good idea. Not because this code is any good. In fact it is quite obvious that whatever code Wall Street used to price CDS did not quite work, as AIG (who I am sure used a Wall Street bank for advice) was not able to correctly price these. So this is a classic situation of someone opensourcing code that is known to be useless, in order to get some good will out of it.
But if the code is open sourced, at least people will be able to analyze it and know how worthless it is. So when somebody wants to buy shares in a bank or an insurance company, he/she can look at the code used to price that company's assets and liablities and will know how much to trust the company's books.
There was a story a couple of months ago that some people examined the computer code that rating agencies used to rate mortgage backed securities. They asked the rating agency to plug in the code a slight decrease in home prices to see what prediction the code makes. The rating agency said that that would be impossible because the code was written under the assumption that housing prices never fall!!!
Unsurprisingly all major rating agencies rated most mortgage backed securities AAA right before the market crashed, and thus fucked over shitloads of investors that were stupid enough to believe them.
Now if an investor had access to the code, they might know that the rating agencies are full of shit and not trust their ratings.
http://quantlib.org/index.shtml is useful.
Why is it any more appropriate to define communism by what Soviet bloc countries did than by what China does?
Hey, don't you remember that "spam" has replaced "libertarians vs. socialists" as the default Internet discussion topic for the last decade? :-)
Marxism-Leninism doesn't actually work that way - the workers may get oppressed under capitalism, but they don't get around to developing the class consciousness that they're supposed to, so the elitist vanguard has to lead them in a revolution and stomp out the bourgeois classes. Since Marxism fails to recognize the value of creativity and risk-taking that entrepreneurs provide, that work doesn't get done after the revolution, so the economy recovers very slowly if at all from the damage done in the revolution, with idealist dogmatism as a poor replacement for the information provided by prices in a market, and the elites end up becoming the new class of bosses, not even the same as the old bosses, and the final stage of Marxist-Leninist communism is a chaotic transition to something like less competent capitalism.
Back in the early 90s, I was at economic conferences in Eastern Europe, and one of the fundamental issues that those societies were trying to solve was how to give the means of production to the workers before the ex-Communist bosses stole all the good stuff; in some cases the former state companies gave stock to the workers, but that didn't happen all that often, and usually only on businesses that weren't worth stealing.
On the other hand, the current top-down government aid paid to huge corporations is not only not either theoretical or real Communism, it's a great reminder that Ayn Rand's morally pure capitalists were more of a fictional device than a description of real capitalism. I don't think I agree with your assertion that the aid is getting paid for by "workers" - after all, we're taxing the "rich", and have been taxing businesses all along, and the bailout money's mostly getting borrowed, either from China or from Westerners who still have assets to invest in T-bills. Some of it will get paid back by your kids, and some of it will get defaulted on somehow, either by finding a way to restart inflation (which is a lot tougher in today's global economy than it was when Reagan did it) or by some new scam.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
This does not look at all like a BSD like license. IANAL.
BSD says nothing about Licensing Derivative Work (2), Revision of License (7), Termination of License (9), or Patents (10), and many more.
it would be interesting to see if the Open Source Initiative would accept this as an open license. In any case it is more license proliferation.
Busy helping non technical users of OpenOffice.org - http://plan-b-for-openoffice.org/
Because the Soviet Union was closer to Marx and Engel's model, by far, than China currently is.
...richie - It is a good day to code.
That spreadsheet has the equation that caused our economic downfall that was shown in Wired Magazine and in NPR Marketplace radio show.
Recipe for Disaster: The Formula That Killed Wall Street
http://www.wired.com/techbiz/it/magazine/17-03/wp_quant
Did math formula cause financial crisis?
http://marketplace.publicradio.org/display/web/2009/02/24/pm_stock_formula_q/
Marketcetera recently saw a 1.0 release, and is currently deployed in over 20 financial institute production deployments according to their confluence page. It uses the open and standard FIX financial data protocol, and personally its one of the coolest things I have ever seen. I would love to get a team of coders and quant. analysts together, hook Marketcetera up to a FIX compatible provider like Penson or Lime Brokerage (yes, same people as Limewire), and start a blackbox fund. You could rival any major financial institute for almost no start up costs. Truly amazing.
Moderation Totals: Flamebait=2, Troll=1, Redundant=1, Insightful=6, Overrated=1, Underrated=1, Total=12. (not mine)
That "goto done" thing is used to ensure that cleanup code always runs. (deals with mutexes, semaphores, freeing memory, etc.)
Once you get used to it, it's way more readable than the alternatives. The alternatives typically involve lots of indentation and/or lots of extra booleans that need to get tested all over the place.
Also, it tends to produce fast code.
Now that its Open Source, credit default swaps will be a profit machine!!
Here is an article about how executive compensation and the little formula got us into so much trouble:
http://www.ft.com/cms/s/0/fa89be08-02aa-11de-b58b-000077b07658.html?nclick_check=1
This code is useless now. Doesn't anyone remember what happened when someone had a "sure fire" formula for the foreign currency exchange market? Worked great until Russia defaulted .... then it crashed the whole market.
There is no magic formula. Repeat after me ... there is no magic formula. Something might work for a while but if its not backed up with real world facts you're skating on thin ice.
The 'correct' price can only be determined in hindsight.
The price a buyer and seller agree upon is the market price. Markets aren't that simple though, other players trading at the same time will settle at different prices (market spread).
Only in hindsight do you have a chance of determining what the 'correct' price was. It's not always going to be the average market price.
Markets are are best pricing mechanism where there is liquidity and transparency. Absent that it's a crap shoot.
John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
The rumor spread through the city like wildfire (which had quite often spread through Ankh-Morpork since its citizens had learned the words fire insurance
Wall Street technology is not that closed as you think it is.
It is the ultimate in competition.
Any new idea lasts a few days (like Portfolio Insurance) before a joker err.. banker leaves his organisation to join another next door at a substantial pay raise.
He takes the ideas with him and the new company builds the new system. Simple.
No new investment or techno innovation idea stays with same owner for longer than a few months max.
Initially draconian contracts were written in 1970s but they soon realized that the ex-bankers had enough high-powered lawyers to bulldoze the contracts easily. Add to that the new employer's lawyers, and pretty soon the bankers realized not to stop such "borrowing of ideas".
CDS originated the same way: the dumbshit of Maths PhDs who thought that Hedge funds would enable them to ride out systemtic problems easily.
I was in retail-banking for a long time: never ventured into investment as it was too fast-paced for me.
I left it to join IT when i realized that bankers will never understand complexities of software development and software guys will never realize that "good enough code" is not enough when it comes to compliance or meeting SEC deadlines for reports.
"Doing what i can, with what i have." ~ Burt Gummer
Your lap dances link goes to Rocky Mountain News. Did you know yesterday was their last day in print, a couple months short of 150 years in print? (FWIW the link still works, for now.) Back in the 80s I went to school in the area and remember them as the state edition most subscribed. I hadn't thought of them in years until yesterday, but it's still sad to know they are gone.
The name and news archives remain "for sale". The paper didn't convert fast enough to electronic, I suppose. They had an electronic edition as most do now, and I suppose it's possible someone will buy the name and take it online-only, but it would appear to have been too little, too late. Now it's only the Denver Post.
Fittingly given where people are getting their news now, I read it on MSNBC.
http://www.msnbc.msn.com/id/29412240/
Here's the Google on the RMN, with the top stories now on their closure:
http://www.google.com/search?lr=lang_en&hl=en&q=%22rocky+mountain+news%22
Duncan
"Every nonfree program has a lord, a master,
and if you use the program, he is your master."
R Stallman
The industry standard was the JPM model on bloomberg page cdsw. If you didnt have bloomberg, that was a pain but almost everybody in the industry has access to bloomberg. It's also pretty easy to code up yourself. It is based on the standard Hull White model found in any text book.
I'm guessing this is FRAUD. They are trying to get people to accept what they are doing, not actually doing something positive for the taxpayer in a general sense.
The financial problems were and are DELIBERATE. The financial problems we have now are caused by institutions not knowing whether they can trust each other. They can't trust each other because they don't know how much debt each other has. They don't know that because nothing the government has done has made disclosure necessary. The U.S. government, which is VERY corrupt, is delaying making disclosure necessary while the banks see how much they can steal from the taxpayers in government help.
Open source software is nice, but it doesn't make the financial condition known. It's just software. The only thing that would help is better laws. There is no evidence that the corruption will stop.
The financial problems started at the beginning of the George W. Bush administration, when Senator Gramm and others "deregulated" financial institutions by allowing them to have huge debts without corresponding assets. This made it possible for institutions to steal money, as they did. It was all completely deliberate theft, and Warren Buffett was talking about it in 2002, calling CDRs and other financial arrangements "financial weapons of mass destruction". Do a Google search.
The financial crisis was deliberate theft, deliberately planned. It's just ONE aspect of the widespread corruption in the U.S. government.
The VaR risk management technique was open sourced at inception, which is partly why it's so widely used.
What workers labour is worth is determined by the markets, not by a conspiracy of business owners.
Of course in a political system where workers have no rights the employers can actually act like cartels and impose a general level of salaries, but even then what helps them is that skilled people can become a dime a dozen (something IT workers should have learned already, but that they blissfully forget as soon as India and outsourcing hit the front page of this veritable website).
IANAL but write like a drunk one.
The model of open source can play a very constructive role here. By releasing the models used to price CDS, the markets for these instruments take an important step towards greater transparency. The public vetting of this code (by academics, financial experts, regulators, etc, ...) will surely lead to more stable markets in the future. Well done!
I agree with you 100% but that's how the ones in charge want it to work, unfortunately unlike real bookmakers, they don't have access to all of the variables involved and never will unless we change the rules of the game.
--If Wall Street were run LIKE a casino, they WOULD NOT
lose money.--
Isn't that too bad that the Mafia could probably do a better job than the ones in charge of the decision making as of now. Investing money is gambling that's not supposed to favor the house but the investor. The odds of winning in Vegas is probably higher than winning in Wall Street right now. You can look at all the graphs and formulas you want, but I would like to see even one that can predict the future with any certainty.