Slashdot Mirror


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."

32 of 161 comments (clear)

  1. Excel interface!?!? by fuzzyfuzzyfungus · · Score: 4, Funny

    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!

  2. Turns out BSD wasn't dying by Anonymous Coward · · Score: 5, Funny

    My 401k was.

    1. Re:Turns out BSD wasn't dying by stox · · Score: 2, Funny

      Heard on Wall Street:

      I lost half my money, but I still have my wife.

      --
      "To those who are overly cautious, everything is impossible. "
    2. Re:Turns out BSD wasn't dying by BarryJacobsen · · Score: 4, Funny

      Heard on Wall Street:

      I lost half my money, but I still have my wife.

      Scratch that...quarter of my money.

  3. Reason: Security by girlintraining · · Score: 3, Insightful

    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
    1. Re:Reason: Security by DragonWriter · · Score: 4, Insightful

      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?

      Yeah, because the main problem with Credit Default Swaps is that the pricing code used internally in banks wasn't distributed under an open source license, not (among other things) that the distribution of risk of default away from those making lending decisions encouraged those making the lending decisions to commit and encourage others to commit frauds which made the inputs into any pricing model unreliable.

  4. Pennies by A.+B3ttik · · Score: 2, Funny

    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...

    1. Re:Pennies by Fastball · · Score: 2, Funny

      Yeah, but if caught you could end up going to federal POUND ME IN THE ASS prison...with Bernie Madoff as your bunk mate.

  5. Grumble - "work" email address only by tqft · · Score: 3, Informative

    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
  6. Re:But... but... by Bob9113 · · Score: 5, Interesting

    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?

    Maybe you haven't been paying attention. For the past four months, all the CEOs of all the banks have been singing the praises of communism. They were so convincing, in fact, that the government handed them $350 billion with no strings attached (which they promptly spent on themselves, bonuses for their lackeys, and on buying distressed companies).

    The banks aren't any more anti-communism than Microsoft is. IE: They oppose it when it benefits others or non-executives, and support it when it keeps them and the rest of the American Aristocracy in beach houses and private jets.

    And in that, they are no different than anyone else, except the extreme rare few who strive for objectivity and reason. Extremely endangered are they, though - I believe there are three hundred sixty four known examples of such people in the wild, and but few of them have formed breeding pairs.

  7. Re:In theory... by Fastball · · Score: 2, Informative

    Well, there's the lap dances, rock concerts, and golf tournaments, but really, if no one cares about the pitfalls of 30:1 leverage, who cares about these puny details.

  8. Open does not make them any better by MazzThePianoman · · Score: 3, Interesting

    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
    1. Re:Open does not make them any better by 93+Escort+Wagon · · Score: 3, Insightful

      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.

      The lack of regulation surrounding CDS's is just nuts. As explained in that excellent TAL episode you linked to - the situation amounts to people gambling on the banks to fail, with "insurance policies" (what a CDS basically is) having been issued to the extent they amount to 10x the value of the assets being "insured". It's as if 9 other people bought fire insurance on your home, basically hoping for it to burn down.

      The whole situation is just absurd - and it's world-wide to boot.

      --
      #DeleteChrome
  9. Not a big deal by snax · · Score: 5, Informative

    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.

  10. QuantLib by gyroidben · · Score: 2, Informative

    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.

  11. Re:Oh noes, not Excel! by ianare · · Score: 3, Informative

    Everyone, without exception, uses excel in the banking world. A lot of backend stuff runs on OSS though. And the source code to the calculator is in C, and includes a Linux makefile.

  12. Eyeballed the source code by benjfowler · · Score: 3, Interesting

    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);

  13. Re:But... but... by radtea · · Score: 2, Insightful

    For the past four months, all the CEOs of all the banks have been singing the praises of communism.

    Actually, no: the parasites running American banks have been singing the praises of National Socialism, which is a political and economic doctrine that states certain industries or companies are so important to the wellbeing of the Reich... err... Homeland that they must not be allowed to fail even though they remain in private hands.

    Most of the American political class of both parties are also in favour of national socialism. So far it seems that most individual Americans are opposed to it, but have been so completely disenfranchised by the political class that they can't do much about it... yet.

    --
    Blasphemy is a human right. Blasphemophobia kills.
  14. well, the market also needs information (and time) by Trepidity · · Score: 2, Insightful

    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).

  15. Re:But... but... by anotherone · · Score: 2, Funny

    DONKEY.BAS was open source from the beginning.

    --
    Username taken, please choose another one.
  16. Re:I think I see the problem by Anonymous Coward · · Score: 2, Funny

    #include // This function converts a bad day to a good one (if it's in list).

    I believe I have found their list :

    std::string goodDayList = {"hookers", "cocaine", "bailout"};

  17. Re:This is the litte formula by xenocide2 · · Score: 3, Interesting

    Well, it's not the model that tanked AIG, it's that the contracts allowed AIG to write insurance with no capital reserves, because they were rated AAA. Of course, they're AAA because the have regular income from their insurance businesses, and access to capital markets, and were pretty damn big. This is stupid, because they went on to write as many contracts as big AAA rated company is allowed to.

    So many problems we have come down to credit ratings manipulation, that I'm ready to demand that they be shut down, and never relied upon. A credit rating is ephemeral and subject to violation of trusted 3rd parties; cash downpayments aren't.

    --
    I Browse at +4 Flamebait

    Open Source Sysadmin

  18. Re:But... but... by merreborn · · Score: 5, Insightful

    Maybe you haven't been paying attention. For the past four months, all the CEOs of all the banks have been singing the praises of communism. They were so convincing, in fact, that the government handed them $350 billion with no strings attached (which they promptly spent on themselves, bonuses for their lackeys, and on buying distressed companies).

    The banks aren't any more anti-communism than Microsoft is. IE: They oppose it when it benefits others or non-executives, and support it when it keeps them and the rest of the American Aristocracy in beach houses and private jets.

    No, we got a much worse deal than communism.

    Had this been a communist maneuver, "we the people" would now own these companies -- and that's something bank CEOs wouldn't stand for for one second. Instead, we got nothing in return for our money.

    No, bank CEOs will never support communism. A true communist revolution would strip them of their wealth and their companies

  19. Re:Something is weird with that domain by Timothy+Brownawell · · Score: 2, Informative

    Check the source code in HTML

    second url is listed as "http://www.cdsmodel.com./"

    remove the period/dot after "com"

    That's the entire point, the way DNS works all names actually end with a '.'. But because it's always there, it can be implicit. What probably happened is that somebody screwed up their domain-based virtual hosting somehow due to not understanding this.

  20. Re:But... but... by maxume · · Score: 3, Informative

    You are mistaken. The government received senior bonds in exchange for the money. Today, Citigroup asked the government to convert those bonds to equity, and the government now owns 36% of Citigroup (under the bond structure, Citi had to pay the government interest; apparently, that was a problem, so they converted them to equity; hopefully they got a reasonable price).

    It may end up that the government investment disappears, or it may turn a profit (I would guess that the government will recoup a significant percentage of the money), but it didn't disappear down some rabbit hole, it was in exchange for financial instruments obligating the banks to pay the government back.

    Starting a new bank with a clean balance sheet probably would have been more effective, but they choose to bail out people who had deposited funds at existing banks (that's almost everybody...).

    --
    Nerd rage is the funniest rage.
  21. government bailout != communism by jpate · · Score: 4, Informative

    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.

    1. Re:government bailout != communism by Anonymous Coward · · Score: 3, Funny

      Under communism, man exploits man. Under capitalism it's the other way round.

  22. If they had only done that sooner by Edmund+Blackadder · · Score: 2, Interesting

    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.

    1. Re:If they had only done that sooner by jonbryce · · Score: 2, Informative

      I suspect it isn't a problem with the computer code. It was a problem with the values fed into the program.

      I sometimes find myself having to value derivatives at work. I know what the formulae for working out the values are, but finding the right values to use in it is very difficult, and often very subjective.

  23. Communism != communism either by billstewart · · Score: 3, Insightful

    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
  24. What's the big deal? by richieb · · Score: 3, Informative
    Pricing a CDS is not that hard. See CDS. The papers that described the various methods have been widely publicized.

    ...richie

    --
    ...richie - It is a good day to code.