Structured product and derivative pricing
calculate_structured_productStructured-product engine. Value HKEX-listed and OTC structures: CBBCs, derivative and inline warrants, equity-linked notes and investments, autocallables, accumulators and decumulators, credit-linked notes, TRS, and CFDs. Use this for equity-linked and credit-linked payoff structures; for a plain option or warrant use calculate_option, for a convertible or exchangeable bond use calculate_convertible_bond, and for a vanilla bond or term structure use calculate_fixed_income. Methods: cbbc: notional, spot, strike, barrier, barrier_type, maturity, risk_free, volatility, option_type; cbbc_residual: notional, spot, call_price, entitlement, barrier, barrier_type, maturity, risk_free, volatility, option_type; derivative_warrant: notional, spot, strike, maturity, risk_free, volatility, average_type, option_type; inline_warrant: notional, spot, lower_strike, upper_strike, maturity, risk_free, volatility, payout; inline_warrant_avg: notional, spot, lower_strike, upper_strike, maturity, risk_free, volatility, payout, fixing_days; eli/eln: notional, spot, strike, maturity, risk_free, volatility, coupon_rate; autocallable: notional, spot, knock_out_level, observation_dates, coupon_rate_structured, maturity, risk_free, volatility; credit_linked_note: notional, credit_spread, recovery, maturity, risk_free, coupon_rate_structured; accumulator/decumulator: notional, spot, strike, knock_out_level, observation_dates, risk_free, volatility; trs: notional, spot, maturity, risk_free, dividend_yield; cfd: notional, spot, strike, maturity, risk_free. Supply exactly one method with its declared inputs (no defaults). An unknown method, a missing input, or an extra field returns an error envelope (code INVALID_ARGUMENT) instead of raising.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spot | No | Spot price of the underlying (or FX rate for garman_kohlhagen). | |
| method | Yes | Formula to apply; the tool description lists the exact inputs each value requires. | |
| payout | No | Fixed payout when the range condition is met. | |
| strike | No | Strike or exercise price in the same currency as spot. | |
| barrier | No | Knock level for barrier_first_passage. | |
| maturity | No | Time to expiry in years (0.5 = six months); > 0. | |
| notional | No | Contract notional/face amount in reporting currency. | |
| recovery | No | Recovery rate in [0,1]. | |
| risk_free | No | Continuously-compounded risk-free rate (decimal). | |
| call_price | No | CBBC call price (mandatory-call trigger level). | |
| volatility | No | Annualized volatility (decimal, 0.30 = 30%); > 0. | |
| coupon_rate | No | Annual coupon rate (decimal). | |
| entitlement | No | CBBC entitlement: units of underlying per contract. | |
| fixing_days | No | Number of closing fixings averaged for settlement (>=1). | |
| option_type | No | Option right. | |
| average_type | No | Averaging convention. | |
| barrier_type | No | Barrier direction. | |
| lower_strike | No | Lower strike of the range. | |
| upper_strike | No | Upper strike of the range. | |
| credit_spread | No | Credit spread over the risk-free rate (decimal). | |
| dividend_yield | No | Continuous dividend yield (decimal). | |
| knock_out_level | No | Knock-out level for autocallables and accumulators. | |
| observation_dates | No | Observation dates in years for path-dependent products. | |
| coupon_rate_structured | No | Conditional coupon rate (decimal). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error detail, present only when status='error'. | |
| steps | No | Ordered computation steps, when the method reports them. | |
| value | No | Primary result: a number for scalar methods, an object for valuation methods. | |
| method | No | Method or tool name that produced the result. | |
| status | Yes | 'ok' on success, 'error' on failure. | |
| ticker | No | Ticker the result pertains to, when applicable. | |
| assumptions | No | Inputs and assumptions used, echoed for traceability. | |
| formula_ref | No | Formula or standards reference for the method. | |
| data_timestamp | No | ISO-8601 UTC timestamp of the underlying data, when fetched. |