# Package com.opengamma.strata.product

Entity objects describing trades and products in financial markets.

A Trade is the basic element of finance, a transaction between two organizations, known as counterparties. Most trades represented in the system will be contracts that have been agreed on a date in the past. The trade model also allows trades with a date in the future, or without any date.

A Security is a standard contract that is traded, such as an equity share or futures contract. Securities are typically created once and shared using an identifier, represented by a SecurityId. They are often referred to as reference data. Securities may also be stored in a Position instead of in a Trade.

A Product is the financial details of the trade or security. A product typically contains enough information to be priced, such as the dates, holidays, indices, currencies and amounts. There is an implementation of Product for each distinct type of financial instrument.

Trades are typically classified as Over-The-Counter (OTC) and listed.

An OTC trade directly embeds the product it refers to. As such, OTC trades implement ProductTrade.

For example, consider an OTC instrument such as an interest rate swap. The object model consists of a SwapTrade that directly contains a Swap, where SwapTrade implements ProductTrade.

The key to understanding the model is appreciating the separation of products from trades. In many cases, it is possible to price the product without knowing any trade details. This allows a product to be an underlying of another product, such as a swap within a swaption.

A listed trade can be defined in two ways.

The first approach is to use SecurityTrade. A SecurityTrade stores just the security identifier, quantity and trade price. When the trade needs to be priced, the identifier can be resolved to a Security using ReferenceData. The reference data could be backed by an in-memory store or a database.

The second approach is to use a more specific trade type, such as BondFutureTrade. These types include the product details directly so that no reference data is needed. As such, this approach avoids the need to use the Strata Security classes.

For example, consider a bond future. In the first approach, the application would create a SecurityTrade using the identifier of the future. The reference data would be populated, mapping the identifier to an instance of BondFutureSecurity and additional identifiers for each of the underlying FixedCouponBondSecurity instances.

In the second approach, the trade would be defined using BondFutureTrade. In this case, the trade directly holds the product model of the BondFuture and each underlying FixedCouponBond. There is thus no need to populate the reference data with securities.

The key to understanding the model is appreciating the separation of products from trades and securities. It is often possible to price either against the market or against a model. Details for pricing against the market are held in the security. Details for pricing against the model are held in the product.