Domain Specific Language for Specify Operations of a Central Counterparty
-
Upload
chamin-nalinda-loku-gam-hewage -
Category
Engineering
-
view
259 -
download
4
Transcript of Domain Specific Language for Specify Operations of a Central Counterparty
![Page 1: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/1.jpg)
L.G.H.C. Nalinda
2011CS005
11000058
Domain Specific Language to
Specify Operations of a Central
Counterparty
Supervisor: Dr. Chamath Keppetiyagama
![Page 2: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/2.jpg)
Road Map▷Financial Markets
▷Motivation
▷Haskell Contract Combinator Library (HCCL)
▷Composing Contracts
▷Central Counterparty (CCP)
▷Research Hypothesis
▷Research Literature
▷Architecture
▷Evaluation
▷Progress
![Page 3: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/3.jpg)
Financial Markets
![Page 4: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/4.jpg)
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
![Page 5: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/5.jpg)
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
![Page 6: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/6.jpg)
Motivation
![Page 7: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/7.jpg)
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
![Page 8: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/8.jpg)
DSL for Finance Sector[Cntd]
Motivation
![Page 9: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/9.jpg)
Haskell Contract
Combinator Library
![Page 10: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/10.jpg)
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
![Page 11: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/11.jpg)
Primitives for Defining Contracts | HCCLIntroductionHCCL
![Page 12: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/12.jpg)
Primitives for Defining ObservablesIntroductionHCCL
![Page 13: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/13.jpg)
Composing Contracts
![Page 14: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/14.jpg)
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
![Page 15: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/15.jpg)
Contract Definitions
IntroductionComposing Contracts
▷ZCB :: Date Double Currency Contract
▷EU_OPTION :: Date Contract Contract
▷AMERICAN_OPTION :: (Date,Date) Contract Contract
![Page 16: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/16.jpg)
Central Counterparty
![Page 17: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/17.jpg)
Absence of CCP
Motivation
![Page 18: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/18.jpg)
With CCP
Motivation
![Page 19: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/19.jpg)
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
![Page 20: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/20.jpg)
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.
![Page 21: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/21.jpg)
Research Hypothesis
![Page 22: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/22.jpg)
If we can use Peyton Jones’s
language to compose FC/FD, we
can use the same language to
compose CCP Rules
![Page 23: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/23.jpg)
Specify Operations of a CCP
Using a Domain Specific
Language approach
![Page 24: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/24.jpg)
Research Literature
![Page 25: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/25.jpg)
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/)
![Page 26: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/26.jpg)
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
![Page 27: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/27.jpg)
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
![Page 28: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/28.jpg)
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
![Page 29: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/29.jpg)
Environment ▷Facts About Observables and Choices – Symbolic Management of Derivatives
- External to the FC/FD
- Direct impact on the FC/FD
IntroductionResearch Literature
![Page 30: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/30.jpg)
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
![Page 31: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/31.jpg)
Architecture
![Page 32: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/32.jpg)
Overall Architecture IntroductionArchitecture
![Page 33: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/33.jpg)
DerivativeIntroductionArchitecture
![Page 34: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/34.jpg)
Rule | Design Architecture IntroductionArchitecture
![Page 35: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/35.jpg)
Rule | Hypothesis IntroductionArchitecture
▷Rule_9102 :: DEPENDENT_FACTORS Contract
▷Factors Identified- Maturity
- Current Date
- Position
- Options Time Value ++
![Page 36: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/36.jpg)
Seed Contract | Outcome of Hypothesis
IntroductionArchitecture
![Page 37: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/37.jpg)
Seed Contract | Outcome of Hypothesis
IntroductionArchitecture
![Page 38: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/38.jpg)
Operations of CCPIntroductionArchitecture
![Page 39: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/39.jpg)
Derivative Management
▷Seed -> Grow over “n” Periods
▷Comparison of Contracts
▷Comparison of Periods
▷Symbolic Contract Management- Speicialization
- Reduction
▷Derive unseen Derivatives
Architecture
![Page 40: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/40.jpg)
Evaluation
![Page 41: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/41.jpg)
The Extent to Which the
Proposed Hypothesis can be
Used to Define Operations of
CCP
![Page 42: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/42.jpg)
Progress
![Page 43: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/43.jpg)
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
![Page 44: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/44.jpg)
THANK YOU
![Page 45: Domain Specific Language for Specify Operations of a Central Counterparty](https://reader033.fdocuments.in/reader033/viewer/2022052915/58efe4d91a28abae078b45e1/html5/thumbnails/45.jpg)
Q&A