SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Groovy Finance:

     Grid Computing
and Computational Finance


          Jonathan Felch
         DASEL Software
jonathan.felch@daselsoftware.com
Agenda
−   Introduction: Speaker and Project
−   Motivations for Groovy in Quantitative Finance
        Business Problem
        Math / Data / Business / Languages
        Questions Regarding Groovy Performance

−   Data Grid and Dynamic Programming
        Master / Worker Model, MapReduce, and ForkJoin
        Property Listeners, Dependency Graphs, Invalidation

−   Grails: Exposing the cache to the world

−   Revolution: Distributed Computing and DSLs
Introduction

   Jonathan Felch

    −   NASDAQ Software Architect 1997-99
    −   Lehman Brothers Global e-Commerce Architect 1999-2000
    −   Venture Capital Associate @ GS / BCG JV 2000-2001
    −   Quantitative Systems @ Syntax Capital 2005-2006
    −   VP Quantitative Systems @ Credit Suisse 2006-2009
    −   Independent Work in Financial DSLs / Data Grids 2009+
Groovy Finance: A Case Study

   Started at Syntax Capital Management in 2005
    −   Capital Structure Arbitrage
    −   Almost Every Asset Class
    −   Focus on Credit Markets, Macro and Single Name

   Matured at an Investment Bank 2007-2009
    −   Groovy To The Rescue
    −   Grails and Integration
    −   Meta-Programming and A Distributed Cache
    −   Unexpected Upside: A Quant Finance DSL
Groovy Finance: Architecture

   Industrial Strength Back-End In Java

   Enterprise Software Integration
    −   Data Acquisition Focus / Logical Focus
            SOAP, JMS, JDBC, CSV files, ZIP files, delimited files
            Bloomberg, Markit Partners, OPRA, Ivy, Barra, Imagine

    −   Data Delivery Solutions
            Excel Plug-In
            Reports in HTML, PDF, CSV, JSON, XML, JMS
            DSL Console with JSyntaxPane
Agenda
−   Introduction: Speaker and Project
−   Motivations for Groovy in Quantitative Finance
        Business Problem
        Math / Data / Business / Languages
        Questions Regarding Groovy Performance

−   Data Grid and Dynamic Programming

−   Grails: Exposing the cache to the world

−   Revolution: Distributed Computing and DSLs
What is Quant Finance ?

A quant designs and implements software and
mathematical models for the pricing of
derivatives, assessment of risk, or predicting
market movements
What's The Problem: The Math
   Quant Finance Models are Wrong
    −   Even The Best Models Fail, Failure Is Expensive

   Assumption of Quantitative Finance Are Wrong
    −   Market Are Social Phenomena, Not Random Walks

   Quant Finance Models Change
    −   In Bad Times, They Change A Lot

   Coding Almost everything in C++ takes forever

   Coding Everything Else in VBA doesn't scale
What's The Problem: The Market
   Market Structures Drive Financial Data
     −   Different Calendars, Different Measures
     −   Equities and Government Auctions are Transparent
             Also options, some bonds, some preferred

     −   Exotic and Credit Markets are Illiquid, No
         Transparency
             Some of products are not really 'securities'

   Identifiers are ridiculous, don't work, unclear
     −   ISIN, CUSIP, SEDOL, Tickers, ADRs, …
     −   Observation Dates and Effective Dates
What's The Problem: The Data

   Lots of Data, Lots of Math, Lots of Products
    −   Credit Market Subset
            1500 Companies / 2500 Curves / 10 Indices & Tranches
            10,000 Liquid Bonds / 2,000 Liquid Converts / 2,000 Loans
            1500 Liquid Equities / 169 point vol surface to start

    −   Derivatives and Quant strategies have many metrics
        for each time series observation
            Securities can't be compared on price
            Relative values metrics are complex and there are many
What's The Problem: The Traders
   Great Trades Come From Half-Baked Ideas
    −   Fully Baked Ideas Have Already Been Priced In

   Traders Do Not Know What They Want

   Whatever They Think They Want, They Wanted
    It Yesterday

   Whatever They Want Today, They Will Never
    Use Again
Languages of Quant Finance
   Commonly used languages of Quant Finance
    −   C++ (The Dominant Industrial Strength Language)
    −   VBA
    −   Matlab, SAS, STATA, S, and R
    −   C#
    −   Java (Most limited to Fixed Income and Web)

   Up and Coming / Research Languages of
    Interest to Quant Finance
    −   Fortress, Scala, Groovy, Python, F#, and Erlang
JEE / Groovy Components
Why Groovy ?
   Pith, Speedy Development Cycle
    −   Made for half baked idea

   Dynamic Programming
    −   Meta-Programming, DSL Support

   Java / JEE / Enterprise
    −   Massive Ecosystem, Performance Fall back

   Community
    −   Grails, Griffon, lots of small projects
Other Tools That Helped Out
   Google Collections and MapReduce

   VisualNumeric's JSML / UJMP / Weka

   Terracotta

   JSR 166 / Fork-Join

   R Language
Groovy Performance: Overview
   JIT and Operator Overloading
    −   Number Crunching and Monte Carlo
    −   GroovyMatrix

   Smart Programming
    −   Algorithms versus Language
    −   Grid Computing
    −   Caching

   'Thought Experiments' before production code
    −   Groovy 'gets the idea right' faster than C++
Performance I:
              Numeric Collections
   Only Re-calculate Values That Change
    −   Overloading operators in numeric collections allow
        numeric operations to only-recalculate variations
        in the dependency graph
    −   JIT / Optimizers will load partial expressions into
        CPU registered

   Closures as formulas
    −   Rather than using loops for executing an
        expression many times, the collections can be
        mixed with numeric values and constants in a
        single expression
Performance II: Monte Carlo
def path = { spot, rate, vol, time, draw →
  def drift = (rate – 0.5 * vol * vol) * time
  def diffusion = vol * Math.sqrt(time) * draw
  spot * Math.E ** (drift + diffusion)
}
def   euler = path.curry(100.0,0.05,0.15,1.0)
def   paths = euler(guassian)
def   guassian = GroovyMatrix.createGuassian(1000,1000)
def   strikePrices = [80, 90, 100, 110, 120]
def df = Math.exp(time * -interestRate)
def size = paths.size()
strikePrices.each { strike ->
   def callOption = df * paths.collect {
        Math.max(0,it - strike)
   }.sum() / size
    def putOption = df * paths.collect {
       Math.max(0,it - strike)
    }.sum() / size
    println “1 Yr ${strike} Strike Call = ${callOption}”
    println “1 Yr ${strike} Strike Put = ${putOption}”
}
Agenda
−   Introduction: Speaker and Project
−   Motivations for Groovy in Quantitative Finance
        Business Problem
        Math / Data / Business / Languages
        Project Background 2005-2007

−   Data Grid and Dynamic Programming
        Master / Worker Model, MapReduce, and ForkJoin
        Property Listeners, Dependency Graphs, Invalidation

−   Grails: Exposing the cache to the world

−   Revolution: Distributed Computing and DSLs
Databases versus Caching
   Traditional Model: Hibernate
    −   Data Model = Database plus Cache of POJOs
            All Objects of the name class share structure
            No (Persistent) Dynamic Properties on 1st class objects
            All first class objects (query-able) lived in the database


   Our Model: All POJOs → Tuples or Nodes
    −   Tuples of same class may 'grow' existing structure
    −   Tuples do not all have to come from data
            Questions about what does and does not belong in
             database
            Query Language = Gpath / Xpath + Hibernate
            Includes dynamic properties and calculated values
Distributed Cache and
            MetaProgramming I
   Terracotta for the shared memory and
    synchronization
    −   Integration point for Hibernate and Hibernate
        Cache
    −   Integration point for Groovy Data Adapters

   All First Class Objects are decomposed from
    Java or Groovy objects to a 'Tuple'
    −   Not perfectly named, but a simple data structure
        than implements Map and List
    −   Usable with XPATH
    −   Small Set of Primitives optimized for Terracotta
Distributed Cache and
            Meta-Programming II
   Everything is a Property
    −   Data and methods
    −   Behavior follows a mathematical model
    −   Property listeners manage invalidation

   Missing Methods / Missing Properties
    −   Widely used calculations and method results stored
        as property values so avoid redundant calculation
    −   Calculated values are never stored in the database
Distributed Cache and
           Meta Programming III
   Tuple Class
    −   Much like a Groovy Class
    −   Joins objects like associations / relations in
        Hibernate
    −   Defines raw types / names / converters
    −   Defines property finders / chained finders /
        methods

   Missing Methods / Missing Properties
    −   'Missing' Events Trigger Chainable Closures
    −   Missing Events invoker 'Finders' and 'Builders'
Distributed Cache and
           Meta Programming IV
   Do We Even Want A Database ??
    −   Sometimes Accessing Data Remotely Works Just
        As Well
    −   Sometimes Pulling Data from Flat Files On
        Demand works Just As Well
    −   Sometimes Calculating from Values from old inputs
        makes more sense than persisting it (normal forms)

   'Active' Cache As a Integration Space
    −   Miss in a cache request trigger a chain of closures
Agenda
−   Speaker and Project
−   Motivations for Groovy in Quantitative Finance
        Business Problem
        Math / Data / Business / Languages
        Questions Regarding Groovy Performance

−   Data Grid and Dynamic Programming
        Master / Worker Model, MapReduce, and ForkJoin
        Property Listeners, Dependency Graphs, Invalidation

−   Grails: Exposing the cache to the world

−   Revolution: Distributed Computing and DSLs
Grails As A Integration Hub
   Controller requests arrive via JSON, XML, JMS
    −   R Language Client: JSON → Grails
    −   Excel Client: JSON → Grails Over HTTP
    −   Excel RTD: JSON → Grails over JMS
    −   SwingX Table (Real-Time) JSON → Grails via JMS
    −   SwingX Table JSON → Grails via HTTP

   Affiliated Business Units:
    −   XML Web Services from dot Not
    −   Matlab dot Net
Cache Logic: Reporting
def r = builder.reportWith(Bond.class, ”bond.cdsBasis < 0”) {
   attr {
      expression = 'bond.ticker'
      name = 'Ticker'
   }
   attr {
      expression = 'bond.coupon'
      name = 'Coupon'
   }
   attr {
      expression = 'bond.maturity'
      name = 'Maturity'
   }
   attr {
      expression = 'bond.spot?.price?.last'
      name = 'Price'
   }
   attr {
      expression = 'bond.spot?.yield?.last'
      name = 'Yield'
   }
   attr {
      expression = 'bond.spot?.zspread?.last'
      name = 'Z-Spread'
   }
   attr {
      expression = 'bond.spot?.cdsBasis?.last'
      name = 'CDS Basis'
   }
}
Grails to Excel I:
                         DASL(Ticker,Exp)
Ticker /                               JAVA     ORCL     GM       IBM
Expression                             Equity   Equity   Equity   Equity
it.spot.px                             9.0      18.42    1.09     101.37

it.volSurface.find(delta : 50, expiry : 22      44       180      39
365).spot.iVol
it.cds.spot.spread                     65.31    63       23730    60

it.refBond.spot.zspread                230      55       18700    57

it.cds.spot.basis                      -164.7   8        1030     3

it.fin.mrq.netDebt                     -300     10000    28846    21000

it.fin.mrq.totalDebt /                 N/A      5.5      N/A      6.3
it.fin.mrq.ebitda
Grails to Excel II:
        DSLH(Ticker,Exp,Start,End)
Ticker /               JAVA     ORCL     GM       IBM
Expression             Equity   Equity   Equity   Equity
it.spot.px             9.0      18.42    1.09     101.37
15 May 2009            9.0      18.42    1.09     101.37
14 May 2009            9.0      18.46    1.15     101.05
13 May 2009            8.95     18.07    1.21     102.26
12 May 2009            9.05     18.38    1.15     103.94
11 May 2009            8.91     18.56    1.44     99.83
8 May 2009             8.71     18.32    1.61     101.49



   Expressions can be complex, traverse related
    objects, join disparate data sources
Grails to Excel III:
     DSLR(Report[Optional Para])

=DSLR('SUNMA')   EqyPx    CDS   Bond Basis     Debt    Leverage
JAVA Equity      9.0      63    230   -164.7   -300    N/A

ORCL Equity      18.42    63    55    8        10000   5.5

IBM Equity       101.37   60    57    3        21000   6.3
Agenda
−   Speaker and Project
−   Motivations for Groovy in Quantitative Finance
        Business Problem
        Math / Data / Business / Languages
        Questions Regarding Groovy Performance

−   Data Grid and Dynamic Programming
        Master / Worker Model, MapReduce, and ForkJoin
        Property Listeners, Dependency Graphs, Invalidation

−   Grails: Exposing the cache to the world

−   Revolution: Distributed Computing and DSLs
The Revolution I
         Technology And Finance

           IBM
PDP-11            SPARC   EMAIL   WEB   XML     GRID
            PC




    The Network Is The Computer
     −   We Can't Agree On Which End Of The Byte
         Comes First (Big Endian / Little Endian)
     −   We Can't Agree On Character Set and Line
         Delimiters (EBCIDEC, ASCII, Unicode)
     −   We Can't Agree How to Share Files
     −   We Can't Agree How To Share Code
The Revolution II
         Technology And Finance

           IBM
PDP-11             SPARC   EMAIL   WEB    XML     GRID
            PC



   Grid Computing and the Financial Ecosystem
    −   We Can Move Data Around The Network
    −   We Can Move Code Around the Network
    −   We Can Load New Code Dynamically
    −   We Can Move Data To Where the Code Is
    −   We Can Move Code to Where the Data Is
    −   We Can Schedule Work Intelligently (Optimally?)
The Future Is Multi Core
   Performance And Scalability
    −   Calculations and Queries: Once or Many ?
    −   Weak HashMaps and Distributed Cache
    −   Actors and The Erlang / Scala Metaphor
    −
   Computational Versus Data Grid
    −   Should Data Move Around The Network or Code ?
    −   Joins Across Data Stores
    −   Joins Across Computation Efforts
DASEL: A DSL for Quantitative Finance

    DASEL = DSL + Financial Ecosystem
   One DSL or Many ?
     −   Report Generation
     −   Simulation
     −   Portfolio Generating Functions

   Uses
     −   Analytic Trading
     −   Risk Analytics
     −   Opportunity Hunting / Discovery of Dislocations
Demo: (Time Permitting)

        Groovy Matrix

A High Performance Example of
Groovy Threads and a Math DSL
Questions and

Answers (Hopefully ?)
Next Steps:
    Contact: Jonathan.Felch@DaselSoftware.com
   On Social Networks:
    −   LinkedIn
    −   Twitter
    −   GitHub

   Coming Soon: Open Source Projects
    − GroovyNumerics: Parallel Math Lib
    −   GroovyFinance: Financial Math in Java for groovy
    −   ActiveGrid: The Cache

Weitere ähnliche Inhalte

Was ist angesagt?

Map, flatmap and reduce are your new best friends (javaone, svcc)
Map, flatmap and reduce are your new best friends (javaone, svcc)Map, flatmap and reduce are your new best friends (javaone, svcc)
Map, flatmap and reduce are your new best friends (javaone, svcc)Chris Richardson
 
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDSOverloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDSSumant Tambe
 
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Guillaume Laforge
 
Testing Rich Domain Models
Testing Rich Domain ModelsTesting Rich Domain Models
Testing Rich Domain ModelsChris Richardson
 
Building High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 FirestarterBuilding High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 FirestarterMithun T. Dhar
 
Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012Guillaume Laforge
 
Beyond Wordcount with spark datasets (and scalaing) - Nide PDX Jan 2018
Beyond Wordcount  with spark datasets (and scalaing) - Nide PDX Jan 2018Beyond Wordcount  with spark datasets (and scalaing) - Nide PDX Jan 2018
Beyond Wordcount with spark datasets (and scalaing) - Nide PDX Jan 2018Holden Karau
 
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInScalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInVitaly Gordon
 
Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...Chris Richardson
 
Improving PySpark Performance - Spark Beyond the JVM @ PyData DC 2016
Improving PySpark Performance - Spark Beyond the JVM @ PyData DC 2016Improving PySpark Performance - Spark Beyond the JVM @ PyData DC 2016
Improving PySpark Performance - Spark Beyond the JVM @ PyData DC 2016Holden Karau
 
OrientDB the graph database
OrientDB the graph databaseOrientDB the graph database
OrientDB the graph databaseArtem Orobets
 
Hotcode 2013: Javascript in a database (Part 1)
Hotcode 2013: Javascript in a database (Part 1)Hotcode 2013: Javascript in a database (Part 1)
Hotcode 2013: Javascript in a database (Part 1)ArangoDB Database
 
Advanced Php - Macq Electronique 2010
Advanced Php - Macq Electronique 2010Advanced Php - Macq Electronique 2010
Advanced Php - Macq Electronique 2010Michelangelo van Dam
 
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探台灣資料科學年會
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know Norberto Leite
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology updateDoug Domeny
 

Was ist angesagt? (20)

Map, flatmap and reduce are your new best friends (javaone, svcc)
Map, flatmap and reduce are your new best friends (javaone, svcc)Map, flatmap and reduce are your new best friends (javaone, svcc)
Map, flatmap and reduce are your new best friends (javaone, svcc)
 
HDF-EOS Java Application Programming Interfaces
HDF-EOS Java Application Programming InterfacesHDF-EOS Java Application Programming Interfaces
HDF-EOS Java Application Programming Interfaces
 
Final Table of Content
Final Table of ContentFinal Table of Content
Final Table of Content
 
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDSOverloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
Overloading in Overdrive: A Generic Data-Centric Messaging Library for DDS
 
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
Groovy DSLs, from Beginner to Expert - Guillaume Laforge and Paul King - Spri...
 
Testing Rich Domain Models
Testing Rich Domain ModelsTesting Rich Domain Models
Testing Rich Domain Models
 
Building High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 FirestarterBuilding High Perf Web Apps - IE8 Firestarter
Building High Perf Web Apps - IE8 Firestarter
 
Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012Groovy Domain Specific Languages - SpringOne2GX 2012
Groovy Domain Specific Languages - SpringOne2GX 2012
 
Dart
DartDart
Dart
 
Beyond Wordcount with spark datasets (and scalaing) - Nide PDX Jan 2018
Beyond Wordcount  with spark datasets (and scalaing) - Nide PDX Jan 2018Beyond Wordcount  with spark datasets (and scalaing) - Nide PDX Jan 2018
Beyond Wordcount with spark datasets (and scalaing) - Nide PDX Jan 2018
 
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInScalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedIn
 
Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...
 
Improving PySpark Performance - Spark Beyond the JVM @ PyData DC 2016
Improving PySpark Performance - Spark Beyond the JVM @ PyData DC 2016Improving PySpark Performance - Spark Beyond the JVM @ PyData DC 2016
Improving PySpark Performance - Spark Beyond the JVM @ PyData DC 2016
 
OrientDB the graph database
OrientDB the graph databaseOrientDB the graph database
OrientDB the graph database
 
Java Day-1
Java Day-1Java Day-1
Java Day-1
 
Hotcode 2013: Javascript in a database (Part 1)
Hotcode 2013: Javascript in a database (Part 1)Hotcode 2013: Javascript in a database (Part 1)
Hotcode 2013: Javascript in a database (Part 1)
 
Advanced Php - Macq Electronique 2010
Advanced Php - Macq Electronique 2010Advanced Php - Macq Electronique 2010
Advanced Php - Macq Electronique 2010
 
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
[DSC 2016] 系列活動:李泳泉 / 星火燎原 - Spark 機器學習初探
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 

Ähnlich wie Groovy Finance

GR8Conf 2009: Groovy in Fiance Case Study by Jonathan Felch
GR8Conf 2009: Groovy in Fiance Case Study by Jonathan FelchGR8Conf 2009: Groovy in Fiance Case Study by Jonathan Felch
GR8Conf 2009: Groovy in Fiance Case Study by Jonathan FelchGR8Conf
 
Groovy On The Trading Desk
Groovy On The Trading DeskGroovy On The Trading Desk
Groovy On The Trading DeskJonathan Felch
 
Predicting Consumer Behaviour via Hadoop
Predicting Consumer Behaviour via HadoopPredicting Consumer Behaviour via Hadoop
Predicting Consumer Behaviour via HadoopSkillspeed
 
Proud to be polyglot
Proud to be polyglotProud to be polyglot
Proud to be polyglotTugdual Grall
 
Applications of the REST Principle
Applications of the REST PrincipleApplications of the REST Principle
Applications of the REST Principleelliando dias
 
Dojo 1.0: Great Experiences For Everyone
Dojo 1.0: Great Experiences For EveryoneDojo 1.0: Great Experiences For Everyone
Dojo 1.0: Great Experiences For Everyoneslightlyoff
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWebDave Bouwman
 
Generic Attack Detection - ph-Neutral 0x7d8
Generic Attack Detection - ph-Neutral 0x7d8Generic Attack Detection - ph-Neutral 0x7d8
Generic Attack Detection - ph-Neutral 0x7d8Mario Heiderich
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Railsdosire
 
Dirty data? Clean it up! - Datapalooza Denver 2016
Dirty data? Clean it up! - Datapalooza Denver 2016Dirty data? Clean it up! - Datapalooza Denver 2016
Dirty data? Clean it up! - Datapalooza Denver 2016Dan Lynn
 
Practical Domain-Specific Languages in Groovy
Practical Domain-Specific Languages in GroovyPractical Domain-Specific Languages in Groovy
Practical Domain-Specific Languages in GroovyGuillaume Laforge
 
Scala meetup Kyiv slides 20171215
Scala meetup Kyiv slides 20171215Scala meetup Kyiv slides 20171215
Scala meetup Kyiv slides 20171215Evaldas Miliauskas
 
Cloudera Data Science Challenge
Cloudera Data Science ChallengeCloudera Data Science Challenge
Cloudera Data Science ChallengeMark Nichols, P.E.
 
Data Science Challenge presentation given to the CinBITools Meetup Group
Data Science Challenge presentation given to the CinBITools Meetup GroupData Science Challenge presentation given to the CinBITools Meetup Group
Data Science Challenge presentation given to the CinBITools Meetup GroupDoug Needham
 
ESWC SS 2013 - Wednesday Tutorial Marko Grobelnik: Introduction to Big Data A...
ESWC SS 2013 - Wednesday Tutorial Marko Grobelnik: Introduction to Big Data A...ESWC SS 2013 - Wednesday Tutorial Marko Grobelnik: Introduction to Big Data A...
ESWC SS 2013 - Wednesday Tutorial Marko Grobelnik: Introduction to Big Data A...eswcsummerschool
 
Architecting Agile Data Applications for Scale
Architecting Agile Data Applications for ScaleArchitecting Agile Data Applications for Scale
Architecting Agile Data Applications for ScaleDatabricks
 
Android Bootcamp
Android   BootcampAndroid   Bootcamp
Android Bootcampahkjsdcsadc
 
Database Survival Guide: Exploratory Webcast
Database Survival Guide: Exploratory WebcastDatabase Survival Guide: Exploratory Webcast
Database Survival Guide: Exploratory WebcastEric Kavanagh
 
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...SAP Cloud Platform
 

Ähnlich wie Groovy Finance (20)

GR8Conf 2009: Groovy in Fiance Case Study by Jonathan Felch
GR8Conf 2009: Groovy in Fiance Case Study by Jonathan FelchGR8Conf 2009: Groovy in Fiance Case Study by Jonathan Felch
GR8Conf 2009: Groovy in Fiance Case Study by Jonathan Felch
 
Groovy On The Trading Desk
Groovy On The Trading DeskGroovy On The Trading Desk
Groovy On The Trading Desk
 
Predicting Consumer Behaviour via Hadoop
Predicting Consumer Behaviour via HadoopPredicting Consumer Behaviour via Hadoop
Predicting Consumer Behaviour via Hadoop
 
Proud to be polyglot
Proud to be polyglotProud to be polyglot
Proud to be polyglot
 
Applications of the REST Principle
Applications of the REST PrincipleApplications of the REST Principle
Applications of the REST Principle
 
Dojo 1.0: Great Experiences For Everyone
Dojo 1.0: Great Experiences For EveryoneDojo 1.0: Great Experiences For Everyone
Dojo 1.0: Great Experiences For Everyone
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 
Generic Attack Detection - ph-Neutral 0x7d8
Generic Attack Detection - ph-Neutral 0x7d8Generic Attack Detection - ph-Neutral 0x7d8
Generic Attack Detection - ph-Neutral 0x7d8
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
Dirty data? Clean it up! - Datapalooza Denver 2016
Dirty data? Clean it up! - Datapalooza Denver 2016Dirty data? Clean it up! - Datapalooza Denver 2016
Dirty data? Clean it up! - Datapalooza Denver 2016
 
Practical Domain-Specific Languages in Groovy
Practical Domain-Specific Languages in GroovyPractical Domain-Specific Languages in Groovy
Practical Domain-Specific Languages in Groovy
 
Scala meetup Kyiv slides 20171215
Scala meetup Kyiv slides 20171215Scala meetup Kyiv slides 20171215
Scala meetup Kyiv slides 20171215
 
Cloudera Data Science Challenge
Cloudera Data Science ChallengeCloudera Data Science Challenge
Cloudera Data Science Challenge
 
Data Science Challenge presentation given to the CinBITools Meetup Group
Data Science Challenge presentation given to the CinBITools Meetup GroupData Science Challenge presentation given to the CinBITools Meetup Group
Data Science Challenge presentation given to the CinBITools Meetup Group
 
Maximizing Big Data ROI via Best of Breed Technology Patterns and Practices -...
Maximizing Big Data ROI via Best of Breed Technology Patterns and Practices -...Maximizing Big Data ROI via Best of Breed Technology Patterns and Practices -...
Maximizing Big Data ROI via Best of Breed Technology Patterns and Practices -...
 
ESWC SS 2013 - Wednesday Tutorial Marko Grobelnik: Introduction to Big Data A...
ESWC SS 2013 - Wednesday Tutorial Marko Grobelnik: Introduction to Big Data A...ESWC SS 2013 - Wednesday Tutorial Marko Grobelnik: Introduction to Big Data A...
ESWC SS 2013 - Wednesday Tutorial Marko Grobelnik: Introduction to Big Data A...
 
Architecting Agile Data Applications for Scale
Architecting Agile Data Applications for ScaleArchitecting Agile Data Applications for Scale
Architecting Agile Data Applications for Scale
 
Android Bootcamp
Android   BootcampAndroid   Bootcamp
Android Bootcamp
 
Database Survival Guide: Exploratory Webcast
Database Survival Guide: Exploratory WebcastDatabase Survival Guide: Exploratory Webcast
Database Survival Guide: Exploratory Webcast
 
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
Overview and Walkthrough of the Application Programming Model with SAP Cloud ...
 

Kürzlich hochgeladen

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Kürzlich hochgeladen (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

Groovy Finance

  • 1. Groovy Finance: Grid Computing and Computational Finance Jonathan Felch DASEL Software jonathan.felch@daselsoftware.com
  • 2. Agenda − Introduction: Speaker and Project − Motivations for Groovy in Quantitative Finance  Business Problem  Math / Data / Business / Languages  Questions Regarding Groovy Performance − Data Grid and Dynamic Programming  Master / Worker Model, MapReduce, and ForkJoin  Property Listeners, Dependency Graphs, Invalidation − Grails: Exposing the cache to the world − Revolution: Distributed Computing and DSLs
  • 3. Introduction  Jonathan Felch − NASDAQ Software Architect 1997-99 − Lehman Brothers Global e-Commerce Architect 1999-2000 − Venture Capital Associate @ GS / BCG JV 2000-2001 − Quantitative Systems @ Syntax Capital 2005-2006 − VP Quantitative Systems @ Credit Suisse 2006-2009 − Independent Work in Financial DSLs / Data Grids 2009+
  • 4. Groovy Finance: A Case Study  Started at Syntax Capital Management in 2005 − Capital Structure Arbitrage − Almost Every Asset Class − Focus on Credit Markets, Macro and Single Name  Matured at an Investment Bank 2007-2009 − Groovy To The Rescue − Grails and Integration − Meta-Programming and A Distributed Cache − Unexpected Upside: A Quant Finance DSL
  • 5. Groovy Finance: Architecture  Industrial Strength Back-End In Java  Enterprise Software Integration − Data Acquisition Focus / Logical Focus  SOAP, JMS, JDBC, CSV files, ZIP files, delimited files  Bloomberg, Markit Partners, OPRA, Ivy, Barra, Imagine − Data Delivery Solutions  Excel Plug-In  Reports in HTML, PDF, CSV, JSON, XML, JMS  DSL Console with JSyntaxPane
  • 6. Agenda − Introduction: Speaker and Project − Motivations for Groovy in Quantitative Finance  Business Problem  Math / Data / Business / Languages  Questions Regarding Groovy Performance − Data Grid and Dynamic Programming − Grails: Exposing the cache to the world − Revolution: Distributed Computing and DSLs
  • 7. What is Quant Finance ? A quant designs and implements software and mathematical models for the pricing of derivatives, assessment of risk, or predicting market movements
  • 8. What's The Problem: The Math  Quant Finance Models are Wrong − Even The Best Models Fail, Failure Is Expensive  Assumption of Quantitative Finance Are Wrong − Market Are Social Phenomena, Not Random Walks  Quant Finance Models Change − In Bad Times, They Change A Lot  Coding Almost everything in C++ takes forever  Coding Everything Else in VBA doesn't scale
  • 9. What's The Problem: The Market  Market Structures Drive Financial Data − Different Calendars, Different Measures − Equities and Government Auctions are Transparent  Also options, some bonds, some preferred − Exotic and Credit Markets are Illiquid, No Transparency  Some of products are not really 'securities'  Identifiers are ridiculous, don't work, unclear − ISIN, CUSIP, SEDOL, Tickers, ADRs, … − Observation Dates and Effective Dates
  • 10. What's The Problem: The Data  Lots of Data, Lots of Math, Lots of Products − Credit Market Subset  1500 Companies / 2500 Curves / 10 Indices & Tranches  10,000 Liquid Bonds / 2,000 Liquid Converts / 2,000 Loans  1500 Liquid Equities / 169 point vol surface to start − Derivatives and Quant strategies have many metrics for each time series observation  Securities can't be compared on price  Relative values metrics are complex and there are many
  • 11. What's The Problem: The Traders  Great Trades Come From Half-Baked Ideas − Fully Baked Ideas Have Already Been Priced In  Traders Do Not Know What They Want  Whatever They Think They Want, They Wanted It Yesterday  Whatever They Want Today, They Will Never Use Again
  • 12. Languages of Quant Finance  Commonly used languages of Quant Finance − C++ (The Dominant Industrial Strength Language) − VBA − Matlab, SAS, STATA, S, and R − C# − Java (Most limited to Fixed Income and Web)  Up and Coming / Research Languages of Interest to Quant Finance − Fortress, Scala, Groovy, Python, F#, and Erlang
  • 13. JEE / Groovy Components
  • 14. Why Groovy ?  Pith, Speedy Development Cycle − Made for half baked idea  Dynamic Programming − Meta-Programming, DSL Support  Java / JEE / Enterprise − Massive Ecosystem, Performance Fall back  Community − Grails, Griffon, lots of small projects
  • 15. Other Tools That Helped Out  Google Collections and MapReduce  VisualNumeric's JSML / UJMP / Weka  Terracotta  JSR 166 / Fork-Join  R Language
  • 16. Groovy Performance: Overview  JIT and Operator Overloading − Number Crunching and Monte Carlo − GroovyMatrix  Smart Programming − Algorithms versus Language − Grid Computing − Caching  'Thought Experiments' before production code − Groovy 'gets the idea right' faster than C++
  • 17. Performance I: Numeric Collections  Only Re-calculate Values That Change − Overloading operators in numeric collections allow numeric operations to only-recalculate variations in the dependency graph − JIT / Optimizers will load partial expressions into CPU registered  Closures as formulas − Rather than using loops for executing an expression many times, the collections can be mixed with numeric values and constants in a single expression
  • 18. Performance II: Monte Carlo def path = { spot, rate, vol, time, draw → def drift = (rate – 0.5 * vol * vol) * time def diffusion = vol * Math.sqrt(time) * draw spot * Math.E ** (drift + diffusion) } def euler = path.curry(100.0,0.05,0.15,1.0) def paths = euler(guassian) def guassian = GroovyMatrix.createGuassian(1000,1000) def strikePrices = [80, 90, 100, 110, 120] def df = Math.exp(time * -interestRate) def size = paths.size() strikePrices.each { strike -> def callOption = df * paths.collect { Math.max(0,it - strike) }.sum() / size def putOption = df * paths.collect { Math.max(0,it - strike) }.sum() / size println “1 Yr ${strike} Strike Call = ${callOption}” println “1 Yr ${strike} Strike Put = ${putOption}” }
  • 19. Agenda − Introduction: Speaker and Project − Motivations for Groovy in Quantitative Finance  Business Problem  Math / Data / Business / Languages  Project Background 2005-2007 − Data Grid and Dynamic Programming  Master / Worker Model, MapReduce, and ForkJoin  Property Listeners, Dependency Graphs, Invalidation − Grails: Exposing the cache to the world − Revolution: Distributed Computing and DSLs
  • 20. Databases versus Caching  Traditional Model: Hibernate − Data Model = Database plus Cache of POJOs  All Objects of the name class share structure  No (Persistent) Dynamic Properties on 1st class objects  All first class objects (query-able) lived in the database  Our Model: All POJOs → Tuples or Nodes − Tuples of same class may 'grow' existing structure − Tuples do not all have to come from data  Questions about what does and does not belong in database  Query Language = Gpath / Xpath + Hibernate  Includes dynamic properties and calculated values
  • 21. Distributed Cache and MetaProgramming I  Terracotta for the shared memory and synchronization − Integration point for Hibernate and Hibernate Cache − Integration point for Groovy Data Adapters  All First Class Objects are decomposed from Java or Groovy objects to a 'Tuple' − Not perfectly named, but a simple data structure than implements Map and List − Usable with XPATH − Small Set of Primitives optimized for Terracotta
  • 22. Distributed Cache and Meta-Programming II  Everything is a Property − Data and methods − Behavior follows a mathematical model − Property listeners manage invalidation  Missing Methods / Missing Properties − Widely used calculations and method results stored as property values so avoid redundant calculation − Calculated values are never stored in the database
  • 23. Distributed Cache and Meta Programming III  Tuple Class − Much like a Groovy Class − Joins objects like associations / relations in Hibernate − Defines raw types / names / converters − Defines property finders / chained finders / methods  Missing Methods / Missing Properties − 'Missing' Events Trigger Chainable Closures − Missing Events invoker 'Finders' and 'Builders'
  • 24. Distributed Cache and Meta Programming IV  Do We Even Want A Database ?? − Sometimes Accessing Data Remotely Works Just As Well − Sometimes Pulling Data from Flat Files On Demand works Just As Well − Sometimes Calculating from Values from old inputs makes more sense than persisting it (normal forms)  'Active' Cache As a Integration Space − Miss in a cache request trigger a chain of closures
  • 25. Agenda − Speaker and Project − Motivations for Groovy in Quantitative Finance  Business Problem  Math / Data / Business / Languages  Questions Regarding Groovy Performance − Data Grid and Dynamic Programming  Master / Worker Model, MapReduce, and ForkJoin  Property Listeners, Dependency Graphs, Invalidation − Grails: Exposing the cache to the world − Revolution: Distributed Computing and DSLs
  • 26. Grails As A Integration Hub  Controller requests arrive via JSON, XML, JMS − R Language Client: JSON → Grails − Excel Client: JSON → Grails Over HTTP − Excel RTD: JSON → Grails over JMS − SwingX Table (Real-Time) JSON → Grails via JMS − SwingX Table JSON → Grails via HTTP  Affiliated Business Units: − XML Web Services from dot Not − Matlab dot Net
  • 27. Cache Logic: Reporting def r = builder.reportWith(Bond.class, ”bond.cdsBasis < 0”) { attr { expression = 'bond.ticker' name = 'Ticker' } attr { expression = 'bond.coupon' name = 'Coupon' } attr { expression = 'bond.maturity' name = 'Maturity' } attr { expression = 'bond.spot?.price?.last' name = 'Price' } attr { expression = 'bond.spot?.yield?.last' name = 'Yield' } attr { expression = 'bond.spot?.zspread?.last' name = 'Z-Spread' } attr { expression = 'bond.spot?.cdsBasis?.last' name = 'CDS Basis' } }
  • 28. Grails to Excel I: DASL(Ticker,Exp) Ticker / JAVA ORCL GM IBM Expression Equity Equity Equity Equity it.spot.px 9.0 18.42 1.09 101.37 it.volSurface.find(delta : 50, expiry : 22 44 180 39 365).spot.iVol it.cds.spot.spread 65.31 63 23730 60 it.refBond.spot.zspread 230 55 18700 57 it.cds.spot.basis -164.7 8 1030 3 it.fin.mrq.netDebt -300 10000 28846 21000 it.fin.mrq.totalDebt / N/A 5.5 N/A 6.3 it.fin.mrq.ebitda
  • 29. Grails to Excel II: DSLH(Ticker,Exp,Start,End) Ticker / JAVA ORCL GM IBM Expression Equity Equity Equity Equity it.spot.px 9.0 18.42 1.09 101.37 15 May 2009 9.0 18.42 1.09 101.37 14 May 2009 9.0 18.46 1.15 101.05 13 May 2009 8.95 18.07 1.21 102.26 12 May 2009 9.05 18.38 1.15 103.94 11 May 2009 8.91 18.56 1.44 99.83 8 May 2009 8.71 18.32 1.61 101.49  Expressions can be complex, traverse related objects, join disparate data sources
  • 30. Grails to Excel III: DSLR(Report[Optional Para]) =DSLR('SUNMA') EqyPx CDS Bond Basis Debt Leverage JAVA Equity 9.0 63 230 -164.7 -300 N/A ORCL Equity 18.42 63 55 8 10000 5.5 IBM Equity 101.37 60 57 3 21000 6.3
  • 31. Agenda − Speaker and Project − Motivations for Groovy in Quantitative Finance  Business Problem  Math / Data / Business / Languages  Questions Regarding Groovy Performance − Data Grid and Dynamic Programming  Master / Worker Model, MapReduce, and ForkJoin  Property Listeners, Dependency Graphs, Invalidation − Grails: Exposing the cache to the world − Revolution: Distributed Computing and DSLs
  • 32. The Revolution I Technology And Finance IBM PDP-11 SPARC EMAIL WEB XML GRID PC  The Network Is The Computer − We Can't Agree On Which End Of The Byte Comes First (Big Endian / Little Endian) − We Can't Agree On Character Set and Line Delimiters (EBCIDEC, ASCII, Unicode) − We Can't Agree How to Share Files − We Can't Agree How To Share Code
  • 33. The Revolution II Technology And Finance IBM PDP-11 SPARC EMAIL WEB XML GRID PC  Grid Computing and the Financial Ecosystem − We Can Move Data Around The Network − We Can Move Code Around the Network − We Can Load New Code Dynamically − We Can Move Data To Where the Code Is − We Can Move Code to Where the Data Is − We Can Schedule Work Intelligently (Optimally?)
  • 34. The Future Is Multi Core  Performance And Scalability − Calculations and Queries: Once or Many ? − Weak HashMaps and Distributed Cache − Actors and The Erlang / Scala Metaphor −  Computational Versus Data Grid − Should Data Move Around The Network or Code ? − Joins Across Data Stores − Joins Across Computation Efforts
  • 35. DASEL: A DSL for Quantitative Finance DASEL = DSL + Financial Ecosystem  One DSL or Many ? − Report Generation − Simulation − Portfolio Generating Functions  Uses − Analytic Trading − Risk Analytics − Opportunity Hunting / Discovery of Dislocations
  • 36. Demo: (Time Permitting) Groovy Matrix A High Performance Example of Groovy Threads and a Math DSL
  • 38. Next Steps: Contact: Jonathan.Felch@DaselSoftware.com  On Social Networks: − LinkedIn − Twitter − GitHub  Coming Soon: Open Source Projects − GroovyNumerics: Parallel Math Lib − GroovyFinance: Financial Math in Java for groovy − ActiveGrid: The Cache