Derivitec API Functions

To get started, connect to the dev environment.

>>> from derivitec import DerivitecClient, dev
>>> client = DerivitecClient(dev)
>>> client.connect()
12/12/2017 04:21:56 PM DerivitecClient connected.

Now the client is connected we can send a request.

>>> client.get_available_currency_isos()
[u'AUD', u'CHF', u'EUR', u'GBP', u'JPY', u'SEK', u'USD', u'HKD', u'TWD', u'SGD']

Alternatively you can connect via:

>>> from derivitec import conn
>>> conn.connect(dev)
12/12/2017 04:22:40 PM DerivitecClient connected.

Doing this sets the client variable in the conn module.

What follows is a reference of all API calls currently exposed with example usage.

add_business_days(calendar, dt, days)

Add business days.

add_request(request_name, request_class[, ...])

Add a request to the client.

adjust_business_day(calendar, dt, bdc)

Adjust a date to a business day using a calendar and business day convention.

bond_futures_prices_from_repo_rates(...[, ...])

Get the implied futures prices of bonds, given a bond future and repo rates.

calculate_historical_price_series_on_contracts(...)

Calculate historical price series on a set of contracts.

calculate_risk_on_contracts(contracts, ...)

Calculate risk on a set of contracts.

calculate_risk_on_portfolio(portfolio_name, ...)

Calculate risk on a portfolio.

calculate_risk_on_tradables(tradable_ids, ...)

Calculate risk on a set of tradable ids.

connect()

create_books(create_book_requests)

Create books.

delete_borrow_curves(identifiers, ...)

Delete borrow curves.

delete_equity_vol_surfaces(identifiers, ...)

Delete equity vol surfaces.

delete_index_component_data(identifiers, ...)

Delete index compenent data.

delete_projected_dividends(identifiers, ...)

Delete projected dividends.

fit_bond_yield_curves_to_bond_data(data[, ...])

Fit bond yield curves to bond data.

fit_equity_vol_surfaces_to_convertible_bond_data(...)

Fit equity vol surfaces to convertible bond data.

futures_price(contracts, reporting_currency)

Get the futures price of contracts for a market data date and pricing date or for some predefined market data.

get_active_user_portfolios()

Get active user portfolio

get_auth_details()

get_auth_details_from_site()

get_available_currency_isos()

Get available currencies

get_available_risk_reports()

Get available risk reports.

get_blackscholes_implied_vol(spot, forward, ...)

Get Black Scholes implied vol for european option

get_bond_data(identifiers, start_date, end_date)

Get bond data.

get_bond_futures(identifiers)

Get bond futures.

get_bond_futures_series(futures_prefix, ...)

Get a bond futures data time series for a given futures prefix and a specified offset to the expiry between two dates.

get_bond_infos(identifiers)

Get bond info.

get_bond_yield_curve_maturity_buckets(...[, ...])

Get bond yield curve maturity buckets constituents.

get_bond_yield_curves(bond_yield_curve_ids, ...)

Get bond yield curves.

get_bonds(identifiers)

Get bonds.

get_borrow_curves(identifiers, market_date)

Get borrow curves.

get_borrow_curves_for_env(market_date[, ...])

Get borrow curves for env.

get_calendars(calendars)

Get calendars

get_cash_flows(contracts, mkt_data_date, ...)

Get cash flows for a bond between two dates.

get_cds_data(identifiers, start_date, end_date)

Get cds data.

get_cmdty_futures(identifiers)

Get commodity futures.

get_cmdty_futures_data(identifiers, ...[, ...])

Get cmdty futures data for some identifiers between two dates.

get_cmdty_vol_surfaces(commodity_ids, ...[, ...])

Get commodity vol surfaces.

get_commodities(commodity_ids, descriptors, ...)

Get commodities

get_contracts_from_client_tradable_id(...[, ...])

Get contracts from a portfolio

get_contracts_from_portfolio(portfolio_name, ...)

Get contracts from a portfolio

get_contracts_from_tradable_ids(tradable_ids)

Get contracts from a list of tradable ids.

get_convenience_yield(curve, start_mat, end_mats)

Get the convenience yield.

get_convertible_bonds(identifiers[, ...])

Get convertible bonds for some identifier.

get_convertible_bonds_grid_pricer_details(...)

Get convertible bonds for some identifier.

get_coupons(bond, mkt_data_date, ...)

Get bounds for a bond between two dates.

get_credit_swaption_vol_cube_data(...[, ...])

Get credit swaption vol cube data for credit index and optional flags.

get_crypto_coin_data(codes, start_date, end_date)

Get crypto coin data for some crypto currencies between two dates.

get_date_coupon_map(bond, mkt_data, ...[, ...])

Get a map of dates to coupons for a bond.

get_discount_curves([currencies, ...])

Get discount curves for some currencies and market dates.

get_discount_factors(curve, start_mat, end_mats)

Get discount factors from a curve.

get_dividend_curve(identifier, market_date)

Get dividend curve data for an given equity, provider and market date.

get_dividend_index_fixings(...[, ...])

Get dividend index fixings for some identifiers between two dates.

get_dividend_index_vol_surfaces([...])

Get dividend index vol surfaces.

get_eq_futures(identifiers)

Get equity futures.

get_eq_vol_of_var_curves(identifiers, ...[, ...])

Download vol-of-variance nodes using the pricing environment fallback.

get_equities(identifiers, descriptors, ...)

Get equities.

get_equity_equity_correlation_data(...[, ...])

Get equity-equity correlation data.

get_equity_forwards(identifier, market_date)

Get equity forwards

get_equity_fx_correlation_data(...[, ...])

Get equity-fx correlation data.

get_equity_vol_grid(vol_surface, maturities, ...)

Get equity vol grid from a vol surface

get_equity_vol_index_vol_surfaces(...[, ...])

Get equity vol index vol surfaces.

get_equity_vol_index_vols(identifier, ...[, ...])

Get equity vol index vol surface vols between two dates.

get_equity_vol_surfaces(identifiers, ...[, ...])

Get equity vol surfaces.

get_equity_vol_surfaces_for_env(market_date)

Get equity vol surfaces for env.

get_equity_vols(identifier, strike_type, ...)

Get equity vol surface vols between two dates.

get_etf_premiums(identifiers, start_date, ...)

Get ETF premiums for some identifiers between two dates.

get_flattened_contracts_from_tradable_ids(...)

Get contracts from a list of tradable ids.

get_flattened_convertible_bonds(identifiers)

Get convertible bonds for some identifier.

get_forward(underlyer, expiries)

Get forward of an asset at a set of expiries.

get_fx_crosses(fx_pairs, market_dates, ...)

Get FX crosses.

get_fx_data(fx_pairs, start_date, end_date)

Get FX data for some FX pairs between two dates.

get_fx_futures(identifiers)

Get fx futures.

get_fx_vol_surfaces(fx_pairs, market_dates)

Get FX vol surfaces.

get_index_component_data(identifiers, ...[, ...])

Get index compenent data.

get_index_component_data_for_env(market_date)

Get index compenent data for env.

get_ir_bump_mkt_data(bumps, mkt_data_container)

Get back a new market data container with interest rate bumps applied.

get_ir_futures(identifiers[, as_of_date])

Get ir futures.

get_mkt_data(contracts[, pricing_date, ...])

Gets a market data container required for pricing a list of contracts.

get_pnl_report_infos([portfolio_names, ...])

Get pnl report infos

get_pnl_report_meta_data([report_id])

Get pnl report meta data

get_pnl_reports_data_by_id([report_ids])

Get var report data by report ids.

get_portfolio_table(portfolio_name, ...[, ...])

Get portfolio table for the specified portfolio.

get_pricing_details(contract, pricing_date, ...)

Get pricing details from a contract

get_pricing_details_for_contracts(contracts, ...)

Get pricing details from a contract

get_projected_dividends_for_env(market_date)

Get projected dividends for env.

get_report_data_by_id(report_id[, ...])

Get report data by report id.

get_report_excel_export(report_id, file_name)

Get the report excel export from its id.

get_report_infos(report_name, ...[, ...])

Get report infos.

get_report_result(id)

Get the report result from its id.

get_risk_report_meta_data([report_id])

Get risk report metadata

get_spider_rock_vol_data(market_date[, ...])

Get spider rock vol data.

get_stock_data(identifiers, start_date, end_date)

Get stock data for some identifiers between two dates.

get_stock_info(identifiers[, ...])

Get stock info for some identifiers.

get_swaption_vol_cube_data(rate_asset_name, ...)

Get swaption vol cube data for rate asset and optional flags.

get_time_series(series_name, filter, ...)

Get a time series.

get_tradable_ids_from_contracts(contracts, ...)

Get tradable ids from a list of a contracts as of a given date.

get_tradable_ids_from_portfolio(...[, ...])

Get tradable ids from portfolio as of a date time.

get_transaction_table(portfolio_name, ...[, ...])

Get portfolio table for the specified portfolio.

get_var_report_data_by_id(report_id)

Get var report data by report id.

get_var_report_infos([portfolio_name, ...])

Get report infos.

get_var_report_status_by_id(report_id)

Get var report status by report id.

get_var_report_time_series_data_by_id(report_id)

Get var report time series data by report id.

get_var_reports_data_by_id([report_ids, ...])

Get var report data by report ids.

get_vol(surface, maturity, strikes, strike_type)

Get vol from a volatility surface at a fixed maturity for a set of strikes.

legacy_position_upload(positions[, ...])

Legacy Position upload.

login_with_cognito()

Login using the security token to get an access token.

position_upload(positions)

Position upload.

price(contracts, reporting_currency[, ...])

Get the prices of contracts for a market data date and pricing date or for some predefined market data.

run_report(report_name, portfolio_name, ...)

Trigger a report run.

run_risk_report(report_name, portfolio_name, ...)

Trigger a report run.

run_var_report(portfolio_name, ...[, ...])

Trigger a var report run.

upload_amortisation_rates(amortisation_rate_data)

Upload amortisation rate data.

upload_bond_infos(bond_infos[, ...])

Upload bond infos.

upload_bond_issuer_credit_spreads([...])

UploadBondIssuerCreditSpreads.

upload_bond_price_data(bond_data, ...[, ...])

Upload bond price data.

upload_bond_yield_curves(bond_yield_curves)

Upload bond yield curves.

upload_borrow_curves([...])

Upload borrow curves.

upload_cmdty_futures_data(cmdty_futures_data)

Upload Cmdty futures data

upload_credit_swaption_vol_cube_data(...[, ...])

Upload credit swaption vol cube data.

upload_discount_curves(discount_curves[, ...])

Upload discount curves.

upload_dividend_index_fixings(...[, ...])

Upload stock data

upload_dividend_index_vol_surfaces(vol_surfaces)

Upload dividend index vol surfaces.

upload_entity_custom_data(...[, ...])

Upload entity custom data.

upload_eq_vol_of_var_curves(eq_vol_of_var_curves)

Upload equity volatility-of-variance curves for analytic vol swaps.

upload_equity_dividend_correlation_data(...)

Upload equity-dividend correlation data.

upload_equity_equity_correlation_data(...[, ...])

Upload equity-equity correlation data.

upload_equity_fx_correlation_data(...[, ...])

Upload equity-fx correlation data.

upload_equity_ir_correlation_data(...[, ...])

Upload equity ir correlation data.

upload_equity_vol_curves(equity_vol_curves, ...)

Upload equity vol curves.

upload_equity_vol_grids(equity_vol_grids, ...)

Upload equity vol grids.

upload_equity_vol_surfaces(vol_surfaces[, ...])

Upload equity vol surfaces.

upload_etf_premiums(etf_premiums[, ...])

Upload ETF premiums

upload_fx_ir_correlation_data(...[, ...])

Upload fx ir correlation data.

upload_fx_vol_grids(fx_vol_grids, ...[, ...])

Upload fx vol grids.

upload_index_component_data(...[, ...])

Upload index component data.

upload_probability_of_default(...[, ...])

Upload probability of default data.

upload_projected_dividends(dividends, ...[, ...])

Upload projected dividends.

upload_rate_assets(rate_assets[, ...])

Upload rate assets.

upload_recovery_rates(recovery_rate_data[, ...])

Upload recovery of default data.

upload_stock_data(stock_data[, ...])

Upload stock data

upload_survival_curves(survival_curves[, ...])

Upload survival curves.

upload_vol_surface_spot_model_definitions(...)

Upload a batch of beta-adjusted ATMF spot model definitions.