Using Strata in C# .net project


#1

Hi Good Folks at OpenGamma, We are trying to use Starta for doing some risk analysis in our project.
Please can you share with us pointers of how we can use Strata in our existing . NET application.
One of the ways could be exposing functionality as API over http or sockets and then consuming , however we are looking it to add as resource in our application , so that we can directly call the Starta API methods.
I am pretty sure this use case is not unique and few folks must have already done this.

Thanks
Dev


How to Use SIMM Lib for ALL Asset Classes to get Initial Margin
#2

Hi Good Developer!

We don’t have any specific support available for using Strata in a .NET project. More generally however, the issue of using Java libraries in C# code isn’t an unvisited one, and there are several resources available online which you may find useful:

http://www.ikvm.net/
http://jni4net.com/
http://www.ezjcom.com/?gclid=CJflqrms9ZUCFRqH1QodPSb_hA

Kind regards,
Roman


#3

ikvm worked for us.
However the order for jars files matters while using it.

Below are the steps which helped us to create .net proxies:

  1. Download latest package for ikvm, we used this version ikvmbin-8.1.5717.0
  2. Extract the downloaded folder and paste starta-dist-1.0.0 jar files in bin folder of ikvm
    3.Open command prompt in administrator mode from bin folder in ikvm.
    4.Run the following command:
    ikvmc -target:library -out:C:\Test\StartaNet.dll strata-basics-1.0.0.jar strata-calc-1.0.0.jar strata-collect-1.0.0.jar strata-data-1.0.0.jar strata-loader-1.0.0.jar strata-market-1.0.0.jar strata-math-1.0.0.jar strata-measure-1.0.0.jar strata-pricer-1.0.0.jar strata-product-1.0.0.jar strata-report-1.0.0.jar joda-beans-1.7.jar joda-convert-1.8.1.jar slf4j-api-1.7.21.jar guava-19.0.jar colt-1.2.0.jar commons-math3-3.6.1.jar concurrent-1.3.4.jar
    5.The above command will generate StartaNet dll in c: directory under test folder.
    6.Add reference of the created dll in your project along with dlls provided by ikvm and you are good to use magic of opengamma library.

In case of any queries or issues with above steps , you can write to me at : sukhdev.sharma@outlook.com


#4

That sounds great - thanks for following up. Glad you are now able to use Strata from C#!


#5

Magic! Thanks, Sukdev