SpringOne Platform 2016: Wall St. Derivative Risk Solutions Using Apache Geode

Speaker: Andre Langevin, CIBC
Speaker: Mike Stolz, Pivotal
White Paper: http://pivotal.io/building-wall-street-risk-applications
Geode: http://geode.incubator.apache.org

GemFire is the commercial offering of Geode

Design

  • Input: Trades
  • Input: Market Data
  • Output: Risk
  • Where the Magic Happens: Risk Calculations
  • Geode is the backbone infrastructure

A Crash Course in Wall Street

  • Big Wall Street firms have “FICC” trading business organized by market
    • Each business will trade “cash” and derivative products, but traders specialize in one or the other
    • There may be a team of traders working to trade a single product
  • Trading systems are product specific and often highly specialized
  • Managing these businesses requires a consolidated view of risk

Calculating Risk

  • What is the “risk” that we are trying to measure?
  • Markets are represented using curves
  • Consistency is paramount

Technology Solutions that Work Badly

  • The easiest thing to do is just book all your trades using one trading system
  • How about booking all of the hedges into the primary trading system?
  • How about adding up all of the risk from each trading system into a report

Designing and Naming Data Objects

  • The trade data model serves 2 distinct purposes
  • Market data should follow the calculation design
  • Use “dot” notation to give business-friendly keys to object (i.e., USD.LIBOR.3M)

Region Design

  • Trade and market data regions
  • Typically a curve embeds a list for rates — leave it denormalized if rates are updated slowly
  • Computational results and aggregation
  • Regions: Rates, Trades, Curves, Built Curves, FX, Trade Risk, Risks, Agg

Placing Regions on the Cluster

  • Region placement optimizes the solution’s performance
  • Partition the trades regions to balance the cluster
  • Partition or replicate market data to optimize computations

PDX Integration Glue

  • PDX serialization is an effective cross-language bridge
  • Structure PDX objects to optimize performance
  • JSON is a good message format

Getting Trade Data into Geode

  • Message formats vary by product type
  • Broker messages in an application server
  • Trade data capture is transactional: Best practive is to make end-to-end process a transaction, but may need to split into two legs based on source of messages

Getting Market Data into Geode

  • Market data feeds have many proprietary formats
  • Market data is often exceptionally fast moving
  • Market data can also be very slow moving: i.e., LIBOR
  • Conflate fast market data by sampling
  • Gate market data into batches

Crunching Numbers on a Shared Grid

  • Most trading firms have a proprietary math library
  • Pushing Geode events to an external compute grid: Asynchronous Event Queue (AEQ)
  • Caching locally on the grid to accelerate performance: Wildcards on keys

Crunching Numbers Inside Geode

  • Running the math inside Geode is dramatically faster
  • Using the Geode grid as a compute grid
  • Using cache listeners to propagate valuation events

Ticking Risk Views

  • Roll-your-own client applications to view ticking risk
  • Integrating packaged products: ION Enterprise Risk, Armanta Theatre, Active Pivot…
  • The Traders always want spreadsheets: Write an Excel plug-in

Covering a Short != Selling a Long

I spent most of the day yesterday listening to the Goldman Sachs testimony.  Since I missed a few hours, I decided to revisit those parts I missed earlier today at the C-Span archives.   I found it quite interesting how the Goldman Sachs traders spun their tales to deceive the Subcommittee.   In particular, they often mentioned that their goal throughout 2006 and 2007 was to reduce risk.  Yeah, fair enough.  I’ve got to imagine with all the volatility in the market at the time, the middle and back office would have pushed pretty hard to reduce the risk.

One interesting thing I thought I’d dig into deeper is the difference between selling a long position and covering a short position.  The witnesses often repeated the mantra that not only did they reduce their risk by selling their long position but they often also reduced their risk by covering their short position.

Well, yes.   But not all risk is created equal, now, is it?

Between 2006 and 2008, to cover your short positions in the market basically meant you were “locking in” your profits.  That’s because the mortgage backed security market was basically in freefall.   By locking in your profits, you may indeed be reducing risk; risk that your counterparty (cough… Bear Stearns… cough) will not be around to pay you tomorrow.   Either way, when you cover your shorts, you realize some amount of profit and reduce the company’s overall counterparty risk.

Selling your long positions between 2006 and 2008, however, was a whole different ballgame.   In fact, I’d venture to guess that Goldman Sachs did very little of that because by the time they wanted to sell, there were probably no more buyers and therefore no market liquidity.   They had no easy way to sell their longs since the buyer might have only been willing to pay pennies on the dollar.   Instead, Goldman Sachs most probably offset these losses by taking opposite short positions.   If they indeed made such spectacular profits in 2007, they must have indeed done the Big Short by several orders of magnitude more than their long positions.   In any case, your aim in selling your longs is to minimize your market risk.

It’s interesting that the Goldman Sachs witnesses would combine market risk and counterparty risk and just call it risk in order to say their aim was to “minimize” risk and not go directional.   Nice rhetoric guys.