SlideShare a Scribd company logo
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 days
Cheque clearing
.Deposit/Withdraw
Today  More Complicated Operations
▷Stakeholders & Financial Institutes
Different 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 Science
Big Data
Data Mining
Real Time Analytics
Neural Networks ++
Financial Markets
Motivation
DSL for Finance Sector
▷ Define Finance Contracts / Finance Derivatives
Each Derivative  Different Definitions (No Unified Approach)
Tedious Task – Uncertainty, Complexity ++
Processing is More Complex
▷DSL for Finance Sector
Unified Mechanism for Defining Contracts
DSL to Embed Properties of Contracts
▷Benefits
Simple 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 | HCCL
IntroductionHCCL
Primitives for Defining Observables
IntroductionHCCL
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 Book
MX | LCH | CBOT
▷Margin Calculation
Purpose : No Counterparty Default Occur
At the End of Each Business Day
.
▷Possibilities
Dr. 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
Summery
IntroductionResearch 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
Derivative
IntroductionArchitecture
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 CCP
IntroductionArchitecture
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

More Related Content

PPTX
Grafik analisis kebangkrutan
PPTX
Acoustic barcodes&FlatFitFab
PPTX
Depend&dingdong
PPT
Що потрібно знати про віл
DOCX
Kuliah sli 2015 rev 127
PPTX
Tan pro kit
PPTX
Exploring percussive gesture on i pads with ensemble
PPTX
乘車安全
Grafik analisis kebangkrutan
Acoustic barcodes&FlatFitFab
Depend&dingdong
Що потрібно знати про віл
Kuliah sli 2015 rev 127
Tan pro kit
Exploring percussive gesture on i pads with ensemble
乘車安全

Viewers also liked (13)

PDF
Sdal overview sallie keller
PPTX
Masalah khusus
PPTX
Portico&video bubbles
PPSX
Kitchen Cabinet Doors
PDF
Sdal air health and social development (jan. 27, 2014) final
PPTX
MANAGEMENT OF SUBSTANCE RELATED PSYCHIATRIC DISORDER SEDATIVE, HYPNOTIC AND A...
PPTX
Graffiti fur &Thaw
PPT
Hubungan kantor pusat dan cabang
PPTX
Presentacion Final.pptx
PPTX
Graffiti fur
PPTX
Psychological disorder
PPTX
Reclaim the fat
PPTX
pembentukan persekutuan
Sdal overview sallie keller
Masalah khusus
Portico&video bubbles
Kitchen Cabinet Doors
Sdal air health and social development (jan. 27, 2014) final
MANAGEMENT OF SUBSTANCE RELATED PSYCHIATRIC DISORDER SEDATIVE, HYPNOTIC AND A...
Graffiti fur &Thaw
Hubungan kantor pusat dan cabang
Presentacion Final.pptx
Graffiti fur
Psychological disorder
Reclaim the fat
pembentukan persekutuan
Ad

More from Chamin Nalinda Loku Gam Hewage (8)

PPTX
Domain Specific Language for Specify Operations of a Central Counterparty(CCP)
PPTX
Domain Specific Language for Specify Operations of a Central Counterparty(CCP)
PPTX
Branch And Bound and Beam Search Feature Selection Algorithms
PPTX
World’s Fastest Supercomputer | Tianhe - 2
PPTX
Structured Cabling Technologies
PPTX
PPTX
Last Mile Access Technologies
PDF
Big Data Social Network Analysis
Domain Specific Language for Specify Operations of a Central Counterparty(CCP)
Domain Specific Language for Specify Operations of a Central Counterparty(CCP)
Branch And Bound and Beam Search Feature Selection Algorithms
World’s Fastest Supercomputer | Tianhe - 2
Structured Cabling Technologies
Last Mile Access Technologies
Big Data Social Network Analysis
Ad

Recently uploaded (20)

PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
communication and presentation skills 01
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
Current and future trends in Computer Vision.pptx
PPT
Occupational Health and Safety Management System
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
Soil Improvement Techniques Note - Rabbi
PDF
Abrasive, erosive and cavitation wear.pdf
PPT
introduction to datamining and warehousing
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
PPTX
introduction to high performance computing
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
Information Storage and Retrieval Techniques Unit III
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
communication and presentation skills 01
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Current and future trends in Computer Vision.pptx
Occupational Health and Safety Management System
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Soil Improvement Techniques Note - Rabbi
Abrasive, erosive and cavitation wear.pdf
introduction to datamining and warehousing
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Analyzing Impact of Pakistan Economic Corridor on Import and Export in Pakist...
introduction to high performance computing
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Exploratory_Data_Analysis_Fundamentals.pdf
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt

Domain Specific Language for Specify Operations of a Central Counterparty

  • 1. L.G.H.C. Nalinda 2011CS005 11000058 Domain Specific Language to Specify Operations of a Central Counterparty Supervisor: Dr. Chamath Keppetiyagama
  • 2. Road Map ▷Financial Markets ▷Motivation ▷Haskell Contract Combinator Library (HCCL) ▷Composing Contracts ▷Central Counterparty (CCP) ▷Research Hypothesis ▷Research Literature ▷Architecture ▷Evaluation ▷Progress
  • 4. Financial Markets ▷Vital Governing Sector in Global Economy – Economic Wealth is Presented ▷Early days Cheque clearing .Deposit/Withdraw Today  More Complicated Operations ▷Stakeholders & Financial Institutes Different stakeholder interests Different Operations Linked to each other
  • 5. Stakeholder Interests vs Economic Stability ▷History Enron 2007 2008 Crisis Greek Crisis ▷Minimize Risk– Effective Derivative Management ▷Computer Science Big Data Data Mining Real Time Analytics Neural Networks ++ Financial Markets
  • 7. DSL for Finance Sector ▷ Define Finance Contracts / Finance Derivatives Each Derivative  Different Definitions (No Unified Approach) Tedious Task – Uncertainty, Complexity ++ Processing is More Complex ▷DSL for Finance Sector Unified Mechanism for Defining Contracts DSL to Embed Properties of Contracts ▷Benefits Simple Valuation … Complex Back-End Operation Management Motivation
  • 8. DSL for Finance Sector[Cntd] Motivation
  • 10. 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
  • 11. Primitives for Defining Contracts | HCCL IntroductionHCCL
  • 12. Primitives for Defining Observables IntroductionHCCL
  • 14. 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
  • 15. Contract Definitions IntroductionComposing Contracts ▷ZCB :: Date  Double  Currency  Contract ▷EU_OPTION :: Date  Contract  Contract ▷AMERICAN_OPTION :: (Date,Date)  Contract  Contract
  • 19. Operations of CCP ▷Rule Book MX | LCH | CBOT ▷Margin Calculation Purpose : No Counterparty Default Occur At the End of Each Business Day . ▷Possibilities Dr. Trader Account Cr. Trader Account Restate to Initial Margin Methodology
  • 20. 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 .
  • 22. If we can use Peyton Jones’s language to compose FC/FD, we can use the same language to compose CCP Rules
  • 23. Specify Operations of a CCP Using a Domain Specific Language approach
  • 25. 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/)
  • 26. 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
  • 27. 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
  • 28. 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
  • 29. Environment ▷Facts About Observables and Choices – Symbolic Management of Derivatives - External to the FC/FD - Direct impact on the FC/FD IntroductionResearch Literature
  • 30. Summery IntroductionResearch 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
  • 34. Rule | Design Architecture IntroductionArchitecture
  • 35. Rule | Hypothesis IntroductionArchitecture ▷Rule_9102 :: DEPENDENT_FACTORS  Contract ▷Factors Identified - Maturity - Current Date - Position - Options Time Value ++
  • 36. Seed Contract | Outcome of Hypothesis IntroductionArchitecture
  • 37. Seed Contract | Outcome of Hypothesis IntroductionArchitecture
  • 39. Derivative Management ▷Seed -> Grow over “n” Periods ▷Comparison of Contracts ▷Comparison of Periods ▷Symbolic Contract Management - Speicialization - Reduction ▷Derive unseen Derivatives Architecture
  • 41. The Extent to Which the Proposed Hypothesis can be Used to Define Operations of CCP
  • 43. 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
  • 45. Q&A