Giter VIP home page Giter VIP logo

strata's Introduction

Strata

Strata Build Status License

This repository contains the source code of Strata, the open source analytics and market risk library from OpenGamma.

Strata is released as Open Source Software under the Apache v2.0 license.

OpenGamma

Using Strata

Documentation for Strata can be found at the Strata home page.

To use Strata Java SE 8u40 or later is required. The JAR files are available in Maven Central:

<dependency>
  <groupId>com.opengamma.strata</groupId>
  <artifactId>strata-measure</artifactId>
  <version>2.12.0</version>
</dependency>

The JAR files, along with the command line tool and examples, can also be obtained from the Strata Releases page on GitHub.

Building Strata

The source code can be cloned using git from GitHub:

  git clone https://github.com/OpenGamma/Strata.git

The projects use Apache Maven as the build system. Version 3.5.0 or later is required. Simply run this command to compile and install the source code locally:

  mvn install

Strata is based on Java SE 8. Our continuous integration regularly builds on both Java 8 and Java 11. When using Java 8, version 8u40 or later is required due to bugs in earlier versions. We do not recommend use of non-LTS releases, such as Java 9, 10 and 12 to 16.

The Strata examples project includes a GUI based on JavaFX. On Java 8, this will be excluded from compilation if JavaFX is not available in the JDK. On Java 11, OpenJFX is included as a jar file from Maven Central, so the GUI is always compiled.

We recommend builds of OpenJDK from providers other than Oracle, notably Amazon Corretto and Adoptium.

For more information about developing code on Strata see the documentation.

Status

Strata is well-maintained, tested and functional. It is used in production as the core of OpenGamma SaaS Analytics. The API will be maintained with backwards compatibility in mind.

Strata modules

Strata is formed from a number of modules:

strata's People

Contributors

akshaishah avatar anand-uk avatar andreiruse avatar ashleyheath avatar beajeanm avatar benhamilton-brown avatar brianweller89 avatar christianog avatar cjkent avatar daminuk avatar davidcervi avatar dependabot-preview[bot] avatar dependabot[bot] avatar doughertyaaron95 avatar headphonejack avatar ivaylovarbanov avatar jacbop avatar james-opengamma avatar jodastephen avatar jonathansenior avatar jordanmorrison476 avatar julianhowarth avatar marc-henrard avatar martynassateika avatar mistuus avatar opengammacibot avatar r-weeks avatar santorog avatar skitini avatar yukiiwashita avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

strata's Issues

Better handling of missing market data mappings

If a set of market data mappings has no mapping for a market data key, the result is a call to a default mapping that throws an exception. This will cause the engine to fail non-gracefully.

A better approach would be for the mappings to return a market data ID containing details of the problem. A corresponding MarketDataBuilder could be created that always returns a failure in the market data with a description of the cause.

Better handling of missing market data rules

If a set of market data rules doesn't match a calculation target, the result is a call to a default mapping that throws an exception. This will cause the engine to fail non-gracefully.

A better approach would be for the mappings to return a market data ID containing details of the problem. A corresponding MarketDataBuilder could be created that always returns a failure in the market data with a description of the cause.

Include failures in BaseMarketData and ScenarioMarketData

Currently the market data containers only contain valid market data. Any failures that occur when building market data are returned separately. The reasoning behind this design is that failures are transient and probably shouldn't be persisted with market data.

This design isn't so good when using the higher level CalculationEngine API. Details of the failures are discarded and the calculation results contain error messages that say "No market data available for XYZ" without any details of why the market data was not available.

The failures should be included in the market data so the errors in the results can include the details of why the market data is not available.

Ability to calculate multiple measures at once

Performance optimisation for groups of measures which can be calculated together more efficiently than they can be calculated separately.

In the simplest example, for swaps, we have measures for PV, and PV of an individual leg. With this optimisation each leg would only have to be priced once in order to return all three measures.

Curve calibration: support for node knockout

In an interpolated curve definition, we need the ability to:

  • at the curve level, specify a minimum period between nodes
  • at the node level, specify a relative node priority

When processing the curve definition prior to calibration, the builder should identify any pair of nodes that infringe the minimum period and drop the node with the lowest relative priority to resolve the infringement.

This is useful when some nodes occur at fixed dates which move relative to the valuation date (futures), and others are a fixed period from the valuation date.

Investigate behaviour of WrappingVectorEngineFunction WRT aggregation

WrappingVectorEngineFunction invokes a scalar function multiple times to calculate values for multiple scenarios and packs the values into a list. When the number of scenarios is 1 it unpacks the list and returns the single value.

This behaviour makes sense if the user is consuming the trade level results, but not so much if the results are being fed into an aggregation function. In order to handle this behaviour:

  • The aggregation function would have to handle both list and single values
  • A different aggregation function would be needed depending on the number of scenarios

Neither of these options smells good.

Maybe the unwrapping behaviour in the function should be aware of what's consuming the results. Although that's not particularly elegant.

Or maybe the behaviour should be revert to the original behaviour of always producing a list. This would allow a consistent API for aggregation. For the case where there is only a single scenario, the results could be unpacked from the lists as a final post-processing step on the Results.

Curve calibration: support for overriding the tenor associated with a node

By default the instrument implies the node date passed to the analytics during calibration (and the subsequent x value of that node on the calibrated curve), but it needs to be possible to override this regardless of the date implied by the instrument.

This is primarily to support node dates that align with ECB meeting dates. In this case, the node date would be defined as an index (after the current date) into a list of meeting dates.

We may also want to support overriding the node date to an alternative absolute or relative date as part of this.

Merge pricer and pricer-impl

Separating the API from the Implementation for pricers is a good idea, but struggles to work in practical terms. The interfaces in pricer are fine, except that they are never likely to have an alternate implementation. Fast pricers will be totally different. And alternate models tend to need to take in different parameters.

Delete strata-pricer-impl and merge all code into strata-pricer.

Conventions and Templates

Add support for conventions and templates in preparation for curve nodes.

A Template will consist of one or more underlying conventions. Templates will be persisted, conventions may be.

ObservablesMapping is redundant

Since the changes in commit #72, observable market data has been treated separately from other market data in the market data factory. This means it is possible to get rid of ObservablesMapping and for MarketDataMappings to contain the MarketDataVendor and to call MarketDataKey.toObservableId directly.

Curve calibration: support for a spread curve definition

Defined simply as a curve that references two other curves. The value on the calibrated spread curve at any given tenor is the sum of the values on the other two curves at that tenor.

The two other curves may themselves be spread curves, or a more primitive type of curve.

Reporting API with support for extensible report types

High-level API which operates in terms of reports - at the closest level to the business user.

Each supported report type would be produced through a two-step process:

  1. Invoking the CalculationEngine API to obtain the set of results necessary to produce the report.
  2. Transforming the calculation engine results into the report format.

It should be possible to save the results of step 1 and run step 2 independently. This would allow an advanced user to produce a set of calculation results (via step 1 or separately through the CalculationEngine) which can be transformed into many different reports.

This is the level at which, for example, expression-based columns would be evaluated.

Unite result models

There are currently two result models, and this should be resolved into one.

Proposal is for the combined result to be keyed by int indices, to minimise the serialized form. For efficiency, a single array with (row * columnSize + column) will probably need to be used.

If we add column names as a concept, then the result model could also contain "Trade Id" and "Column Name" lists, similar to the API of Guava Table.

PV01 and Gamma: add an approximation test

PV01 and Gamma are tested by replicating the formulas in the tests. They should also be tested by a local expansion: write the change of PV as an expansion in Delta and Gamma and compare with the full reval value.

Curve calibration: support for an inflation curve definition

Much like an interpolated curve definition, but:

  • nodes are only ZC inflation swaps
  • the curve definition probably includes seasonality adjustments (a list of 12 monthly adjustments to be repeated each year) to be applied during calibration

Define a RiskEngine API

This is the higher level API that will be the default way for users to perform calculations.

Replace SimpleMarketDataRules with a full implementation

SimpleMarketDataRules provides very limited functionality and was a placeholder implementation to get us up and running. It needs to be replaced with a MarketDataRules implementation that provides more power and flexibility, similar to DefaultPricingRules.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.