Commodities
Forwards, carry, convenience yield, roll yield, spreads and term structure.
Price commodity forwards from storage and convenience yield, infer either from the curve, decompose roll returns and classify the term structure as contango or backwardation.
Common APIs
fn
commodityForwardPriceTHEORETICAL cost-of-carry forward price: `spotPrice × G(netCarryRate, timeToDeliveryYears)` where `netCarryRate = annualFinancingRate + annualStorageCostRate − annualConvenienceYield` and `G` is the compounding growth…fncommodityCarryThe annualized TOTAL carry a spot/forward pair implies, by inverting the compounding growth factor.fnimpliedConvenienceYieldThe convenience yield the spot/forward pair implies, given the other carry components — the inverse of {@link commodityForwardPrice} solved for `annualConvenienceYield`.fnrollYieldThe roll yield when rolling a LONG position from the expiring contract into the next: `(expiring − next) / next`.fnrollReturnDecompositionDecompose the return on a long futures position over one holding period ending at a roll.fncalendarSpreadThe calendar spread between two deliveries: the price spread `far − near`, and the annualized continuous carry the pair implies.fntermStructureStateClassify a forward curve's term structure with the reasoning disclosed.fnfuturesHedgeRatioFutures contracts required to hedge an exposure: `exposureQuantity × betaOrHedgeEffectiveness / futuresContractSize`.Complete API reference
Browse all public exports, types, and feature imports below.