1 / 18

A Domain-Specific Language for Financial Products

A Domain-Specific Language for Financial Products. Arie van Deursen May 2001. Financial Products. Financial needs of large customers Start date, short / long maturity, currency Manage risks (opportunities) currency / interest rates Interest rate products: Loan, bond, option, future, swap

lore
Download Presentation

A Domain-Specific Language for Financial Products

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Domain-Specific Languagefor Financial Products Arie van Deursen May 2001

  2. Financial Products • Financial needs of large customers • Start date, short / long maturity, currency • Manage risks (opportunities) • currency / interest rates • Interest rate products: • Loan, bond, option, future, swap • Different rate expectations / risk reallocation • Interbank trade.

  3. Principle Amount Flow start maturity Interest Amount Flow start maturity Interest Payment period Deposit Cash Flows

  4. Currency Interest Rate Swap • Start date: Bank A and Bank B exchange a large principle amount. • Bank A: Currency A, fixed interest rate P. • Bank B: Currency B, floating market rate. • Interest payment intervals • Maturity: swap back principle amounts. • Valuation depends on market expectations

  5. Staying Competitive • Banks introduce new interest rate products • Software implications: • Management information systems (risk!) • Financial administration • All sorts or reporting • Bank’s solution: • Software generation

  6. Risla • Rente Informatie Systeem -- Language • Describe essence of interest rate products in domain-specific language • Appropriate level of abstraction • Generate necessary Cobol routines • Interface to bank’s existing systems • Started in 1990 • CAP, MeesPierson, ING, CWI.

  7. The Risla Language • Product characterized by cash flows • Object-oriented influences: • Product description ~ class • Contract ~ object • Product provides methods for access, query, registraction • Various built-in data types + operations • Based on existing Cobol library

  8. Example Risla Data Types • cash flow: <amount, date> • Interval: <start-date, end-date> • cf-list: [<a1,d1>, … <aN,dN>] • rate-interval:<Rate, interval> • int-rate-set: [ri1, …, riN] • balance: [<a1, intv1>, …, <aN, intvN>] • given int-rate-set, balance, and date convention, compute interest amount cash flow list. Unpleasant to express in Cobol

  9. Risla Loan: Interface product LOAN declaration contract data PAMOUNT : amount %% Principal Amount STARTDATE : date %% Starting date MATURDATE : date %% Maturity data INTRATE : int-rate %% Interest rate RDMLIST := [] : cashflow-list %% List of redemptions. information PAF : cashflow-list %% Principal Amount Flow IAF : cashflow-list %% Interest Amount Flow registration %% Register one redemption. RDM(AMOUNT : amount, DATE : date)

  10. Risla Loan: Internals local %% Final Principal Amount FPA(CHFLLIST : cashflow-list) : amount %% Final redemption FRDM : cashflow error checks "Wrong term dates" in case of STARTDATE >= MATURDATE "Negative amount" in case of PAMOUNT < 0.0 implementation local define FPA as IBD(CHFLLIST, -/-PAMOUNT, MATURDATE) define FRDM as <-/-FPA(RDMLIST), MATURDATE>

  11. Risla Loan: Semantics information define PAF as [<-/-PAMOUNT, STARTDATE>] >> RDMLIST >> [FRDM] define IAF as [< -/-CIA( BL(RDMLIST, <-/-PAMOUNT, <STARTDATE, MATURDATE>>), INTRATE ), MATURDATE >] registration define RDM as error checks "Date not in interval" in case of (DATUM < STARTDATE) or (DATUM >= MATURDATE) "Negative amount" in case of AMOUNT <= 0.0 "Amount too big" in case of FPA(RDMLIST >> [<AMOUNT, DATE>]) > 0.0 RDMLIST := RDMLIST >> [<AMOUNT, DATE>]

  12. Risla’s Generated Cobol Risla Product Definition Legacy Data Structures (VSAM) Input Screens (CICS) Risla Compiler Registration Methods (Cobol Management Info. Routines (Cobol)

  13. Modular Risla • Different products share larger chunks: • Swap consists of two Deposits • Various loans share “principal amount construction” • Combinations of product (parts) required • Modularization constructs • Library of “Building Blocks” • “Flattener”, mapping mod. Risla to pure Risla.

  14. Modular Risla (II) • Modularization constructs: • Uses “one”, uses “many” • export, parameterization, renaming. • Example components: • Principle amount, duration, interest computations, • Flattening: • pro: simplicity; con: code size explosion

  15. From Risla to Cobol Risla Building Blocks Risla Functions Cobol Library Modular Risla Flat Risla Flat Risla COBOL ASF + SDF C / lex yacc

  16. Risla Evaluation • Successful adoption • Time to market: 3 months -> 3 weeks. • 100 building blocks, 50 products • Merger survivor thanks to flexibility • Problematic • Maintenance of Risla tools • Flattening code explosion

  17. Benefits Correct level of abstraction. Self documenting Portability Optimizability Testability Risks Cost of DSL design and implementation Education cost Limited availability Finding proper scope Balance between general purpose / domspec Loss of efficiency Domain-Specific Languages

  18. In Conclusion • Risla users satisfied • Open issues • How to decrease cost of tool development and maintenance • How to find suitable domains: domain engineering

More Related