SlideShare a Scribd company logo
1 of 14
远程分析终端
Remote Analytical Service- a value added wrapper for QuantLib
- Jun Hong (jhong111@yahoo.com)
Overview
 Provide instrument level analytical service to clients
 Depend on reference data and analytical library such as QuantLib or
OpenGamma
 Need calendar and holiday management
 May rely on certain index
 Reset when the trading day rolls
 Pick up reference data update at run time
 Could be embedded or remotely accessed
 It should be thread safe
Components
LibFacade
QuantLib
OpenGamma
Security
Bond Future
Instrument Tree
Calendar Factory
Index Factory
Reference Data
Adaptor
Reference Data
Decision
Tree
Java APIMessaging API
Calculation
Engine
Excel
Offering
Service Algo Engine
Process Flow for the Embedded Mode
 Client requests an instrument by an ID
 Embedded module checks the availability of the instrument in the cache
 If found return, otherwise create, cache, and return the object
 The instrument creation is based on reference data and decision tree
 Register a listener for the reference data update for this instrument
 Client invokes an method on the instrument object
 This module has an instance of calendar factory which handles the mapping
among products, country, and market automatically. The factory accepts real
time update.
 The default settlement rule is specified in config file and could be overridden by
reference data
Features
 Hide the low level complexity of analytical library from end users and provide a high level value added
abstraction
 Combine the reference data and analytics transparently and automatically
 Link an identifier to a financial product via reference data and rule based decision tree.
A user may not know a product is a coupon bond or zero coupon bond but our service will figure that
out and let the client know. Then the analytical methods supported for that product will be disclosed.
 More business meaningful analytical functions are exposed
A few examples for bonds include price yield conversion, accrued interest, forward price, duration, dv01,
convexity, z-spread …
Less business meaningful functions, such as how to set the proper day count conversion or holiday
schedule, will not be disclosed
 Can be embedded in an application or remotely accessed
The embedded service has Java API. The remote access protocol will be take advantage of
messaging and Java reflection indirectly.
 Provide load balancing and high availability
Big picture: Layers of Abstractions
 Pricing or Risk Service: end users interact with this layer
 Calculation Engines: deploy related templates into one engine.
 Templates: a group of calculators which define a meaningful business
component. An example could be a curve built based on liquid products
 Calculator: define a specify function such as pricing a liquid product by
aggregating several ECNs’ quotes
 Analytical Service: combine reference data and lib in an intelligent fashion
 Quantitative Libraries: implement the math for different models or products
 Math Formulas: pure math
Note the top layers depends on the lower layers and their business meanings will be
more concrete. Also each layer can be provided to our users as a service.
Services We could Provide to Our Clients at Each Layer
-there is only configuration involved for the top three layers
Layer Example Potential User
A group of engines Future pricing, risk, offering, and
PNL solution
Portfolio manager
Engine (计算引擎) Future risk engine IT team of a bank
Calculator Module (单元模块) A group of calculators handles
bond future risk calculation
IT team of a bank
Calculator (计算单元) A bond future CTD calculator
finds the CTD from a basket of
deliverables
A developer who configure
calculator models
Analytical Service (分析终端) A bond related analytical service
which does price, risk, and
settlement related calculation
A offering service which needs the
calculation on the fly. A spread
sheet developer who need the
dv01 of a bond.
Quantitative Libraries A enhanced version of QuantLib
which does proper calculation for
Chinese Government bonds
No targeted user
Math formula A model’s white paper No targeted user
Big Picture Again
 We have three kinds of data, static reference data, dynamic market data, and
specific user inquiry data.
 If an application is driven by market data, it is event based and real time pushing
is the solution. In most case, our calculation engines fits into here.
 If an application is mainly driven by user inquiries, it is query/response based and
the remote analytical service would be a good candidate for this.
 In both case, the referenced data will be needed to handle the requirements.
 However, the approaches could be combined. For example, a calculation engine
could constantly publish a curve driven by market data. A client could ask the
remote analytical service for the z-spread of a bond’s price against that curve.
QuantLib Example: Price Yield Conversion
Remote Analytical Service Example
 The user’s concern is “I have a bond and I want to do yield price conversion.”
 In this example, the user queries the RAS and gets the response right away
 Behind the scene,
 We gets the ID and retrieve the reference data, such as coupon and maturity
 Realize it is a bond.
 Prepare the cash flow schedule and make a bond object from it.
 The calcPriceFromYield method which is mapped to cleanPrice (double yld) in QuantLib will be
called with the 0.09 as a parameter.
 Return clean price
 Note we will not expose QuantLib methods directly and the client will not be affected if we switch to
another library.
Embedded Version Coding is like this …
Rule Based Decision Used to Identify Instrument Type
 The decision tree is configured in an XML file
 It is based on certain criteria checking against the reference data
 It goes from general to specific as much as possible. For example, if a
checking matches generic bond, coupon bond, and callable coupon bond,
we shall return callable coupon bond as the instrument type.
 Once the best match is found, the corresponding instrument type will be
returned
 An instrument object will be built after that
Security Tree
 Leverage object oriented design to avoid redundancy
 Reference data and analytical methods are organized accordingly
 Help on identify a product type
Security
GenericBond Future Swap Option
ZeroCpnBond CpnBond
Linker CallableBond
BondFuture CmdtyFut
High Performance and Availability
 Deploy multiple instances in load balanced fashion
 Each instance is thread safe and multithreaded
 Preload frequently used instrument objects: liquid products fit into this category
 Intelligent caching helps on optimization
 Instrument object caching
 On a specific day, the prices of a product fluctuates with in limited range and caching
algorithms taking advantage of this phenomenon improves performance considerably

More Related Content

Similar to A wrapper for QuantLib and reference data

Cam cloud assisted privacy preserving mobile health monitoring
Cam cloud assisted privacy preserving mobile health monitoringCam cloud assisted privacy preserving mobile health monitoring
Cam cloud assisted privacy preserving mobile health monitoringIEEEFINALYEARPROJECTS
 
JAVA 2013 IEEE CLOUDCOMPUTING PROJECT Cam cloud assisted privacy preserving m...
JAVA 2013 IEEE CLOUDCOMPUTING PROJECT Cam cloud assisted privacy preserving m...JAVA 2013 IEEE CLOUDCOMPUTING PROJECT Cam cloud assisted privacy preserving m...
JAVA 2013 IEEE CLOUDCOMPUTING PROJECT Cam cloud assisted privacy preserving m...IEEEGLOBALSOFTTECHNOLOGIES
 
Emvigo Data Visualization - E Commerce Deck
Emvigo Data Visualization - E Commerce DeckEmvigo Data Visualization - E Commerce Deck
Emvigo Data Visualization - E Commerce DeckEmvigo Technologies
 
[코세나, kosena] Auto ML, H2O.ai의 보험분야 활용사례
[코세나, kosena] Auto ML, H2O.ai의 보험분야 활용사례[코세나, kosena] Auto ML, H2O.ai의 보험분야 활용사례
[코세나, kosena] Auto ML, H2O.ai의 보험분야 활용사례kosena
 
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia YeResponsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia YeTwo Sigma
 
Comment transformer vos données en informations exploitables
Comment transformer vos données en informations exploitablesComment transformer vos données en informations exploitables
Comment transformer vos données en informations exploitablesElasticsearch
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 
Analytics in Your Enterprise
Analytics in Your EnterpriseAnalytics in Your Enterprise
Analytics in Your EnterpriseWSO2
 
Amplitude wave architecture - Test
Amplitude wave architecture - TestAmplitude wave architecture - Test
Amplitude wave architecture - TestKiran Naiga
 
Cam cloud assisted privacy preserving mobile
Cam cloud assisted privacy preserving mobileCam cloud assisted privacy preserving mobile
Cam cloud assisted privacy preserving mobileIEEEFINALYEARPROJECTS
 
JAVA 2013 IEEE NETWORKSECURITY PROJECT Cam cloud assisted privacy preserving ...
JAVA 2013 IEEE NETWORKSECURITY PROJECT Cam cloud assisted privacy preserving ...JAVA 2013 IEEE NETWORKSECURITY PROJECT Cam cloud assisted privacy preserving ...
JAVA 2013 IEEE NETWORKSECURITY PROJECT Cam cloud assisted privacy preserving ...IEEEGLOBALSOFTTECHNOLOGIES
 
Quant Foundry Labs - Low Probability Defaults
Quant Foundry Labs - Low Probability DefaultsQuant Foundry Labs - Low Probability Defaults
Quant Foundry Labs - Low Probability DefaultsDavidkerrkelly
 
Comment transformer vos données en informations exploitables
Comment transformer vos données en informations exploitablesComment transformer vos données en informations exploitables
Comment transformer vos données en informations exploitablesElasticsearch
 

Similar to A wrapper for QuantLib and reference data (20)

Cam cloud assisted privacy preserving mobile health monitoring
Cam cloud assisted privacy preserving mobile health monitoringCam cloud assisted privacy preserving mobile health monitoring
Cam cloud assisted privacy preserving mobile health monitoring
 
JAVA 2013 IEEE CLOUDCOMPUTING PROJECT Cam cloud assisted privacy preserving m...
JAVA 2013 IEEE CLOUDCOMPUTING PROJECT Cam cloud assisted privacy preserving m...JAVA 2013 IEEE CLOUDCOMPUTING PROJECT Cam cloud assisted privacy preserving m...
JAVA 2013 IEEE CLOUDCOMPUTING PROJECT Cam cloud assisted privacy preserving m...
 
Emvigo Data Visualization - E Commerce Deck
Emvigo Data Visualization - E Commerce DeckEmvigo Data Visualization - E Commerce Deck
Emvigo Data Visualization - E Commerce Deck
 
[IJET-V2I2P8] Authors:Ms. Madhushree M.Kubsad
[IJET-V2I2P8] Authors:Ms. Madhushree M.Kubsad[IJET-V2I2P8] Authors:Ms. Madhushree M.Kubsad
[IJET-V2I2P8] Authors:Ms. Madhushree M.Kubsad
 
[코세나, kosena] Auto ML, H2O.ai의 보험분야 활용사례
[코세나, kosena] Auto ML, H2O.ai의 보험분야 활용사례[코세나, kosena] Auto ML, H2O.ai의 보험분야 활용사례
[코세나, kosena] Auto ML, H2O.ai의 보험분야 활용사례
 
Course Outline Ch 2
Course Outline Ch 2Course Outline Ch 2
Course Outline Ch 2
 
R12
R12R12
R12
 
Sd
SdSd
Sd
 
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia YeResponsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
Responsive and Scalable Real-time Data Analytics for SHPE 2017 - Cecilia Ye
 
Comment transformer vos données en informations exploitables
Comment transformer vos données en informations exploitablesComment transformer vos données en informations exploitables
Comment transformer vos données en informations exploitables
 
Types of Digital Twins.ppt
Types of Digital Twins.pptTypes of Digital Twins.ppt
Types of Digital Twins.ppt
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Analytics in Your Enterprise
Analytics in Your EnterpriseAnalytics in Your Enterprise
Analytics in Your Enterprise
 
CCAR - Kocis
CCAR - KocisCCAR - Kocis
CCAR - Kocis
 
Developing Movie Recommendation System
Developing Movie Recommendation SystemDeveloping Movie Recommendation System
Developing Movie Recommendation System
 
Amplitude wave architecture - Test
Amplitude wave architecture - TestAmplitude wave architecture - Test
Amplitude wave architecture - Test
 
Cam cloud assisted privacy preserving mobile
Cam cloud assisted privacy preserving mobileCam cloud assisted privacy preserving mobile
Cam cloud assisted privacy preserving mobile
 
JAVA 2013 IEEE NETWORKSECURITY PROJECT Cam cloud assisted privacy preserving ...
JAVA 2013 IEEE NETWORKSECURITY PROJECT Cam cloud assisted privacy preserving ...JAVA 2013 IEEE NETWORKSECURITY PROJECT Cam cloud assisted privacy preserving ...
JAVA 2013 IEEE NETWORKSECURITY PROJECT Cam cloud assisted privacy preserving ...
 
Quant Foundry Labs - Low Probability Defaults
Quant Foundry Labs - Low Probability DefaultsQuant Foundry Labs - Low Probability Defaults
Quant Foundry Labs - Low Probability Defaults
 
Comment transformer vos données en informations exploitables
Comment transformer vos données en informations exploitablesComment transformer vos données en informations exploitables
Comment transformer vos données en informations exploitables
 

Recently uploaded

Instant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School SpiritInstant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School Spiritegoetzinger
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managmentfactical
 
Financial institutions facilitate financing, economic transactions, issue fun...
Financial institutions facilitate financing, economic transactions, issue fun...Financial institutions facilitate financing, economic transactions, issue fun...
Financial institutions facilitate financing, economic transactions, issue fun...Avanish Goel
 
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfBPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfHenry Tapper
 
Lundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfLundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfAdnet Communications
 
Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Commonwealth
 
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一S SDS
 
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130Suhani Kapoor
 
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services  9892124323 | ₹,4500 With Room Free DeliveryMalad Call Girl in Services  9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free DeliveryPooja Nehwal
 
Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfMichael Silva
 
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...Suhani Kapoor
 
VIP Call Girls Service Begumpet Hyderabad Call +91-8250192130
VIP Call Girls Service Begumpet Hyderabad Call +91-8250192130VIP Call Girls Service Begumpet Hyderabad Call +91-8250192130
VIP Call Girls Service Begumpet Hyderabad Call +91-8250192130Suhani Kapoor
 
fca-bsps-decision-letter-redacted (1).pdf
fca-bsps-decision-letter-redacted (1).pdffca-bsps-decision-letter-redacted (1).pdf
fca-bsps-decision-letter-redacted (1).pdfHenry Tapper
 
Bladex Earnings Call Presentation 1Q2024
Bladex Earnings Call Presentation 1Q2024Bladex Earnings Call Presentation 1Q2024
Bladex Earnings Call Presentation 1Q2024Bladex
 
The Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh KumarThe Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh KumarHarsh Kumar
 
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptxOAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptxhiddenlevers
 
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service AizawlVip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawlmakika9823
 
Attachment Of Assets......................
Attachment Of Assets......................Attachment Of Assets......................
Attachment Of Assets......................AmanBajaj36
 
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Instant Issue Debit Cards - School Designs
Instant Issue Debit Cards - School DesignsInstant Issue Debit Cards - School Designs
Instant Issue Debit Cards - School Designsegoetzinger
 

Recently uploaded (20)

Instant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School SpiritInstant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School Spirit
 
SBP-Market-Operations and market managment
SBP-Market-Operations and market managmentSBP-Market-Operations and market managment
SBP-Market-Operations and market managment
 
Financial institutions facilitate financing, economic transactions, issue fun...
Financial institutions facilitate financing, economic transactions, issue fun...Financial institutions facilitate financing, economic transactions, issue fun...
Financial institutions facilitate financing, economic transactions, issue fun...
 
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdfBPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
BPPG response - Options for Defined Benefit schemes - 19Apr24.pdf
 
Lundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdfLundin Gold April 2024 Corporate Presentation v4.pdf
Lundin Gold April 2024 Corporate Presentation v4.pdf
 
Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]Monthly Market Risk Update: April 2024 [SlideShare]
Monthly Market Risk Update: April 2024 [SlideShare]
 
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
(办理学位证)加拿大萨省大学毕业证成绩单原版一比一
 
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
VIP Call Girls Service Dilsukhnagar Hyderabad Call +91-8250192130
 
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services  9892124323 | ₹,4500 With Room Free DeliveryMalad Call Girl in Services  9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
 
Stock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdfStock Market Brief Deck for 4/24/24 .pdf
Stock Market Brief Deck for 4/24/24 .pdf
 
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
VIP Call Girls LB Nagar ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With Room...
 
VIP Call Girls Service Begumpet Hyderabad Call +91-8250192130
VIP Call Girls Service Begumpet Hyderabad Call +91-8250192130VIP Call Girls Service Begumpet Hyderabad Call +91-8250192130
VIP Call Girls Service Begumpet Hyderabad Call +91-8250192130
 
fca-bsps-decision-letter-redacted (1).pdf
fca-bsps-decision-letter-redacted (1).pdffca-bsps-decision-letter-redacted (1).pdf
fca-bsps-decision-letter-redacted (1).pdf
 
Bladex Earnings Call Presentation 1Q2024
Bladex Earnings Call Presentation 1Q2024Bladex Earnings Call Presentation 1Q2024
Bladex Earnings Call Presentation 1Q2024
 
The Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh KumarThe Triple Threat | Article on Global Resession | Harsh Kumar
The Triple Threat | Article on Global Resession | Harsh Kumar
 
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptxOAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
OAT_RI_Ep19 WeighingTheRisks_Apr24_TheYellowMetal.pptx
 
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service AizawlVip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
Vip B Aizawl Call Girls #9907093804 Contact Number Escorts Service Aizawl
 
Attachment Of Assets......................
Attachment Of Assets......................Attachment Of Assets......................
Attachment Of Assets......................
 
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in  Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Nand Nagri (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Instant Issue Debit Cards - School Designs
Instant Issue Debit Cards - School DesignsInstant Issue Debit Cards - School Designs
Instant Issue Debit Cards - School Designs
 

A wrapper for QuantLib and reference data

  • 1. 远程分析终端 Remote Analytical Service- a value added wrapper for QuantLib - Jun Hong (jhong111@yahoo.com)
  • 2. Overview  Provide instrument level analytical service to clients  Depend on reference data and analytical library such as QuantLib or OpenGamma  Need calendar and holiday management  May rely on certain index  Reset when the trading day rolls  Pick up reference data update at run time  Could be embedded or remotely accessed  It should be thread safe
  • 3. Components LibFacade QuantLib OpenGamma Security Bond Future Instrument Tree Calendar Factory Index Factory Reference Data Adaptor Reference Data Decision Tree Java APIMessaging API Calculation Engine Excel Offering Service Algo Engine
  • 4. Process Flow for the Embedded Mode  Client requests an instrument by an ID  Embedded module checks the availability of the instrument in the cache  If found return, otherwise create, cache, and return the object  The instrument creation is based on reference data and decision tree  Register a listener for the reference data update for this instrument  Client invokes an method on the instrument object  This module has an instance of calendar factory which handles the mapping among products, country, and market automatically. The factory accepts real time update.  The default settlement rule is specified in config file and could be overridden by reference data
  • 5. Features  Hide the low level complexity of analytical library from end users and provide a high level value added abstraction  Combine the reference data and analytics transparently and automatically  Link an identifier to a financial product via reference data and rule based decision tree. A user may not know a product is a coupon bond or zero coupon bond but our service will figure that out and let the client know. Then the analytical methods supported for that product will be disclosed.  More business meaningful analytical functions are exposed A few examples for bonds include price yield conversion, accrued interest, forward price, duration, dv01, convexity, z-spread … Less business meaningful functions, such as how to set the proper day count conversion or holiday schedule, will not be disclosed  Can be embedded in an application or remotely accessed The embedded service has Java API. The remote access protocol will be take advantage of messaging and Java reflection indirectly.  Provide load balancing and high availability
  • 6. Big picture: Layers of Abstractions  Pricing or Risk Service: end users interact with this layer  Calculation Engines: deploy related templates into one engine.  Templates: a group of calculators which define a meaningful business component. An example could be a curve built based on liquid products  Calculator: define a specify function such as pricing a liquid product by aggregating several ECNs’ quotes  Analytical Service: combine reference data and lib in an intelligent fashion  Quantitative Libraries: implement the math for different models or products  Math Formulas: pure math Note the top layers depends on the lower layers and their business meanings will be more concrete. Also each layer can be provided to our users as a service.
  • 7. Services We could Provide to Our Clients at Each Layer -there is only configuration involved for the top three layers Layer Example Potential User A group of engines Future pricing, risk, offering, and PNL solution Portfolio manager Engine (计算引擎) Future risk engine IT team of a bank Calculator Module (单元模块) A group of calculators handles bond future risk calculation IT team of a bank Calculator (计算单元) A bond future CTD calculator finds the CTD from a basket of deliverables A developer who configure calculator models Analytical Service (分析终端) A bond related analytical service which does price, risk, and settlement related calculation A offering service which needs the calculation on the fly. A spread sheet developer who need the dv01 of a bond. Quantitative Libraries A enhanced version of QuantLib which does proper calculation for Chinese Government bonds No targeted user Math formula A model’s white paper No targeted user
  • 8. Big Picture Again  We have three kinds of data, static reference data, dynamic market data, and specific user inquiry data.  If an application is driven by market data, it is event based and real time pushing is the solution. In most case, our calculation engines fits into here.  If an application is mainly driven by user inquiries, it is query/response based and the remote analytical service would be a good candidate for this.  In both case, the referenced data will be needed to handle the requirements.  However, the approaches could be combined. For example, a calculation engine could constantly publish a curve driven by market data. A client could ask the remote analytical service for the z-spread of a bond’s price against that curve.
  • 9. QuantLib Example: Price Yield Conversion
  • 10. Remote Analytical Service Example  The user’s concern is “I have a bond and I want to do yield price conversion.”  In this example, the user queries the RAS and gets the response right away  Behind the scene,  We gets the ID and retrieve the reference data, such as coupon and maturity  Realize it is a bond.  Prepare the cash flow schedule and make a bond object from it.  The calcPriceFromYield method which is mapped to cleanPrice (double yld) in QuantLib will be called with the 0.09 as a parameter.  Return clean price  Note we will not expose QuantLib methods directly and the client will not be affected if we switch to another library.
  • 11. Embedded Version Coding is like this …
  • 12. Rule Based Decision Used to Identify Instrument Type  The decision tree is configured in an XML file  It is based on certain criteria checking against the reference data  It goes from general to specific as much as possible. For example, if a checking matches generic bond, coupon bond, and callable coupon bond, we shall return callable coupon bond as the instrument type.  Once the best match is found, the corresponding instrument type will be returned  An instrument object will be built after that
  • 13. Security Tree  Leverage object oriented design to avoid redundancy  Reference data and analytical methods are organized accordingly  Help on identify a product type Security GenericBond Future Swap Option ZeroCpnBond CpnBond Linker CallableBond BondFuture CmdtyFut
  • 14. High Performance and Availability  Deploy multiple instances in load balanced fashion  Each instance is thread safe and multithreaded  Preload frequently used instrument objects: liquid products fit into this category  Intelligent caching helps on optimization  Instrument object caching  On a specific day, the prices of a product fluctuates with in limited range and caching algorithms taking advantage of this phenomenon improves performance considerably