MantaAPI
Getting Started (MantaAPI)
17min
this section provides you will all you need to get started using the api should you have any issues however, please to not hesitate to contact us with the following means whatsapp chat support form found on your account page (login or access > your account) 1 api account to use our api, you must first create a mantaapi account you can create a trial account here which is free of charge, or you can choose from one of our plans here for security reasons, the trial plan will require a credit card to be entered, however no money will be taken from your account the subscription process is instantaneaous 2 api key the next step is to generate a key which you will use to programmatically authenticate when using the api once logged into mantarisk, go to access > your account (see screenshot below) here press the generate button the key will be generated and associated to your account please make note of the key! please make note of the key! for security reasons, it will disappear as soon as you exit the page and cannot be retrieved if you happen to have lost your api key, then a new one needs to be generated by pressing the generate button an account can only ever have one api key generating a new key will discard your old one and any system using the old key will no longer be able to access our api 3 test environment our api documentation is hosted on swagger and is available here https //app swaggerhub com/apis docs/mantarisk/rest/0 1 here you can choose to test against one of four environments swaggerhub mock which serves pre canned responses to your requests this is free and constitutes a good way to develop your application against our api any random api key can be used for this service as it is not validated mantarisk production this is the real risk engine which performs on demand analytics to use this you need the api key generated in the previous step calls to this service are charged as per usual calls to this service are charged as per usual mantarisk staging this is our stable test environment it matches the production environment in terms of functionality and is used to run specific tests our clients require access to this environment is provided on demand access to this environment is provided on demand mantarisk development this is where the latest features of our engine are available prior to going live our clients can access this environment to start their development ahead of time access to this environment is provided on demand access to this environment is provided on demand 4 portfolio workflow 4 1 portfolio creation to add a portfolio composition, you must make a put call to the /portfolio endpoint the clientreference field refers to the unique name / identifier you would like to give this portfolio it will allow you to use and retrieve this portfolio in other api calls if you have just started, you will be setup with our built in data source you can learn more about data sources docid\ oscyj5b9caqznpdxhgyra and their coverage here please reach out to us if you require coverage for other asset types such as fixed income make sure your portfolio contains at least 2 instruments here is an example portfolio to get you started https //archbee doc uploads s3 amazonaws com/ 6jmcfowrpd7pg5hglfoz/zb2ieflzdnhttmsbunqck gettingstartedpf 3 json important note important note asynchronous caching and calculations are triggered when a portfolio is loaded it is good practice to wait until these calculation have completed before making use of the portfolio in other api calls the status of the portfolio can be obtained by making a call to the get /portfolio endpoint passing in the relevant client reference the status us available in the field "data load" "100%" 4 2 portfolio analytics your are now ready to obtain your first set of analytics to do this you must use the get /portfolio/analytics endpoint refering the clientreference from the previous step 4 3 portfolio optimisation the portfolio optimisation strategy is controlled from our ui if you are logged in, you can access the strategy builder here , else click on login > mantarisk api we suggest you use our default strategy to start with make note of the number preceeding the name of the strategy this is the strategyid and you will need it for later in the example below 183 your are now ready to optimise your portfolio to do this you must use the /portfolio/rebalance endpoint refering the clientreference and strategyid from the previous steps 5 loading your own pricing data whilst mantarisk provides a default pricing data source, clients may find it desirable to load their own pricing data into the system use cases include ensuring consistency of analytics across the organisation as pricing data sources may have discrepancies; and inputing custom instruments or price curves for the purpose of analytics as a client, you retain ownership of any proprietary data uploaded to the platform and can delete it at any point in time mantarisk ensures strict confidentiality and does not use nor share your data with any third parties unless required by law 5 1 introduction to add add pricing data you will need an instrument a time series (history) to make a call to the put /history endpoint 5 1 instrument object the instrument object contains the following fields ( denotes a mandatory field) identification fields instrument code a unique identifier which will allow you to reference this instrument in other api calls symbol name currency in iso 4217 standard costs calculation fields fixed commission variable commission spread points classification fields sector as per gics energy, materials, industrials, consumer discretionary, consumer staples, health care, financials, information technology, communication services, utilities, real estate industry refer to the 74 gics industries primary country asset type currently supports american depositary receipt, bond, bond fund, closed end fund, common stock, depositary receipt, digital currency, etf, exchange traded note, global depositary receipt, index, limited partnership, mutual fund, physical currency, preferred stock, reit, right, structured product, trust, unit, and warrant important note important note to perform portfolio attribution analysis, instruments must have all classification fields populated these are likely to become mandatory in the future 5 2 history object datetime start of the period (candle) in rfc 3339 section 5 6 format open open price high highest price in that period low lowest price in that period close close price volume can be left to 0 if unavailable 5 3 loading & using the data to load the data, a call to the put /history endpoint must be made the history will be loaded into mantarisk for future use to use your data in other api calls, you will also need an apiid this can be obtained by making a call to get /history/api and noting the apiid corresponding to "api name" "user feed" 6 performance attribution analysis mantarisk's risk and portfolio attribution methodology employs an enhanced brinson model to decompose risk and performance across the following dimensions sectors, asset classes, and domiciles this detailed analysis provides insights into the following key components allocation effect measures the performance impact resulting from overweighting or underweighting specific sectors, asset classes, or domiciles relative to the benchmark selection effect quantifies the value added or subtracted by selecting specific securities within each sector, asset class, or domicile compared to the benchmark interaction effect captures the combined, and often non additive, performance impact of allocation and selection decisions marginal contribution to risk (volatility) determines the individual marginal contribution of each sector, asset class, or domicile to the overall portfolio volatility and compares it the marginal contribution to risk to the overall benchmark volatility" average returns provides the average returns of the each component over the last day and last month periods 6 1 attribution analysis against an index / etf to analyse a portfolio against a specific index or etf use the get index endpoint to consult the list of benchmark indexes / etfs available if what you require is not in the list then please message us https //docs mantarisk com/getting started api we have access to all major indexes as well as circa 9000 etfs so if there is anything missing, we should be able to add it use the get /index/attribution endpoint to run the analysis 6 2 attribution analysis against a portfolio to analyse a portfolio against another (benchmark) portfolio load the relevant portfolios using the put /portfolio endpoint as usual the attribution analysis can then be run with a call to the get /portfolio/attribution endpoint using the client reference of the portfolio you want to analyse and the client reference of the portfolio you want to use as benchmark