cURL Python

Introduction

API Base URL:

https://api.everysk.com

Everysk API is organized around the open standard protocol REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. All API responses are returned in JSON, including errors.

We also have some specific language examples to make integration easier. You can switch the programming language of the examples with the tabs in the top right. You can request a Trial API Key at Contact Us.

Versioning

You can pass a specific API version such as:

https://api.everysk.com/v2

When we make backwards-incompatible changes to the API, we release new versions. Each API we provide has a separate version (listed below).

Version Status
v2 Current
v1 Deprecated

The current version of the Everysk API is v2.

Authentication

A request example with arguments:

curl https://api.everysk.com/v2/health_check \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -G

Alternatively pass a Bearer token in an Authorization header:

curl https://api.everysk.com/v2/health_check \
  -H "Authorization: Bearer YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN" \
  -G
import requests

url = 'https://api.everysk.com/v2/health_check'
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN'
}

requests.request('GET', url, headers=headers)

The above call returns a JSON structure like this:

{
  "api_status": "OK",
  "version": "v2",
  "name": "Everysk API"
}

The API uses exclusive POST HTTP method to access resources URI. In the POST, you represent the arguments of methods in JSON encoded dictionary in the request body.

The maximum JSON encoded payload size is 1MB. Be sure to encode the following HTTP Content-Type header for your requests: "application/json"

Authenticate your account when using the API by including your secret API key in the request. Authentication to the API is performed via HTTP Basic Authentication. In short, you will use your Everysk API Account SID as the username and your Auth Token as the password for HTTP Basic authentication. API requests without authentication will fail. You can manage your API keys in the API Settings. Be sure to keep your Account SID and Auth Token secret.

The API is served over HTTPS. Calls made over plain HTTP will fail.

Errors

An error response example:

{
  "code": 400,
  "message": "Bad Request - Please visit https://www.everysk.com/api/docs for more information."
}

The API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, etc.), and codes in the 5xx range indicate an error with Everysk's servers.

HTTP Status Code Summary:

Code Message Description
200 OK Everything worked as expected.
400 Bad Request The request was unacceptable. This could be due to a missing required field, an invalid parameter, etc.
401 Unauthorized No valid credentials provided.
403 Forbidden The credentials provided do not have permission to access the requested resource.
404 Not Found The requested resource doesn't exist.
429 Too Many Requests Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
5XX Server Errors Something went wrong with Everysk Servers.

Rate limiting

Example on how to check the remaining requests in the current window:

curl -i https://api.everysk.com/v2/health_check \
  -G

Example of HTTP header response:

TODO não está retornando os limites
HTTP/2 200
content-type: application/json; charset=utf-8
x-everysk-request-id: ed888caa18904ca5b5f05e305ab11551
x-everysk-request-duration: 81.3500881195
x-everysk-rate-limit-allowed: 60
x-everysk-rate-limit-remaining: 49
x-everysk-rate-limit-reset: 10

Example rate limit error response:

{
  "code": 429,
  "message": "Too Many Requests - You've exceeded the rate limit for your api account SID. Please try again using truncated exponential backoff."
}

Everysk API is rate-limited to 60 requests per minute as default, depending on the applicable plan. This safety limit is set by Everysk to protect the integrity of our system. If you exceed the limit established in your plan, any request you send will return a 429 error: "Too Many Requests". If you require a higher limit, please contact us.

The API will respond to every request with five HTTP headers, providing additional information about the status of the request:

Header Description
X-Everysk-Request-Id This header provides a unique identifier for your request. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution.
X-Everysk-Request-Duration This header specifies the amount of time that Everysk servers spent processing this request, in milliseconds.
X-Everysk-Rate-Limit-Allowed This header provides the number of requests you are allowed per 1 minute window.
X-Everysk-Rate-Limit-Remaining This header provides the number of requests you can make before hitting the limit.
X-Everysk-Rate-Limit-Reset This header provides the remaining window before the rate limit resets, in seconds.

Pagination

TODO

Calculation

Endpoints

POST    /calculations/risk_attribution          
POST    /calculations/stress_test
POST    /calculations/exposure         
POST    /calculations/properties

TODO: The Calculation API provides the user with a way to obtain a variety of important information and parameters for advanced risk and portfolio management.

Was this section helpful? Yes No

Risk Attribution

To calculate the MCTR, run the following:

curl https://api.everysk.com/v2/risk_attribution \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -d '{ 
        "securities": [ 
          { 
            "id": "id1", 
            "symbol": "AAPL", 
            "quantity": 1000.0 
          }, 
          { 
            "id": "id2", 
            "symbol": "SIE:XETR", 
            "quantity": 750.0 
          } 
        ], 
        "date": "20191120", 
        "projection": ["SPY"] 
      }' \
  -X POST
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Calculation.exposure(
  securities = [
    {
      "id": "id1",
      "symbol": "AAPL",
      "quantity": 1000.0
    },
    {
      "id": "id2",
      "symbol": "SIE:XETR",
      "quantity": 750.0
    }
  ],
  date = "20191120"    
)

The above call returns the following JSON object:

{
  "risk_attribution": {
    "results": [
      {
        "id": "id1",
        "mctr": [
          {
            "projection": "IND:SPX",
            "value": 0.078389670147772
          },
          {
            "projection": "residual",
            "value": 0.088026106319567
          }
        ]
      },
      {
        "id": "id2",
        "mctr": [
          {
            "projection": "IND:SPX",
            "value": 0.026127173471164
          },
          {
            "projection": "residual",
            "value": 0.019947120086014
          }
        ]
      }
    ],
    "unmapped_tickers": []
  }
}

The goal of risk attribution is to calculate the contribution to the overall portfolio risk from each security. We use a measure called Marginal Contribution to Total Risk (MCTR) for risk attribution.

To compute the risk attribution (MCTR) for a portfolio, make an HTTP POST to your calculation resource URI:

HTTP Request

POST /calculations/risk_attribution

HTTP Parameters

Parameter Description
securities array REQUIRED It is an array of objects that describes the securities in the portfolio. Each object represents a security with a unique id, symbol, quantity and label. For more details click here.
date string date optional, default is null (today) Portfolio date in the format: "YYYYMMDD". The Portfolio Date is important because it instructs the API to use the market conditions and security prices prevailing on that date. Therefore, historical portfolios will be calculated without look ahead. In order to run the portfolio using market conditions prevailing today, use null. The furthest historical date allowed by the API is a year ago from today.
base_currency string optional, default is "USD" 3-letter ISO 4217 code for currency. Portfolios can have their base currency changed via the API call. By changing the base currency, a new set of currency risks is automatically taken into account. For all supported currencies click here.
nlv double optional, default is null (calculated) The net liquidating value of the portfolio (also called NAV). When not supplied by user, the API will calculate the net liquidating value of all the cash securities. Securities traded on margin are assumed to have nlv zero. Supplying an NLV effectively reconciles the margin.
horizon integer optional, default is 5 Forecast horizon in days: 1, 5, 20, 60 or 120.
aggregation string optional, default is "position" (no aggregation) Aggregation computes individual security MCTR's and aggregates them according to the supported criteria: "position", "liquidity", "market_capitalization", "sector", "country_of_risk", "implied_rating", "duration", "dividend_yield" or "aggregation_label". For more information click here.
projection array optional, default is ["IND:SPX"] User supplied array of securities to be used as a top-down factor model. Maximum number of elements in the projection array is 10
volatility_half_life integer optional, default is 2 Half life of volatility information in months: 0 (no decay), 2, 6 or 12.
correlation_half_life integer optional, default is 6 Half life of correlation information in months: 0 (no decay), 2, 6 or 12.
risk_measure string optional, default is "volatility" Specifies the forward looking portfolio risk property being measured by MCTR, such as: "volatility", "var" or "cvar". "volatility": forward looking annualized volatility of the P&L distribution for the portfolio. "var": Value-at-Risk of the P&L distribution for the portfolio. "cvar": Conditional Value-at-Risk of the P&L distribution for the portfolio.
use_drift boolean optional, default is false A flag to determine if the ex-ante simulations are centered on zero or if the historical mean should be taken into account. For more details click here.
forecasts array optional, default is null An array of objects that represents expected prices and probabilities for a security in the future. For more details click here.
volatility_surface array optional, default is null An array of objects that represents the volatility surface for a security. The volatility surface is parameterized by time to expiration in years and moneyness. For more details click here.
filter string optional, default is null (use the whole portfolio) Filter Expression: When present it runs a pre-processing calculation to select securities that satisfy certain criteria. For more details click here.

Stress Test

To calculate the CVaR-, EV, CVaR+, run the following:

curl https://api.everysk.com/v2/stress_test \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -d '{ 
        "securities": [ 
          { 
            "id": "id1", 
            "symbol": "AAPL", 
            "quantity": 1000.0 
          }, 
          { 
            "id": "id2", 
            "symbol": "SIE:XETR", 
            "quantity": 750.0 
          } 
        ], 
        "date": "20191120", 
        "projection": ["SPY"], 
        "shock": "IND:SPX", 
        "magnitude": -0.1 
      }' \
  -X POST
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Calculation.riskAttribution(
  securities = [
    {
      "id": "id1",
      "symbol": "AAPL",
      "quantity": 1000.0
    },
    {
      "id": "id2",
      "symbol": "SIE:XETR",
      "quantity": 750.0
    }
  ],
  date = "20191120",
  projection =  ["SPY"], 
  shock = "IND:SPX",
  magnitude = -0.1    
)

The above call returns the following JSON object:

{
  "stress_test": {
    "dynamic_range": [
      -0.033119651967525,
      0.03414388478614
    ],
    "extrapolated": true,
    "implied_horizon": 5,
    "results": [
      {
        "cvar_neg": [
          {
            "projection": "SPY",
            "value": -0.039241088086052
          },
          {
            "projection": "residual",
            "value": -0.004036184056592
          }
        ],
        "cvar_pos": [
          {
            "projection": "SPY",
            "value": -0.023615685568566
          },
          {
            "projection": "residual",
            "value": 0.005494584533952
          }
        ],
        "ev": [
          {
            "projection": "SPY",
            "value": -0.031065356333858
          },
          {
            "projection": "residual",
            "value": -3.960918554e-05
          }
        ],
        "id": "id2"
      },
      {
        "cvar_neg": [
          {
            "projection": "SPY",
            "value": -0.118512424829462
          },
          {
            "projection": "residual",
            "value": -0.013267729679377
          }
        ],
        "cvar_pos": [
          {
            "projection": "SPY",
            "value": -0.071143109785483
          },
          {
            "projection": "residual",
            "value": 0.023366682599337
          }
        ],
        "ev": [
          {
            "projection": "SPY",
            "value": -0.09372721928667
          },
          {
            "projection": "residual",
            "value": -0.000634167963128
          }
        ],
        "id": "id1"
      }
    ],
    "unmapped_tickers": []
  }
}

Stress Test calculates the expected behavior of the portfolio under different scenarios, including extreme events. Everysk API calculates the probabilities of extreme events happening and factors those probabilities into the calculations. For example: it takes into account that correlations and volatility tend to increase in periods of market distress, resulting in large price oscillations for securities.

This API call returns 3 main measures for the specific scenario requested, namely:

To compute CVaR-, EV, CVaR+ for a portfolio, make an HTTP POST to your calculation resource URI:

HTTP Request

POST /calculations/stress_test

HTTP Parameters

Parameter Description
securities array REQUIRED It is an array of objects that describes the securities in the portfolio. Each object represents a security with a unique id, symbol, quantity and label. For more details click here.
date string date optional, default is null (today) Portfolio date in the format: "YYYYMMDD". The Portfolio Date is important because it instructs the API to use the market conditions and security prices prevailing on that date. Therefore, historical portfolios will be calculated without look ahead. In order to run the portfolio using market conditions prevailing today, use null. The furthest historical date allowed by the API is a year ago from today.
base_currency string optional, default is "USD" 3-letter ISO 4217 code for currency. Portfolios can have their base currency changed via the API call. By changing the base currency, a new set of currency risks is automatically taken into account. For all supported currencies click here.
nlv double optional, default is null (calculated) The net liquidating value of the portfolio (also called NAV). When not supplied by user, the API will calculate the net liquidating value of all the cash securities. Securities traded on margin are assumed to have nlv zero. Supplying an NLV effectively reconciles the margin.
horizon integer or null optional, default is 5 Forecast horizon in days: null, 1, 5, 20, 60 or 120. Passing null calculates an implied horizon compatible with the shock. For more information click here.
aggregation string optional, default is "position" (no aggregation) Aggregation computes individual security MCTR's and aggregates them according to the supported criteria: "position", "liquidity", "market_capitalization", "sector", "country_of_risk", "implied_rating", "duration", "dividend_yield" or "aggregation_label". For more information click here.
projection array optional, default is ["IND:SPX"] User supplied array of securities to be used as a top-down factor model. Maximum number of elements in the projection array is 10
volatility_half_life integer optional, default is 2 Half life of volatility information in months: 0 (no decay), 2, 6 or 12.
correlation_half_life integer optional, default is 6 Half life of correlation information in months: 0 (no decay), 2, 6 or 12.
shock string optional, default is "IND:SPX" The security being used for the stress test.
magnitude double REQUIRED The magnitude of the shock. For more details click here.
confidence string optional, default is "95%" This parameter determines the confidence level for calculating CVaR. For more details click here.
use_drift boolean optional, default is false A flag to determine if the ex-ante simulations are centered on zero or if the historical mean should be taken into account. For more details click here.
forecasts array optional, default is null An array of objects that represents expected prices and probabilities for a security in the future. For more details click here.
volatility_surface array optional, default is null An array of objects that represents the volatility surface for a security. The volatility surface is parameterized by time to expiration in years and moneyness. For more details click here.
filter string optional, default is null (use the whole portfolio) Filter Expression: When present it runs a pre-processing calculation to select identifiers that satisfy certain criteria. For more details click here.

Exposure

To calculate the exposure, run the following:

curl https://api.everysk.com/v2/exposure \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -d '{ 
        "securities": [ 
          { 
            "id": "id1", 
            "symbol": "AAPL", 
            "quantity": 1000.0 
          }, 
          { 
            "id": "id2", 
            "symbol": "SIE:XETR", 
            "quantity": 750.0 
          } 
        ], 
        "date": "20191120" 
      }' \
  -X POST
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Calculation.exposure(
  securities = [
    {
      "id": "id1",
      "symbol": "AAPL",
      "quantity": 1000.0
    },
    {
      "id": "id2",
      "symbol": "SIE:XETR",
      "quantity": 750.0
    }
  ],
  date = "20191120"
)

The above call returns the following JSON object:

{
  "exposure": {
    "nlv": 358588.197,
    "results": [
      {
        "beta_notional": [
          {
            "projection": "IND:SPX",
            "value": 295960.5757000709
          },
          {
            "projection": "residual",
            "value": 0.0
          }
        ],
        "id": "id1",
        "notional": 263190.0
      },
      {
        "beta_notional": [
          {
            "projection": "IND:SPX",
            "value": 68355.99137438688
          },
          {
            "projection": "residual",
            "value": 0.0
          }
        ],
        "id": "id2",
        "notional": 95398.19699999999
      }
    ],
    "unmapped_tickers": []
  }
}

Calculates the delta-adjusted notional exposure of each security, converted to the base currency of the portfolio.

To compute the exposures for a portfolio, make an HTTP POST to your calculation resource URI:

HTTP Request

POST /calculations/exposure

HTTP Parameters

Parameter Description
securities array REQUIRED It is an array of objects that describes the securities in the portfolio. Each object represents a security with a unique id, symbol, quantity and label. For more details click here.
date string date optional, default is null (today) Portfolio date in the format: "YYYYMMDD". The Portfolio Date is important because it instructs the API to use the market conditions and security prices prevailing on that date. Therefore, historical portfolios will be calculated without look ahead. In order to run the portfolio using market conditions prevailing today, use null. The furthest historical date allowed by the API is a year ago from today.
base_currency string optional, default is "USD" 3-letter ISO 4217 code for currency. Portfolios can have their base currency changed via the API call. By changing the base currency, a new set of currency risks is automatically taken into account. For all supported currencies click here.
nlv double optional, default is null (calculated) The net liquidating value of the portfolio (also called NAV). When not supplied by user, the API will calculate the net liquidating value of all the cash securities. Securities traded on margin are assumed to have nlv zero. Supplying an NLV effectively reconciles the margin.
aggregation string optional, default is "position" (no aggregation) Aggregation computes individual security MCTR's and aggregates them according to the supported criteria: "position", "liquidity", "market_capitalization", "sector", "country_of_risk", "implied_rating", "duration", "dividend_yield" or "aggregation_label". For more information click here.
filter string optional, default is null (use the whole portfolio) Filter Expression: When present it runs a pre-processing calculation to select identifiers that satisfy certain criteria. For more details click here.

Properties

To calculate the properties, run the following:

curl https://api.everysk.com/v2/properties \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -d '{ 
        "securities": [ 
          { 
            "id": "id1", 
            "symbol": "AAPL", 
            "quantity": 1000.0 
          }, 
          { 
            "id": "id2", 
            "symbol": "SIE:XETR", 
            "quantity": 750.0 
          } 
        ], 
        "date": "20191120" 
      }' \
  -X POST
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Calculation.properties(
  securities = [
    {
      "id": "id1",
      "symbol": "AAPL",
      "quantity": 1000.0
    },
    {
      "id": "id2",
      "symbol": "SIE:XETR",
      "quantity": 750.0
    }
  ],
  date = "20191120"
)

The above call returns the following JSON object:

{
  "properties": {
    "results": [
      {
        "measure": "expected_return",
        "value": 0.03154553891521
      },
      {
        "measure": "expected_volatility",
        "value": 0.212490070024519
      },
      {
        "measure": "var",
        "value": -0.048005759523278
      },
      {
        "measure": "cvar",
        "value": -0.059303042069568
      },
      {
        "measure": "net_exposure",
        "value": 1.0
      },
      {
        "measure": "gross_exposure",
        "value": 1.0
      },
      {
        "measure": "liquidity",
        "value": 0.000643648973023
      },
      {
        "measure": "nlv",
        "value": 358588.197
      },
      {
        "measure": "delta",
        "value": 2.0
      },
      {
        "measure": "gamma",
        "value": 0.0
      },
      {
        "measure": "theta",
        "value": 0.0
      },
      {
        "measure": "vega",
        "value": 0.0
      },
      {
        "measure": "duration",
        "value": 0.0
      },
      {
        "measure": "cs01",
        "value": 0.0
      },
      {
        "measure": "notional_var",
        "value": -17214.298753068168
      },
      {
        "measure": "notional_cvar",
        "value": -21265.370932341742
      }
    ],
    "unmapped_tickers": []
  }
}

Calculates the overall portfolio properties with a single API call, namely:

Property Description
CVaR The average of the worst (1-confidence) percentile outcomes from the forward looking profit and loss (PL) distribution of the portfolio.
Var The Value at Risk with confidence.
NLV Net Liquidating Value of the portfolio in base currency.
Liquidity The number of fractional days to fully unwind the portfolio, assuming a participation rate of 20% from the average volume traded in the last 20 days (ignores non-equity securities).
Net Exposure The delta-adjusted net exposure, expressed in the base currency of the portfolio.
Gross Exposure The delta-adjusted gross exposure, expressed in the base currency of the portfolio.
Expected Return Annualized mean of the forward looking PL distribution of the portfolio.
Expected Volatility Annualized standard deviation of the forward looking PL distribution of the portfolio.
Delta The notional delta of the portfolio in base currency, including FX, futures, index and/or equity options.
Vega The notional vega of the portfolio in base currency, including FX, futures, index and/or equity options.
Gamma The notional gamma of the portfolio in base currency, including FX, futures, index and/or equity options.
Theta The notional theta of the portfolio in base currency, including FX, futures, index and/or equity options.
nlv TODO: The net liquidating value of the portfolio (also called NAV).
duration TODO
cs01 TODO
notional_var TODO
notional_cvar TODO

HTTP Request

POST /calculations/properties

HTTP Parameters

Parameter Description
securities array REQUIRED It is an array of objects that describes the securities in the portfolio. Each object represents a security with a unique id, symbol, quantity and label. For more details click here.
date string date optional, default is null (today) Portfolio date in the format: "YYYYMMDD". The Portfolio Date is important because it instructs the API to use the market conditions and security prices prevailing on that date. Therefore, historical portfolios will be calculated without look ahead. In order to run the portfolio using market conditions prevailing today, use null. The furthest historical date allowed by the API is a year ago from today.
base_currency string optional, default is "USD" 3-letter ISO 4217 code for currency. Portfolios can have their base currency changed via the API call. By changing the base currency, a new set of currency risks is automatically taken into account. For all supported currencies click here.
nlv double optional, default is null (calculated) The net liquidating value of the portfolio (also called NAV). When not supplied by user, the API will calculate the net liquidating value of all the cash securities. Securities traded on margin are assumed to have nlv zero. Supplying an NLV effectively reconciles the margin.
horizon integer optional, default is 5 Forecast horizon in days: 1, 5, 20, 60 or 120.
aggregation string optional, default is "position" (no aggregation) Aggregation computes individual security MCTR's and aggregates them according to the supported criteria: "position", "liquidity", "market_capitalization", "sector", "country_of_risk", "implied_rating", "duration", "dividend_yield" or "aggregation_label". For more information click here.
projection array optional, default is ["IND:SPX"] User supplied array of securities to be used as a top-down factor model. Maximum number of elements in the projection array is 10
volatility_half_life integer optional, default is 2 Half life of volatility information in months: 0 (no decay), 2, 6 or 12.
correlation_half_life integer optional, default is 6 Half life of correlation information in months: 0 (no decay), 2, 6 or 12.
confidence string optional, default is "95%" This parameter determines the confidence level for calculating CVaR. For more details click here.
use_drift boolean optional, default is false A flag to determine if the ex-ante simulations are centered on zero or if the historical mean should be taken into account. For more details click here.
forecasts array optional, default is null An array of objects that represents expected prices and probabilities for a security in the future. For more details click here.
volatility_surface array optional, default is null An array of objects that represents the volatility surface for a security. The volatility surface is parameterized by time to expiration in years and moneyness. For more details click here.
filter string optional, default is null (use the whole portfolio) Filter Expression: When present it runs a pre-processing calculation to select identifiers that satisfy certain criteria. For more details click here.

Portfolio

Endpoints

GET       /portfolios          
GET       /portfolios/:id
POST      /portfolios          
PUT       /portfolios/:id
DELETE    /portfolios/:id

TODO A portfolio is a set of financial assets owned by an investor that may include bonds, stocks, currencies, cash and cash equivalents, and commodities.

Was this section helpful? Yes No

The portfolio object

What a portfolio object looks like?

{
  "id": "port_2EuAUKkmvtcy27AAeFrm28kcN",
  "name": "My First Portfolio",
  "description": " #api",
  "created": 1574447599,
  "base_currency": "USD",
  "date": "20191122",
  "date_time": "20191122 18:33:19",
  "date_use_today": false,
  "edited": false,
  "nlv": null,
  "nlv_use_custom": false,
  "securities": [],
  "tags": [
    "api"
  ]
}
Property Description
id string A unique identifier (UID) for the portfolio.
name string TODO The portfolio's name.
description string TODO An arbitrary string attached to the portfolio. Often useful for finding detailed information about the portfilio or for filtering a search based on the hashtags present.
created timestamp TODO Time at which the portfolio was created. Measured in seconds since the Unix epoch.
base_currency string TODO 3-letter ISO 4217 code for currency. Portfolios can have their base currency changed via the API call. For all supported currencies click here.
date string date TODO Portfolio date in the format: "YYYYMMDD". The Portfolio Date is important because it instructs the API to use the market conditions and security prices prevailing on that date.
date_time string TODO
date_use_today boolean TODO
edited boolean TODO Indicates whether or not the porfolio has been edited.
nlv double TODO The net liquidating value of the portfolio (also called NAV). When not supplied by user, the API will calculate the net liquidating value of all the cash securities. Securities traded on margin are assumed to have nlv zero. Supplying an NLV effectively reconciles the margin.
nlv_use_custom boolean TODO If true, determines that the nlv used in the calculations corresponds to the portfolio's nlv.
securities array TODO It is an array of objects that describes the securities in the portfolio. Each object represents a security with a unique id, symbol, quantity and label. For more details click here.
tags array TODO Automatically generated array of strings based on hashtags in portfolio's description.

List all portfolios

Returns a list of portfolios you’ve previously created. The portfolios are returned in sorted order, with the most recent portfolios appearing first.

To list all portfolios, run the following:

curl https://api.everysk.com/v2/portfolios \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -G
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Portfolio.list()

The above call returns the following JSON object:

[
  {
    "base_currency": "USD",
    "created": 1574442876,
    "date": "20191122",
    "date_time": "20191122 17:14:36",
    "date_use_today": false,
    "description": " #api",
    "edited": false,
    "id": "port_4qgT80XpmKnF9y2Hth5qGT464",
    "name": "My Second Portfolio",
    "nlv": null,
    "nlv_use_custom": false,
    "tags": [
      "api"
    ]
  },
  {
    "base_currency": "USD",
    "created": 1574442636,
    "date": "20191122",
    "date_time": "20191122 17:10:36",
    "date_use_today": false,
    "description": " #api",
    "edited": false,
    "id": "port_9HYYC6p2LiRIXD2xJaBmhlblv",
    "name": "My First Portfolio",
    "nlv": null,
    "nlv_use_custom": false,
    "tags": [
      "api"
    ]
  }
]

HTTP Request

GET /portfolios

HTTP Parameters

Parameter Description
name string optional, default is null TODO Filters the list of portfolios by the exact match of the name.
tags string optional, default is null TODO Filters the list of portfolios through the hashtags in the description. There is no need to use the hashtag (#) character.
page_size int optional, default is 10 TODO Defines the number of objects that will be listed per page.
page_token int optional, default is null TODO The token defines which page will be returned to the user. For further information, please check out our pagination guide.
with_securities boolean optional, default is null (false) Indicates whether or not the securities that make up the portfolio will be listed and detailed in the return object.

Create a portfolio

Creates and then returns the newly portfolio.

To create a new portfolio, run the following:

curl https://api.everysk.com/v2/portfolios \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -d '{ 
        "name": "My First Portfolio", 
        "securities": [ 
          { 
            "id": "id1", 
            "symbol": "AAPL", 
            "quantity": 1000.0 
          }, 
          { 
            "id": "id2", 
            "symbol": "SIE:XETR", 
            "quantity": 750.0 
          } 
        ], 
      }' \
  -X POST
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Portfolio.create(
  name = "My First Portfolio",
  securities = [
    {
      "id": "id1",
      "symbol": "AAPL",
      "quantity": 1000.0
    },
    {
      "id": "id2",
      "symbol": "SIE:XETR",
      "quantity": 750.0
    }
  ]   
)

The above call returns the following JSON object:

{
  "base_currency": "USD",
  "created": 1574442636,
  "date": "20191122",
  "date_time": "20191122 17:10:36",
  "date_use_today": false,
  "description": " #api",
  "edited": false,
  "id": "port_9HYYC6p2LiRIXD2xJaBmhlblv",
  "name": "My First Portfolio",
  "nlv": null,
  "nlv_use_custom": false,
  "tags": [
    "api"
  ]
}

HTTP Request

POST /portfolios

HTTP Parameters

Parameter Description
name string REQUIRED TODO It is a way for you to identify your portfolio, feel free to use a meaningful name for you.
securities array REQUIRED It is an array of objects that describes the securities in the portfolio. Each object represents a security, which requires a unique id, symbol, quantity. For more details click here.
description string optional, default is null Use this field to provide detailed information about your portfolio. You may add hashtags to create groups or categories allowing you to search for them later.
date string date optional, default is null (today) Portfolio date in the format: "YYYYMMDD". The Portfolio Date is important because it instructs the API to use the market conditions and security prices prevailing on that date. Therefore, historical portfolios will be calculated without look ahead. In order to run the portfolio using market conditions prevailing today, use null. The furthest historical date allowed by the API is a year ago from today.
base_currency string optional, default is "USD" TODO 3-letter ISO 4217 code for currency. Portfolios can have their base currency changed via the API call. For all supported currencies click here.
nlv double optional, default is null (calculated) The net liquidating value of the portfolio (also called NAV). When not supplied by user, the API will calculate the net liquidating value of all the cash securities. Securities traded on margin are assumed to have nlv zero. Supplying an NLV effectively reconciles the margin.
with_securities boolean optional, default is null (false) Indicates whether or not the securities that make up the portfolio will be listed and detailed in the return object

Retrieve a portfolio

Retrieves the details of an existing portfolio. You need only supply the unique portfolio identifier that was returned upon portfolio creation.

To retrieve a portfolio, run the following:

curl https://api.everysk.com/v2/portfolios/port_2EuAUKkmvtcy27AAeFrm28kcN \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -G
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Portfolio.retrieve("port_2EuAUKkmvtcy27AAeFrm28kcN")

The above call returns the following JSON object:

{
  "base_currency": "USD",
  "created": 1574447599,
  "date": "20191122",
  "date_time": "20191122 18:33:19",
  "date_use_today": false,
  "description": " #api",
  "edited": false,
  "id": "port_2EuAUKkmvtcy27AAeFrm28kcN",
  "name": "My First Portfolio",
  "nlv": null,
  "nlv_use_custom": false,
  "tags": [
    "api"
  ]
}

HTTP Request

GET /portfolios/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a portfolio.
with_securities boolean optional, default is null (false) Indicates whether or not the securities that make up the portfolio will be listed and detailed in the return object

Update a portfolio

Updates then returns the updated portfolio.

To update a portfolio, run the following:

curl https://api.everysk.com/v2/portfolios/port_2EuAUKkmvtcy27AAeFrm28kcN \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -d '{ 
        "name": "New Name", 
        "description": "#updated" 
      }' 
  -X PUT
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Portfolio.modify(
  "port_2EuAUKkmvtcy27AAeFrm28kcN", 
  name='New Name', 
  description='#updated'
)

The above call returns the following JSON object:

{
  "base_currency": "CAD",
  "created": 1574447599,
  "date": "20191122",
  "date_time": "20191122 18:33:19",
  "date_use_today": false,
  "description": "#updated",
  "edited": true,
  "id": "port_2EuAUKkmvtcy27AAeFrm28kcN",
  "name": "Updated Name",
  "nlv": null,
  "nlv_use_custom": true,
  "tags": [
    "updated"
  ]
}

HTTP Request

PUT /portfolios/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a portfolio.
name string optional, default is null TODO It is a way for you to identify your portfolio, feel free to use a meaningful name for you.
description string optional, default is null Use this field to provide detailed information about your portfolio. You also can add hashtags to create groups or categories allowing you to search for them later.
base_currency string optional, default is null TODO 3-letter ISO 4217 code for currency. Entering a currency here changes the base currency of the portfolio. For all supported currencies click here.
date_use_today boolean optional, default is null (false) TODO
nlv_use_custom boolean optional, default is null (false) TODO
with_securities boolean optional, default is null (false) Indicates whether or not the securities that make up the portfolio will be listed and detailed in the return object

Delete a portfolio

Permanently deletes a portfolio. It cannot be undone. Returns an object with the portfolio's id and an attribute specifying whether or not the portfolio was successfully deleted.

To delete a portfolio, run the following:

curl https://api.everysk.com/v2/portfolios/port_9HYYC6p2LiRIXD2xJaBmhlblv \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -X DELETE
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Portfolio.remove("port_9HYYC6p2LiRIXD2xJaBmhlblv")

The above call returns the following JSON object:

{
  "deleted": true,
  "id": "port_9HYYC6p2LiRIXD2xJaBmhlblv"
}

HTTP Request

DELETE /portfolios/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a portfolio.

Templates

Endpoints

GET       /templates           
GET       /templates/:id 

TODO Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. In iaculis nunc sed augue lacus viverra vitae congue. Ultrices mi tempus imperdiet nulla malesuada. Ullamcorper eget nulla facilisi etiam dignissim diam quis enim. Sit amet purus gravida quis blandit.

Was this section helpful? Yes No

The template object

What a template object looks like?

{
  "id": "tpl_VPh9pLIeQ20jTaR2kiVuS3f0E",
  "name": "Scenarios",
  "description": "Visualize the portfolio's forwarding looking profit and loss (P&L) for 10% up/down shocks on: SP500, Oil, Euro, Treasuries and China.",
  "is_custom": false,
  "is_trending": false,
  "portfolio_input": "single",
  "tags": [
    "stress"
  ]
}
Property Description
id string A unique identifier (UID) for the template.
name string TODO It is a way for you to identify a template. When it comes to a custom template, you can name it as you wish.
description string TODO An arbitrary string attached to the template. Often useful for finding detailed information about the template or for filtering a search based on the hashtags present.
is_custom boolean TODO Indicates whether or not the template is custom.
is_trending boolean TODO nunc consequat interdum varius sit amet mattis vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac ut consequat semper viverra.
portfolio_input string TODO nunc consequat interdum varius sit amet mattis vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac ut consequat semper viverra.
tags array TODO Automatically generated array of strings based on hashtags in template's description.

List all templates

TODO Returns a list of templates available for reporting.

To list all templates, run the following:

curl https://api.everysk.com/v2/templates \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -G
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Template.list()

The above call returns the following JSON object:

[
  {
    "description": "Visualize the portfolio's forwarding looking profit and loss (P&L) for 10% up/down shocks on: SP500, Oil, Euro, Treasuries and China.",
    "id": "tpl_VPh9pLIeQ20jTaR2kiVuS3f0E",
    "is_custom": false,
    "is_trending": false,
    "name": "Scenarios",
    "portfolio_input": "single",
    "tags": [
      "stress"
    ]
  },
  {
    "description": "Visualize risk concentrations, aggregated by: positions, security type, sectors, country-of-risk, liquidity, market capitalization, customized labels, implied rating and duration buckets. ",
    "id": "tpl_3xZllVEzxlRx0679MsnvUVrCx",
    "is_custom": false,
    "is_trending": false,
    "name": "Risk",
    "portfolio_input": "single",
    "tags": [
      "risk"
    ]
  }
]

HTTP Request

GET /templates

HTTP Parameters

Parameter Description
name string optional, default is null TODO Filters the list of portfolios by the exact match of the name.
tags string optional, default is null TODO Filters the list of portfolios through the hashtags in the description. There is no need to use the hashtag (#) character.
page_size int optional, default is 10 TODO Defines the number of objects that will be listed per page.
page_token int optional, default is null TODO The token defines which page will be returned to the user. For further information, please check out our pagination guide.

Retrieve a template

TODO Retrieves the information of an existing template. You need only supply the unique template identifier.

To retrieve a template, run the following:

curl https://api.everysk.com/v2/templates/tpl_VPh9pLIeQ20jTaR2kiVuS3f0E \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -G
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Template.retrieve("tpl_VPh9pLIeQ20jTaR2kiVuS3f0E")

The above call returns the following JSON object:

{
  "description": "Visualize the portfolio's forwarding looking profit and loss (P&L) for 10% up/down shocks on: SP500, Oil, Euro, Treasuries and China.",
  "id": "tpl_VPh9pLIeQ20jTaR2kiVuS3f0E",
  "is_custom": false,
  "is_trending": false,
  "name": "Scenarios",
  "portfolio_input": "single",
  "tags": [
    "stress"
  ]
}

HTTP Request

GET /templates/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a template.

Reports

Endpoints

GET       /reports                
GET       /reports/:id     
POST      /reports                
POST      /reports/:id/share
PUT       /reports/:id      
DELETE    /reports/:id

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. In iaculis nunc sed augue lacus viverra vitae congue. Ultrices mi tempus imperdiet nulla malesuada. Ullamcorper eget nulla facilisi etiam dignissim diam quis enim. Sit amet purus gravida quis blandit.

Was this section helpful? Yes No

The report object

What a report object looks like?

{
  "id": "repo_NZes7ptmIwJNitfJJwtvXI8RV",
  "name": "My First Report",
  "description": "#api #script #editor",
  "created": 1574790153,
  "authorization": "private",
  "edited": false,
  "tags": [
    "api",
    "script",
    "editor"
  ],
  "url": "https://app.everysk.com/report/14bbc1cbf1014379a322e28c5477168a"
}
Property Description
id string A unique identifier (UID) for the report.
name string TODO The report's name.
description string TODO An arbitrary string attached to the report. Often useful for finding detailed information about the report or for filtering a search based on the hashtags present.
created timestamp TODO Time at which the report was created. Measured in seconds since the Unix epoch.
authorization string TODO nunc consequat interdum varius sit amet mattis vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac ut consequat semper viverra.
edited boolean TODO Indicates whether or not the report has been edited.
tags array TODO Automatically generated array of strings based on hashtags in report's description.
url string TODO A link where the report can be viewed.

List all reports

Returns a list of reports you’ve previously generated. The reports are returned in sorted order, with the most recent reports appearing first.

To list all reports, run the following:

curl https://api.everysk.com/v2/reports \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -G
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Reports.list()

The above call returns the following JSON object:

[
  {
    "authorization": "private",
    "created": 1574859413,
    "description": "#api #script #editor",
    "edited": false,
    "id": "repo_SKIbyqXAAHxtuM3Hlp0KQDztw",
    "name": "My First Report",
    "tags": [
      "api",
      "script",
      "editor"
    ],
    "url": "https://app.everysk.com/report/b88233d46d8d473680f80c615493d9ad"
  },
  {
    "authorization": "private",
    "created": 1574796720,
    "description": "#api #script #editor",
    "edited": false,
    "id": "repo_J4IGFRHgyJEsNUpBcYlI0axFn",
    "name": "Another Report",
    "tags": [
      "api",
      "script",
      "editor"
    ],
    "url": "https://app.everysk.com/report/7acda2eb634442edb6a2eaffa5286491"
  }
]

HTTP Request

GET /reports

HTTP Parameters

Parameter Description
name string optional, default is null TODO Filters the list of reports by the exact match of the name.
tags string optional, default is null TODO Filters the list of reports through the hashtags in the description. There is no need to use the hashtag (#) character.
page_size int optional, default is 10 TODO Defines the number of objects that will be listed per page.
page_token int optional, default is null TODO The token defines which page will be returned to the user. For further information, please check out our pagination guide.

Create a report

TODO Initializes the generation of a report, returns the information about the generation process. Note that, while using the python API wrapper, the return will be null since the wrapper performs the pooling.

To create a new report, run the following:

curl https://api.everysk.com/v2/reports \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -d '{ 
        "template_id": "tpl_VPh9pLIeQ20jTaR2kiVuS3f0E", 
        "portfolio_id1": "port_TeakFe47EpWFtE4PChmAcixRr", 
        "name": "My First Report", 
      }' \
  -X POST
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Report.create(
  template_id="tpl_VPh9pLIeQ20jTaR2kiVuS3f0E", 
  portfolio_id1="port_TeakFe47EpWFtE4PChmAcixRr",
  name="My First Report")

The above call returns the following JSON object:

{
  "process" : {
    "trigger" : "api",
    "status" : "preparing",
    "entry_point" : "main",
    "result" : null,
    "script_id" : "create_report_script",
    "started" : null,
    "duration" : 0,
    "id" : "proc_kyCt2u0P4GwDEV41eBoyRr250",
    "created" : 1574859494,
    "parameters" : [
      "port_TeakFe47EpWFtE4PChmAcixRr",
      null,
      "tpl_VPh9pLIeQ20jTaR2kiVuS3f0E",
      {
        "description" : " #api",
        "custom_securities" : null,
        "custom_table" : null,
        "factor" : null,
        "risk_free_rates" : null,
        "shock" : null,
        "authorization" : null,
        "name" : "My First Report",
        "benchmark" : null
      }
    ]
  }
}

HTTP Request

POST /reports

HTTP Parameters

Parameter Description
template_id string REQUIRED TODO The unique identifier (UID) for the template that will be used in the report.
portfolio_id1 string REQUIRED TODO feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan.
portfolio_id2 string optional, default is null TODO feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan.
description string optional, default is null TODO feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan.
shock string optional, default is null TODO feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan.
factor string optional, default is null TODO feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan.
benchmark string optional, default is null TODO feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan.
risk_free_rates string optional, default is null TODO feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan.
custom_securities object optional, default is null TODO feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan.
custom_table object optional, default is null TODO feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa eget egestas purus viverra accumsan.

Retrieve a report

Retrieves the details of an existing report. You need only supply the unique report identifier that was returned upon report creation.

To retrieve a report, run the following:

curl https://api.everysk.com/v2/reports/port_2EuAUKkmvtcy27AAeFrm28kcN \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -G
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Report.retrieve("repo_SKIbyqXAAHxtuM3Hlp0KQDztw")

The above call returns the following JSON object:

{
  "authorization": "private",
  "created": 1574859413,
  "description": "#api #script #editor",
  "edited": false,
  "id": "repo_SKIbyqXAAHxtuM3Hlp0KQDztw",
  "name": "My First Report",
  "tags": [
    "api",
    "script",
    "editor"
  ],
  "url": "https://app.everysk.com/report/b88233d46d8d473680f80c615493d9ad"
}

HTTP Request

GET /reports/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a report.

Update a report

Updates then returns the updated report.

To update a report, run the following:

curl https://api.everysk.com/v2/reports/repo_SKIbyqXAAHxtuM3Hlp0KQDztw \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -d '{ 
        "name": "Updated Name", 
        "description": "#updated" 
      }' \
  -X PUT
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Report.modify(
  "repo_SKIbyqXAAHxtuM3Hlp0KQDztw", 
  name='Updated Name', 
  description='#updated'
)

The above call returns the following JSON object:

{
  "authorization": "private",
  "created": 1574859413,
  "description": "#updated",
  "edited": true,
  "id": "repo_SKIbyqXAAHxtuM3Hlp0KQDztw",
  "name": "Updated Name",
  "tags": [
    "updated"
  ],
  "url": "https://app.everysk.com/report/b88233d46d8d473680f80c615493d9ad"
}

HTTP Request

PUT /reports/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a report.
name string optional, default is null TODO
description string optional, default is null TODO
authorization string optional, default is null TODO

Delete a report

Permanently deletes a report. It cannot be undone. Returns an object with the report's id and an attribute specifying whether or not the report was successfully deleted.

To delete a report, run the following:

curl https://api.everysk.com/v2/reports/repo_SKIbyqXAAHxtuM3Hlp0KQDztw \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -X DELETE
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Report.remove("repo_SKIbyqXAAHxtuM3Hlp0KQDztw")

The above call returns the following JSON object:

{
  "deleted": true,
  "id": "repo_SKIbyqXAAHxtuM3Hlp0KQDztw"
}

HTTP Request

DELETE /reports/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a report.

Share a report

TODO Creates a sharable link to a report.

To share a report, run the following:

curl https://api.everysk.com/v2/reports/repo_NZes7ptmIwJNitfJJwtvXI8RV/share \
  -H "Content-Type: application/json" \
  -u YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN \
  -X POST
import everysk

everysk.api_sid = <YOUR_API_SID>
everysk.api_token = <YOUR_API_TOKEN>

everysk.Report.retrieve("repo_NZes7ptmIwJNitfJJwtvXI8RV").share()

The above call returns the following JSON object:

{
  "authorization": "private",
  "created": 1574790153,
  "description": "#api #script #editor",
  "edited": false,
  "id": "repo_NZes7ptmIwJNitfJJwtvXI8RV",
  "name": "My First Report",
  "shared_url": "https://app.everysk.com/report/shared_TVRSaVltTXhZMkptTVRBeE5ETTNPV0V6TWpKbE1qaGpOVFEzTnpFMk9HRTZiV0U2LjE1NzQ4NjM2NjYuMDAwMDAwMzYwMC4yQnlFWFFsQUlnbjZmcTU0bjBRcUZWS2NxallDM3FnM3NXTTdOWmtNc2dz/light",
  "tags": [
    "api",
    "script",
    "editor"
  ],
  "url": "https://app.everysk.com/report/14bbc1cbf1014379a322e28c5477168a"
}

HTTP Request

POST /reports/:id/share

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a report.
expires_after string optional, default is 1 hour TODO
skin_theme string optional, default is Light TODO

Datastores

Endpoints

GET       /datastores               
GET       /datastores/:id 
POST      /datastores               
PUT       /datastores/:id
DELETE    /datastores/:id

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. In iaculis nunc sed augue lacus viverra vitae congue. Ultrices mi tempus imperdiet nulla malesuada. Ullamcorper eget nulla facilisi etiam dignissim diam quis enim. Sit amet purus gravida quis blandit.

Was this section helpful? Yes No

The datastore object

List all datastores

Create a datastore

Retrieve a datastore

Update a datastore

Delete a datastore

Scripts

Endpoints

GET       /scripts/               
GET       /scripts/:id    
POST      /scripts/               
POST      /scripts/:id/run
PUT       /scripts/:id    
DELETE    /scripts/:id    

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. In iaculis nunc sed augue lacus viverra vitae congue. Ultrices mi tempus imperdiet nulla malesuada. Ullamcorper eget nulla facilisi etiam dignissim diam quis enim. Sit amet purus gravida quis blandit.

Was this section helpful? Yes No

The script object

List all scripts

Create a script

Retrieve a script

Update a script

Delete a script

Run a script

Processes

Endpoints

GET       /processes/            
GET       /processes/:id
DELETE    /processes/:id

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. In iaculis nunc sed augue lacus viverra vitae congue. Ultrices mi tempus imperdiet nulla malesuada. Ullamcorper eget nulla facilisi etiam dignissim diam quis enim. Sit amet purus gravida quis blandit.

Was this section helpful? Yes No

The process object

List all processes

Retrieve a process

Delete a process

Parameter Details

Securities

Example of long/short global stocks portfolio with user defined label (JSON):

[
  {
    "id": "0f82eb",
    "symbol": "GMEXICOB:XMEX",
    "quantity": 125000.0,
    "label": "AB"
  },
  {
    "id": "76ac8d",
    "symbol": "CNCO",
    "quantity": 150000.0,
    "label": "DL"
  },
  {
    "id": "47e7ba",
    "symbol": "SIE:XETR",
    "quantity": 10000.0,
    "label": "DL"
  },
  {
    "id": "86f551",
    "symbol": "BN:XPAR",
    "quantity": 4000.0,
    "label": "AB"
  },
  {
    "id": "1b9b11",
    "symbol": "BMW:XETR",
    "quantity": 2000.0,
    "label": "AB"
  },
  {
    "id": "a089b0",
    "symbol": "AAPL",
    "quantity": -1000.0,
    "label": "AB"
  },
  {
    "id": "bc1413",
    "symbol": "FB",
    "quantity": -2400.0,
    "label": "DL"
  }
]

The parameter securities is an array of objects representing each security in the portfolio. Each object in the array has the following attributes:

Attribute Description
id string REQUIRED A unique identifier (UID) for a security.
symbol string REQUIRED Security symbol: Please refer to our symbology.
quantity double REQUIRED Numbers of shares or contracts. Positive quantities are longs and negative are shorts. For fixed income securities, mutual funds, swaps, cash and margin the amounts are defined in the security's currency.
label string optional, default is "" (no aggregation label) Aggregation label defined by the user. It is utilized when aggregation is set to "aggregation_label".

Maximum securities length:

Magnitude

The parameter magnitude is an instantaneous shock as a decimal number: -10% = -0.10.

Certain rates/spreads can also be shocked and the magnitude of the shock is an absolute widening or tightening of the rate/spread. For example:

Shock Magnitude Current level New level
IND:SPX -1% 2821 2792
IND:LIBOR3M -1% 1.77 0.77

In the table above, the shock in SPX is a percent change, whereas the libor shock is an absolute shift.

For a list of rates and spreads that are shocked in absolute terms please click here.

Confidence

The parameter confidence can be one of: 1sigma, 2sigma, 3sigma, 85%, 90% or 95%. For example: 1sigma represents the left tail outside a one-sigma move from the mean of the profit and loss distribution (PL). It would represent roughly the worst/best 16% (=68%+16%) forecasted outcomes. Conversely, 95% explicitly represents the worst/best 5% forecasted outcomes.

The table below clarifies:

Confidence Probability
1sigma One sigma dispersion around the mean (approx. 68.27%) + one tail Tail measure*15.86%
2sigma Two sigma dispersion around the mean (approx. 95.45%) + one tail Tail measure*2.27%
3sigma Three sigma dispersion around the mean (approx. 99.73%) + one tail Tail measure*0.13%
85% Explicit 85% Tail measure* = 15%
90% Explicit 90% Tail measure* = 10%
95% Explicit 95% Tail measure* = 5%

* Tail measure = (1-confidence)

Use Drift

By default our simulations are zero-centered. This flag specifies that the dispersion of simulations should be around the average of the historical risk factors instead.

In the calculation of the averages, volatility_half_life and correlation_half_life are taken into account.

Forecasts

Example of forecast (JSON):

[
  {
    "symbol": "NFLX",
    "years": 1.0,
    "targets": [160, 260, 400, 480],
    "probabilities": [0.55, 0.15, 0.15,0.15]
  },
  {
    "symbol": "SPY",
    "years": 0.5,
    "targets": [270, 260, 200],
    "probabilities": [0.5, 0.4, 0.1]
  }
]

User-supplied forecasts can represent outcomes that are difficult to be captured by the covariance matrix, for example: a takeover situation, a pharmaceutical company clearing a drug trial or even a large correction not captured with the historical data.

The parameter forecasts is an array of objects representing the price forecast for a security in the portfolio. Each object in the array has the following attributes:

Attribute Description
years double REQUIRED Timeframe for the forecast to materialize in years.
targets array REQUIRED Target prices at a horizon represented by attribute years. Can contain any number of targets.
probabilities array REQUIRED Probabilities associated to each element inside the attribute targets.

The arrays targets and probabilities have to be of same size and probabilities need to sum to 1.0.

Volatility Surface

Example of volatility surface (JSON):

[
  {
    "symbol": "IBM",
    "time_to_expiration": [0.12, 0.25],
    "moneyness": [0.97, 1, 1.03, 1.05],
    "volatilities": [
      [0.36, 0.16, 0.33, 0.26],
      [0.19, 0.20, 0.17, 0.16]
    ]    
  }
]

Surfaces are parameterized in years to expiration and moneyness. When supplied, the surface is used to price any options on the underlying. When omitted, an implied volatility is calculated with Black and Scholes.

The parameter volatility_surface is an array of objects representing the implied volatilities for underlying securities in the portfolio. Each object in the array has the following attributes:

Attribute Description
time_to_expiration array REQUIRED Various times to expiration (as a fraction of a year).
moneyness array REQUIRED Various moneyness.
volatilities 2d array REQUIRED Implied volatilities, with times_to_expiration rows and moneyness columns.

Filter Expression

Example using logical operator 'and'. Retrieve identifiers for positions that are long and also denominated in a currency different than the base currency of the portfolio:

"exposure('long') and currency('foreign securities')"

Example using logical operator 'or'. Retrieve any shorts or illiquid positions:

"exposure('short') or liquidity('>300%')"

Example using logical operator 'not'. Retrieve all positions that are not long options:

"not(type('equity option long delta'))"

Example using logical operators combined:

"currency('foreign securities') and (not(exposure('short') or liquidity('>300%')))"

Filters are powerful constructs to return the unique identifiers of certain positions in the portfolio, satisfying a specific criteria. When used, they isolate the behavior of a unique group, compared to the whole. For example: how illiquid securities might react to an oil shock.

The parameter filter supports the following expressions:

Filter Function Description
currency Extracts the unique identifiers according to different currency related buckets: 'foreign securities', 'domestic securities'
exposure Extracts the unique identifiers that represent long exposures (including long calls and short puts) and short exposures (including long puts and short calls): 'long', 'short'
type Extracts the identifiers of securities from a specific type: 'equity option long delta', 'equity option short delta', 'future option long delta', 'future option short delta', 'foreign equity long', 'foreign equity short', 'us equity long', 'us equity short', 'fx forward', 'fx option long delta', 'fx option short delta'
liquidity Extracts the identifiers of securities satisfying certain liquidity criteria: '0-5%', '5-25%', '25-50%', '50-100%', '100-300%', '>300%'

Liquidity above is expressed as the proportion of the 20-day average trading volume required to unwind a position in full, taking into account a 20% participation rate. Thus, ">300%" means that will take at least 3 days to unwind the position(s) in full.

Simple filters above can be combined into complex filters using logical expressions, namely: or, and and not. Please see various examples in the right panel.

Filters that do not satisfy all the conditions return an empty dictionary, therefore the whole portfolio is used.