of a contract - CFIR

cfir.dk
  • No tags were found...

of a contract - CFIR

Functional Programming for Trade Management and ValuationSeminar on Functional High Performance Computing in FinanceDecember 14, 2010Martin ElsmanSimCorp A/S


The Financial Contracts MarketBanks (and other financial institutions) usefinancial contracts for both• Speculation• Insurance (hedging)Increase riskDecrease riskMany contracts are ”Over The Counter”(OTC) contracts, which are negotiatedagreements between a bank and anotherbank (its counter party).2


The Term Sheet – the financial contract• A financial contract is typically agreed upon on a so-called ”Term Sheet”.• The term sheet specifies the financial flows (amounts, dates, etc.) and underwhich conditions a flow should happen.• Flows can go in both directions.$10,000 each month for12 monthsAmortized Loan$100,000 up front• A derivative is a contract that depends on an underlying entity (e.g., a stock)3


Many Types of Financial Contracts are TradedFX SwapsPlain VanillaOptionsHimalyanOptionsInflationSwapsCredit DefaultSwaps (CDS)CatastrophyBondsInterest RateSwapsIndexed LinkedBondsRainbowOptionsFX OptionsBermudanOptionsVarianceCertificatesChooserOptionsForward RateAgreementsCallable RangeAccrual Notes4


How do the Banks Keep Track?• Many Problems:– Financial contracts need management• fixings, decisions, corporate actions, …– Banks must report daily on their total value of assets– Banks must control risk (counterparty risk, currency risk, …)– Banks need to know about future cash flowsAlgebraicproperties• A Solution:– Specify financial contracts in a domain specific language!– Use a functional programming language (e.g., ML)Simple reasoning5


The SimCorp XpressInstruments SolutionInstrument specific inputInstruments are specified in an instrument modeling languageOnce loaded, a portfoliomanager may instantiatean instrument to createcontracts.The instrument knowswhat input to ask for.Wall-to-wall (Front Office,Middle Office, Back Office)contract management6LexiFiTechnologyInside!!


The SimCorp XpressInstruments SolutionInstrument IDE• Instruments are written bySimCorp consultants or bybanks themselves:• Newly written instrumentsmay be loaded into thesystem instantaniously• Notice: Arbitrary shorttime-to-market7


Constructing Contract Management Software in Standard MLBasics:In reality, there are, ofcourse, more currencies…Observable: algebra overmeasurable time-changingentities (e.g., Carlsberg stock)8


The Contract Language as a Standard ML DatatypeFlow of one unitAcquire the underlyingcontract at specific date9


Example Financial Contracts11,000 each month for 3monthsAmortized Loan30,000 up frontAllGiveFlow11000Flow11000Flow11000Flow30000Notice: flows indifferent currencies10


A Somewhat more Complex ExampleMeaning: Acquire at maturity the amount (in EUR), calculated asfollows (P is price of Carlsberg stock at maturity):nominal * max(0, P – strike)11


Now What?• We have now defined some contracts, but what can we do with thedefinitions?– Report on the expected future cash flows– Perform management operations:• Advancement (simplify contract when time evolves)• Corporate action (stock splits, merges, catastrophic events, …)• Perform fixing (simplify contract when an underlying becomes known)– Report on the value (price) of a contract– …12


Expected Future Cash FlowsWhen a contractis given away,flows are invertedIt is possible to define afunction cashflows thatcollects information aboutthe future cash flows of acontract.13


Contract Management and Contract SimplificationFixing alsoadvancescontractObservableunderlyingsmay introduceuncertaintiesOutput:Contracts are simplifieddue to calls to the fixingfunction14


Valuation (pricing)Notice: This model isa bit too simple – weassume the FX-rate isconstant…Output:15


What is Missing?• Proper date handling (holidays, business conventions; Act/30, Act/Act, …)• Easy GUI specification• More combinators (e.g., american optionality, dynamic dates, …)• More functionality (e.g., accrual interest)• Support for corporate actions and catastrophic events• Well-formedness of contracts… Disallow acquire of flow in the past• Proper stochastic models and underlying machinery (Sobol sequencesfor monte-carlo simulations) for pricing and calibration– Support for linking with external models (e.g., FINCAD)16


Conclusions• Functional programming– Is declarative: Focus on what instead of how– Is value oriented (functional, persistent data structures)– Eases reasoning (formal as well as informal)– Eases concurrent processing (e.g., for improved parallelism)• SimCorp not the only company (or bank) that has recognized the value offunctional programming for the financial industry– LexiFi (See ICFP’00 paper by Peyton-Jones, Eber, Seward)• Engine is used by SimCorp!– Jane Street Capital (focus on electronic trading)– Societe Generale, Credit Suisse, Standard Chartered, …– Contract ”Pay-off” specifications are often written in a functional style17


Appendix: Observable evaluation function18


Appendix: Observable Simplification– preparing for Contract Management19


Appendix: Future Cash FlowsPropagate scale factor toresolve amountObservableunderlyingsmay introduceuncertaintiesWhen a contractis given away,flows are inverted20


Appendix: Contract SimplificationComplete contract simplifier.Scale and Give constructorsare propagated downwardsand merged.Acquire constructors areresolved, given the argumentdate to simplify (d0).The environment (E) ispropagated to the observablesimplifier.21


Appendix: Contract Management Using ”simplify”22

More magazines by this user
Similar magazines