MLink Live Calculators
SpiderRock provides several live calculators via MLink that allow clients to perform real-time option pricing and risk calculations. These calculators are available through both the MLink/WebSocket API and MLink/REST API.
Overview
MLink calculators enable clients to:
- Calculate option prices and Greeks in real-time
- Override default parameters (volatility, underlying price, rates, etc.)
- Process both Listed and FLEX options
- Perform calculations on individual options, spreads, or baskets
To use these calculators, clients must:
- Secure an MLink API Key
- Connect to an MLink/WebSocket or REST server
- Send appropriate calculation request messages
Available Calculators
1. Option Basket Calculator
The Option Basket Calculator allows clients to send a collection of option definitions (both FLEX and Listed) grouped into a basket for batch calculation. Clients can define baskets, override default values, and request recalculation on demand.
Key Messages
| Message | Source | Description |
|---|---|---|
| OptionItemDef | Client | Define options in the basket (Listed or FLEX) |
| GetOptionBasket | Client | Trigger basket calculation |
| OptionItemCalc | Server | Calculated results for basket items |
Workflow
-
Client Sends OptionItemDef Objects:
- Send multiple OptionItemDef objects to the MLink server
- Each object represents an option with key details (option key, volatility, underlying price, rate, etc.)
- Include a
basketNumberfield to group options into a single basket
-
Client Requests Recalculation with GetOptionBasket:
- Send GetOptionBasket specifying the basketNumber
- This triggers server-side calculations for all options in the basket
-
Server Processes the Request:
- Server recalculates details for each option in the basket
- Computations based on parameters provided in OptionItemDef objects
-
Server Sends OptionItemCalc Objects:
- Server responds with multiple OptionItemCalc JSON objects
- Each contains recalculated option details (Greeks, price, error messages)
Features
- Works with Listed options, FLEX options or mixed baskets
- Override default values (volatility, underlying price, rate, model type)
- Batch processing for portfolio-level analysis
- Available via both WebSocket and REST APIs
2. Flex Spread Calculator
The FLEX Spread Calculator enables real-time pricing and risk analysis of multi-leg FLEX option strategies. It supports option spreads where the user can set a desired target premium (e.g., for zero-collar spreads), by designating (at most) one leg to have a variable strike that is solved for in order to deliver this target.
Key Messages
| Message | Source | Description |
|---|---|---|
| GetFlexSpreadPrice | Client | Live spread pricer with variable strike support |
GetFlexSpreadPrice
A comprehensive spread pricing calculator that can handle FLEX options with support for setting target spread premiums by way of a variable strike leg.
Input Parameters
General Parameters:
uPrc: Live underlying price (if not supplied, uses market price)fixedPremUPct: Target premium as % of underlying (required if using PctVariable strike; can be negative, 0, or positive)incGreeks: Include Greeks calculation (Yes/No)
Leg Definition (repeatable for each leg; underlying ticker must be the same for all legs):
okey: Option key (OSI format; strike can be zero for variable strike leg)side: Buy or Sellratio: Leg ratio (default: 1)strikeType: Strike specification type- DollarAmt: Fixed dollar strike
- Percent: Percentage of underlying
- PctVariable: Variable strike (exactly one leg allowed)
flexTypeOut: FLEX type decoded from option key
Output Values
Aggregate Spread Results:
ticker: Underlying ticker (must be same for all legs)sprdPrem: Total spread premium ($)- Spread Greeks: sprdDelta, sprdGamma, sprdTheta, sprdVega, sprdVolga, sprdVanna, sprdRho, sprdPhi
calcDetail: Calculation detailserror: Overall calculation errorstimestamp: Calculation timestamp
Per-Leg Calculations:
vYearsOut: Volatility years to expirydYearsOut: Calendar days to expiry / 365.0sdivOut: Continuous dividend yieldrateOut: Discount rateeffStrikeOut: Effective strike (implied surface strike if PctVariable)sVolOut: Leg surface volatilitysPrcOut: Leg surface price- Greeks: deltaOut, gammaOut, thetaOut, vegaOut, volgaOut, vannaOut, rhoOut, phiOut
errorOut: Per-leg error messages
Key Features
- Works with FLEX options
- Handles multiple legs
- Supports variable strike legs (one per spread)
- Real-time pricing with live market data
3. Single Option Calculator
The Single Option Calculator provides detailed pricing and risk metrics for individual options, with two primary calculation modes: price-to-volatility and volatility-to-price.
Key Messages
| Message | Source | Description |
|---|---|---|
| GetOptionPrice | Client | Calculate option price from volatility |
| GetOptionVolatility | Client | Calculate implied volatility from price |
GetOptionPrice
Calculate theoretical option price and Greeks given volatility and other parameters.
Input Parameters
- Option Key: Can be Listed or FLEX
- Override Values:
vol: Volatility (uses SR surface if not supplied)uPrc: Underlying priceyears: Years to expirationsdiv: Continuous dividend yieldrate: Discount rateexType: Exercise type (American/European)exTime: Exercise time (AM/PM)holidayCalendar: Holiday calendar codetimeMetric: Time metric (D252, D365, etc.)modelType: Calculation model typecalcEngine: Numeric engine (FastHybrid, NumericLow/Std/Max)incGreeks: Include Greeks calculation (Yes/No)DiscreteDividend: (optional) if not supplied will be inferred from optionable ticker (if possible)
Calculated Values
- Price: Theoretical option premium
- Greeks: Full set if
incGreeksis set to Yes - Additional Metrics: Effective strike, interest days, dividend Amount + Present Value
GetOptionVolatility
Calculate implied volatility given option price and other parameters.
Input Parameters
- Option Key: Can be Listed or FLEX
- Override Values:
price: Option Premium (must be supplied)uPrc: Underlying priceyears: Years to expirationsdiv: Continuous dividend yieldrate: Discount rateexType: Exercise type (American/European)exTime: Exercise time (AM/PM)holidayCalendar: Holiday calendar codetimeMetric: Time metric (D252, D365, etc.)modelType: Calculation model typecalcEngine: Numeric engine (FastHybrid, NumericLow/Std/Max)incGreeks: Include Greeks calculation (Yes/No)DiscreteDividend: (optional) if not supplied will be inferred from optionable ticker (if possible)
Calculated Values
- Implied Volatility: Calculated from given price
- Greeks: Full set if
incGreeksis set to Yes - Additional Metrics: Effective strike, dividend Amount
Calculation Engines
- FastHybrid: Optimized for listed strikes with SR discrete dividends (fastest)
- NumericLow:
- NumericStd:
- NumericMax: Maximum precision (slowest, most accurate)
Common Features
Parameter Overrides
All calculators support overriding default values:
- Volatility: Custom implied volatility
- Underlying Price: Alternative spot price
- Interest Rate: Custom risk-free rate
- Dividend Yield: Override dividend assumptions
- Pricing Model: Choose between models
FLEX Options Support
For FLEX options, the calculators use FLEX Volatility Interpolation to calculate appropriate volatility values.
Error Handling
Each calculator response includes:
- Calculation status
- Error codes and messages
- Warnings for edge cases
- Pricing input quality indicators
Getting Started
- Review the general MLink/WebSocket API documentation
- Obtain API credentials via API Keys
- Test with Postman examples