45
L.G.H.C. Nalinda 2011CS005 11000058 Domain Specific Language to Specify Operations of a Central Counterparty Supervisor: Dr. Chamath Keppetiyagama

Domain Specific Language for Specify Operations of a Central Counterparty

Embed Size (px)

Citation preview

Page 1: Domain Specific Language for Specify Operations of a Central Counterparty

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

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

Financial Markets

Page 4: Domain Specific Language for Specify Operations of a Central Counterparty

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

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

Motivation

Page 7: Domain Specific Language for Specify Operations of a Central Counterparty

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

DSL for Finance Sector[Cntd]

Motivation

Page 9: Domain Specific Language for Specify Operations of a Central Counterparty

Haskell Contract

Combinator Library

Page 10: Domain Specific Language for Specify Operations of a Central Counterparty

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

Primitives for Defining Contracts | HCCLIntroductionHCCL

Page 12: Domain Specific Language for Specify Operations of a Central Counterparty

Primitives for Defining ObservablesIntroductionHCCL

Page 13: Domain Specific Language for Specify Operations of a Central Counterparty

Composing Contracts

Page 14: Domain Specific Language for Specify Operations of a Central Counterparty

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

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

Central Counterparty

Page 17: Domain Specific Language for Specify Operations of a Central Counterparty

Absence of CCP

Motivation

Page 18: Domain Specific Language for Specify Operations of a Central Counterparty

With CCP

Motivation

Page 19: Domain Specific Language for Specify Operations of a Central Counterparty

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

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

Research Hypothesis

Page 22: Domain Specific Language for Specify Operations of a Central Counterparty

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

Specify Operations of a CCP

Using a Domain Specific

Language approach

Page 24: Domain Specific Language for Specify Operations of a Central Counterparty

Research Literature

Page 25: Domain Specific Language for Specify Operations of a Central Counterparty

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

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

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

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

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

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

Architecture

Page 32: Domain Specific Language for Specify Operations of a Central Counterparty

Overall Architecture IntroductionArchitecture

Page 33: Domain Specific Language for Specify Operations of a Central Counterparty

DerivativeIntroductionArchitecture

Page 34: Domain Specific Language for Specify Operations of a Central Counterparty

Rule | Design Architecture IntroductionArchitecture

Page 35: Domain Specific Language for Specify Operations of a Central Counterparty

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

Seed Contract | Outcome of Hypothesis

IntroductionArchitecture

Page 37: Domain Specific Language for Specify Operations of a Central Counterparty

Seed Contract | Outcome of Hypothesis

IntroductionArchitecture

Page 38: Domain Specific Language for Specify Operations of a Central Counterparty

Operations of CCPIntroductionArchitecture

Page 39: Domain Specific Language for Specify Operations of a Central Counterparty

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

Evaluation

Page 41: Domain Specific Language for Specify Operations of a Central Counterparty

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

Progress

Page 43: Domain Specific Language for Specify Operations of a Central Counterparty

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

THANK YOU

Page 45: Domain Specific Language for Specify Operations of a Central Counterparty

Q&A