Derivatives Trading DB2 XML
Derivatives Trading DB2 XML
Cynthia M. Saracco
June 2007
Executive Summary
Trading in over-the-counter (OTC) and exchange-based derivatives has grown
tremendously during the past several years and shows little sign of abating. As Fig. 1
illustrates, the notional amounts for all OTC derivatives reached $415 trillion in
December 2006 – up from $285 trillion in December 2005 and $111 trillion in December
2001. 1 Similarly, the number of exchange-traded futures and options contracts reached
nearly 11.9 billion in 2006, up from 10 billion in 2005. 2 A variety of factors are fueling
this rapid growth, including market volatility, an increased focus on managing risk, and
increased activity from hedge funds, banks, insurance firms, and other parties.
1
OTC derivatives market activity reports issued twice yearly by the Bank for International Settlements.
2
Burghardt, G. “Annual Volume Survey: 11,859,266,610 contracts traded,” Futures Industry, March/April
2007.
1
This paper explores the unique business characteristics of derivatives trading
applications, explains their impact on traditional information management systems, and
describes how pureXML™ database management technology available in IBM’s DB2
addresses the challenging XML data processing and performance requirements associated
with trading derivatives. For those unfamiliar with derivatives, Appendix A provides a
very brief introduction.
Business requirements
Financial institutions seeking to serve as effective buyers, sellers, or custodians of
derivatives need to address several business challenges, including the need to
Failure to adequately address these requirements can lead to greater operational risk,
legal penalties, and unnecessary expenses.
Table 1 outlines several of the activities that occur throughout the lifecycle of a
derivatives trade, which includes pre-trade, trade, and post-trade stages.
2
Stage Activity Definition
Trade affirmation or Trade details may be provided by one party
matching and affirmed by the other, or each party
may exchange records for matching.
Confirmation Final confirmation of the trade details are
secured and exchanged. Confirmations
may be paper- or electronic-based.
Settlement Cash or other assets are exchanged per the
terms of the contract.
Clearly, buyers and sellers need to exchange information, and both parties may need to
receive information from or provide information to other sources. For example, buyers
and sellers often rely on third parties for market research, pricing information, market
volatility data, and other relevant information. Furthermore, firms serving as custodians
of the contract need to maintain information about terms and conditions, as well as ensure
that these are properly settled. Such information must also be recorded and shared
among appropriate parties.
For example, in 2005 the UK Financial Services Authority contacted major derivatives
dealers in London about the growing confirmation backlogs of credit derivatives, which
the International Swaps and Derivatives Association (ISDA) found to be averaging 23
trading days. Representatives of various UK and American firms discussed how to
improve the situation, and process automation emerged as a key initiative. The
Depository Trust & Clearing Corporation (DTCC) began offering electronic services to
minimize the inherent risk of confirming trades via fax or phone. Today, the percentage
of electronically confirmed trades has doubled, significantly reducing confirmation
backlogs for credit derivatives trades. However, backlogs still exist and remain at
undesirably high levels for certain types of derivatives.
To promote the exchange of derivatives data and help firms automate their processing,
industry consortiums have turned to XML, a standard in the technology industry
developed by World Wide Web Consortium (W3C). Known for its flexibility, XML
enables firms to model business data in a self-describing format. XML is widely used for
various applications; for example, Web pages are written in the hypertext mark-up
language (or HTML), which is one form of XML.
3
Adapted from New developments in clearing and settlement arrangements for OTC derivatives, Bank of
International Settlements, March 2007.
3
Financial institutions that belong to the ISDA have defined an XML format for OTC
derivatives transactions. This format, the Financial Products Markup Language or
FpML, has become an increasingly popular means for representing and exchanging many
types of derivatives data. A number of software vendors now support FpML, and several
industry organizations have recommended or adopted it. These include the Society for
Worldwide Interbank Financial Telecommunication (SWIFT), the Asset Managers
Forum (AMF), and the International Securities Associate for Institutional Trade
Communication (ISITC). Of course, derivatives data can be captured in other XML
formats, including those proprietary to a given software vendor or financial institution.
The hierarchical and varying nature of XML formats that model derivatives presents
challenges for many DBMSs. Often, only two fundamental modeling options are
available: decomposing (or “shredding”) the data across numerous table columns or
storing the data intact within a character or binary large object (CLOB or BLOB) column
of a table. Each technique has disadvantages.
Storing the derivatives data as large objects makes searching, updating, and retrieving
portions of contracts expensive because the database system doesn’t understand the
internal structures of these objects. Decomposing the contracts and transforming the data
into non-XML data types can involve complex, labor-intensive mappings. Resulting
database schemas are often unwieldy, requiring numerous tables to capture all possible
attributes of interest, including those that are important to only a small number of
contracts. Such a design leads to sparsely populated tables, wasting space and creating
greater administrative overhead. Writing the code necessary to retrieve (or query)
information stored in numerous tables is often labor-intensive and error-prone.
4
integrity constraints, new user access privileges, and new application code.
Implementing these changes can be expensive and time-consuming.
5
Fig 2. DB2 hybrid data server architecture optimized for relational and XML data
Internal studies and early customer experiences have shown that DB2’s hybrid
architecture can reduce labor requirements, shorten development cycles, and provide
strong runtime performance. For example, Storebrand, a Norwegian financial services
firm, compared DB2’s pureXML support with relational technology for various
situations. 4 It found that pureXML enabled them to
IBM benchmarks also confirm that pureXML technology can provide 2- to 5-times faster
performance for concurrent insert operations and up to 40 times faster performance for
certain types of queries when compared with relational alternatives.
The following sections explore how DB2 pureXML addresses the information
management challenges associated with derivatives trading.
DB2’s approach is more flexible than certain other approaches. For example, DB2
doesn’t mandate that all data in a single XML column conform to a given schema, which
4
Saracco, C. and D. Chamberlin, R. Ahuja. DB2 pureXML Overview and Fast Start, IBM Redbook
Chapter 1, July 2006.
6
is often a requirement of systems that decompose or shred XML data behind the scenes.
Furthermore, DB2 supports evolving XML schemas (varied structures) by enabling
different XML documents within a given column to be validated against different
versions of the same schema. This minimizes administrative overhead and labor.
DB2 features a shared query processing engine for its relational and XML data, providing
firms with high performance for queries that involve either type of data (or both). It
automatically evaluates all queries using cost-based optimization techniques so that it can
select an efficient data access strategy. Query language translation never occurs in DB2.
In other words, DB2 does not transform a query written in the standard XML query
language (XQuery) into the standard relational query language (SQL) before processing.
This approach saves time and avoids semantic inconsistencies that can otherwise result.
Performance concerns often prompt firms to demand specific proof points, usually in the
form of published benchmarks. Because of this, IBM ran comparative tests involving
various database design (and storage) alternatives for DB2. While results for any given
workload can vary, it’s helpful to review some baseline data. Significant results of
IBM’s study 5 include:
5
Nicola, M. and V. Rodrigues. “A performance comparison of DB2 9 pureXML and CLOB or shredded
XML storage,” IBM developerWorks, Dec. 2006.
7
Furthermore, separate scalability studies conducted by Intel 6 and IBM 7 on different
hardware platforms revealed positive results for DB2’s pureXML technology. Both
studies involved simulations of more than 100 concurrent users accessing FIXML data
stored natively in DB2. (FIXML is the XML version of the Financial Information
eXchange messaging standard for securities transactions.) Results demonstrated near-
linear scalability for read-only workloads as well as high levels of scalability for
read/write workloads. Throughput rates involved thousands of queries and inserts per
second – significant results for the hardware platforms tested.
Although FIXML and FpML differ in many respects, they impact a database
management system in similar ways. Both include numerous XML schema documents,
hundreds of type definitions, and thousands of elements and attributes. Many of these
elements and attributes are optional, and only a relatively small number may be present in
any given FIXML or FpML message. These are some of the characteristics that make
such data well-suited to DB2 pureXML technology.
Indeed, a large securities processing firm recently evaluated DB2’s pureXML capabilities
for managing derivatives trading data. The firm concluded that DB2 pureXML provided
certain performance benefits and enabled it to avoid creating complex, fragile mappings
between its FpML data and tabular structures. It also found DB2’s interoperability
between XML and SQL to be “impressive.”
With DB2, firms can access their data using either or both of these query languages. By
contrast, some systems require programmers to “wrap” their XQueries in SQL before the
database system will process them. This can introduce added complexity and may
present challenges for skilled XPath developers who have minimal SQL experience.
While DB2 supports “hybrid” queries that embed XQueries in SQL or vice versa, it
doesn’t mandate their use. Instead, developers are free to express their queries in the
language – or language combination – they find most convenient and appropriate for their
work.
Finally, DB2 pureXML supports familiar tools, utilities, and programming languages to
help administrators and programmers become productive quickly. Administrators can
work with common facilities to monitor and tune performance, import and export data,
6
DB2 pureXML scalability on Intel Xeon MP Platforms using IBM N Series Storage, Intel paper, 2006.
7
Kogan, I. and M. Nicola, B. Schiefer. “DB2 9 XML performance characteristics,” IBM developerWorks,
Jan. 2006.
8
back up and recover data, and so on. Programmers can access XML data stored in DB2
through Java, .Net, PHP, C, and other popular interfaces.
Each industry-specific package contains code to create database objects that store and
index XML data, register an industry-specific XML schema (such as FpML), populate
the database with sample XML data that conforms to the registered schema, and create
stored procedures that query the sample XML data. The source code for all scripts and
stored procedures is provided for easy customization. See the “References” section for
details on where to download these packages.
Summary
Rapid growth of derivatives trading is prompting firms to seek greater levels of
automation throughout the trade cycle to keep pace with market demands, reduce risk,
and respond to regulatory pressures. As a result, firms are adopting XML as the
preferred format for exchanging electronic data. XML’s flexible, self-describing nature
makes it well suited for coping with the diverse and complex characteristics inherent in
derivatives. Unfortunately, this very flexibility poses challenges for traditional database
management systems.
To learn more about how DB2 can help with your derivatives trading application, consult
the materials cited in the “References” section or contact your IBM account
representative.
9
About the author
Cynthia M. Saracco is a senior solutions architect at IBM’s Silicon Valley Laboratory
who specializes in emerging technologies and database management topics. She has
more than 20 years of software industry experience, has written 3 books and more than
50 technical papers, and holds 6 patents. Her email address is [email protected].
Acknowledgments
Thanks to Suzanne Dence, Zohar Hod, Sean Linehan, Susan Malaika, Matthias Nicola,
and Philip Schwartz for their help with this paper.
10
Appendix A: About derivatives
A derivative is a financial instrument based upon (or derived from) some asset, such as a
stock or stock index (in the case of an equity derivative). Two parties agree to exchange
cash or something of value based upon conditions affecting the underlying asset.
Typically, one party uses the trade as a way to mitigate (or hedge against) risk; the other
party uses the trade as a way to gain immediate income (through fees or premiums)
and/or to speculate that future market conditions will provide profits.
Two short examples may help clarify these concepts. An equity option derivative might
give Party A the option to sell 1000 shares of IBM stock to Party B at $90 per share in
one year’s time. Party A might seek such a contract if he believes IBM’s share price,
currently trading at $93, will drop below $90. To hedge against this, he’s willing to pay a
fee for the right to sell the stock the following year for $90 per share. Party B might
speculate that IBM stock will exceed $90 per share by the contract settlement date and
seek to profit from the up-front fees.
A credit default swap derivative could involve two financial institutions agreeing that one
institution will assume the credit risk for a loan. Perhaps Bank A loaned $10 million to
an airline. The loan provides Bank A with a favorable income stream, but it also carries
risk. Officials at Bank A may fear that rising fuel prices, labor unrest, and competitive
pressures could force the airline to default on its loan. To hedge against this type of credit
event, Bank A negotiates with Bank B to purchase protection. In essence, Bank A agrees
to pay Bank B periodic fees (premiums) to insure itself against the airline’s failure to pay.
If a default occurs, Bank B will pay a specified sum to Bank A.
Derivatives can be divided into three general classes: futures/forwards, which involve
buying or selling an asset at a future date; options, which give one party the option to sell
an asset at a future date; and swaps, which enable two parties to exchange cash or other
assets. The assets underlying different classes of derivatives can vary but often involve
equities, interest rates, credit events, commodities, or foreign exchange rates.
It’s important to recognize that derivatives are complex financial instruments that vary
considerably. Their life span often ranges from months to years, and their terms and
conditions may change over time. Indeed, even the parties involved may change over the
life of a derivatives contract, as one party may assign its position to another (novate).
11
References and free software downloads
About derivatives
Committee on Payments and Settlement Systems: New developments in clearing and
settlement arrangements for OTC derivatives, Bank for International Settlements, March
2007.
Monetary and Economic Department: OTC Derivatives market activity reports, issued
twice yearly by the Bank for International Settlements.
DB2 pureXML scalability on Intel Xeon MP Platforms Using IBM N Series Storage, Intel
white paper, 2006.
Kogan, Irina and Matthias Nicola, Berni Schiefer. “DB2 9 XML performance
characteristics,” IBM developerWorks, updated Jan. 2007.
Malaika, Susan. “Get started with industry formats and services with pureXML,” IBM
developerWorks, May 2007.
Saracco, C. M. and Don Chamberlin, Rav Ahuja. DB2 pureXML: Overview and fast
start, IBM Redbook # SG24-7298-00, July 2006.
“Storebrand on SOA and DB2 pureXML,” video interview with Thore Thomassen of
Storebrand, February 2007.
These books and papers, as well as other technical materials, are available from the DB2
pureXML Wiki at http://www-03.ibm.com/developerworks/wikis/display/db2xml/Home
12
© Copyright IBM Corporation, 2007
IBM
Armonk, NY
USA
Neither this documentation nor any part of it may be copied or reproduced in any form or by any means or translated into another language,
without the prior consent of the IBM Corporation.
DB2, DB2 Universal Database, IBM, and the IBM logo are trademarks or registered trademarks of International Business Machines
Corporation in the United States, other countries or both.
Other company, product and service names may be trademarks or service marks of others.
The following paragraph does not apply to the United Kingdom or any other country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Some states do not allow disclaimer of express or implied warranties in certain transactions, therefore, this statement may not apply to you.
Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating
environments may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee
that these measurements will be the same on generally available systems. Furthermore, some measurement may have been estimated
through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment.
The information contained in this document is subject to change without any notice. IBM reserves the right to make any such changes
without obligation to notify any person of such revision or changes. IBM makes no commitment to keep the information contained herein up
to date.
13