View
259
Download
4
Embed Size (px)
Citation preview
L.G.H.C. Nalinda
2011CS005
11000058
Domain Specific Language to
Specify Operations of a Central
Counterparty
Supervisor: Dr. Chamath Keppetiyagama
Road Map▷Financial Markets
▷Motivation
▷Haskell Contract Combinator Library (HCCL)
▷Composing Contracts
▷Central Counterparty (CCP)
▷Research Hypothesis
▷Research Literature
▷Architecture
▷Evaluation
▷Progress
Financial Markets
Financial Markets▷Vital Governing Sector in Global Economy – Economic Wealth is Presented
▷Early daysCheque clearing
.Deposit/Withdraw
Today More Complicated Operations
▷Stakeholders & Financial InstitutesDifferent stakeholder interests
Different Operations
Linked to each other
Stakeholder Interests vs Economic Stability▷History
Enron
2007 2008 Crisis
Greek Crisis
▷Minimize Risk– Effective Derivative Management
▷Computer ScienceBig Data
Data Mining
Real Time Analytics
Neural Networks ++
Financial Markets
Motivation
DSL for Finance Sector
▷ Define Finance Contracts / Finance DerivativesEach Derivative Different Definitions (No Unified Approach)
Tedious Task – Uncertainty, Complexity ++
Processing is More Complex
▷DSL for Finance SectorUnified Mechanism for Defining Contracts
DSL to Embed Properties of Contracts
▷BenefitsSimple Valuation … Complex Back-End Operation Management
Motivation
DSL for Finance Sector[Cntd]
Motivation
Haskell Contract
Combinator Library
Peyton Jones, Marc-Eber, Julian (2000)
▷Fixed, Precisely Specified Set of Combinators (Unified Mechanism)
▷Describe a Contract
▷Process a Contract
▷Find Value of a Contract
▷Compositional Nature – (Can Glue Combinators Together)
Contract Primitives + Observable Primitives
IntroductionHCCL
Primitives for Defining Contracts | HCCLIntroductionHCCL
Primitives for Defining ObservablesIntroductionHCCL
Composing Contracts
Composing ZCB
“Receive £200 on Future Date t1”
C1 = one GBP
C2 = truncate t1 (one GBP)
= truncate t1 (C1)
C3 = scale 200 (truncate t1(one GBP))
= scale 200 (C2)
C4 = get (scale 200 (truncate t1(one GBP)))
get (C3)
IntroductionComposing Contracts
ZCB :: Date -> Double -> Currency -> Contract
Contract Definitions
IntroductionComposing Contracts
▷ZCB :: Date Double Currency Contract
▷EU_OPTION :: Date Contract Contract
▷AMERICAN_OPTION :: (Date,Date) Contract Contract
Central Counterparty
Absence of CCP
Motivation
With CCP
Motivation
Operations of CCP
▷Rule BookMX | LCH | CBOT
▷Margin CalculationPurpose : No Counterparty Default Occur
At the End of Each Business Day
.
▷PossibilitiesDr. Trader Account
Cr. Trader Account
Restate to Initial Margin
Methodology
Rule 9102 – Long Option Position
Margin Requirement.
Methodology
the period to expiry is greater or equal to 9
months, 50% of the option’s time value, else
100% of the option’s time value
Future Cash Flow.
Research Hypothesis
If we can use Peyton Jones’s
language to compose FC/FD, we
can use the same language to
compose CCP Rules
Specify Operations of a CCP
Using a Domain Specific
Language approach
Research Literature
Attempts to Define a Language
▷Lee – Language for Electronics Contracts … Common Logic Model
▷Deursen – Define a Formalized DSL - Highlight the Implications of such DSL
- Tool Bus Architecture (proposed solutions)
- RISLA
Finance Product Can Describe by it’s Cash Flow
IntroductionResearch Literature
▷LexiFi,
▷HiperFit (http://hiperfit.dk/)
Peyton Jones, Marc-Eber, Julian (2000)
▷Fixed, Precisely Specified Set of Combinators
▷Describe a Contract
▷Process a Contract
▷Find Value of a Contract
▷Compositional Nature
Contract Primitives + Observable Primitives
IntroductionResearch Literature
Complex Derivatives
▷Mediratta – Credit Default Swap & Power Reverse Dual Currency Swap
▷Valuation – evalC :: Model Contract
- evalO :: Model Contract
More Complex Derivatives Can Compose Using Fixed Set of
Combinators & Observables While
Preserving Uniqueness of the Contract
IntroductionResearch Literature
Software Language Approach
▷Peyton – Justify that FP Approach Can Use to Define and Value Derivatives- Lacking Highlighting SE Language Concepts
- No Unified Approach
▷Gaillourdet – HCCL in a SW Language Point of View- Provided a Formal Definition for the Language (Syntax)
Syntax of Observables
Syntax of Contract
- Denotational Semantics
Observables
Contracts
IntroductionResearch Literature
Environment ▷Facts About Observables and Choices – Symbolic Management of Derivatives
- External to the FC/FD
- Direct impact on the FC/FD
IntroductionResearch Literature
SummeryIntroductionResearch Literature
DSL for Finance Sector Has been a Major Requirement Since Early Days
Payton, Eber, Julian HCCL
Mediratta Complex Derivatives
Gaillourdet Software Language Approach
Bahr, Jost, Elsman Symbolic Management of Finance
Contracts & Symbolic Management of
Multiparty Contracts
CCP Operations Have Not Yet Addressed using DSL Approach
Architecture
Overall Architecture IntroductionArchitecture
DerivativeIntroductionArchitecture
Rule | Design Architecture IntroductionArchitecture
Rule | Hypothesis IntroductionArchitecture
▷Rule_9102 :: DEPENDENT_FACTORS Contract
▷Factors Identified- Maturity
- Current Date
- Position
- Options Time Value ++
Seed Contract | Outcome of Hypothesis
IntroductionArchitecture
Seed Contract | Outcome of Hypothesis
IntroductionArchitecture
Operations of CCPIntroductionArchitecture
Derivative Management
▷Seed -> Grow over “n” Periods
▷Comparison of Contracts
▷Comparison of Periods
▷Symbolic Contract Management- Speicialization
- Reduction
▷Derive unseen Derivatives
Architecture
Evaluation
The Extent to Which the
Proposed Hypothesis can be
Used to Define Operations of
CCP
Progress
Completed
▷Research Literature
▷Architecture
▷Constructing Core Level Contracts
(https://github.com/CoolCK/Finance_Contracts_Haskell)
▷Partial Contract Implementation
▷Construction of Rule Using HCCL
▷Finalizing Seed Contract
▷Generate All Possible Results
Progress
Work In Progress
THANK YOU
Q&A