# Price `Spread` Instrument for a Commodity Using `BlackScholes` Model and Analytic Pricers

This example shows the workflow to price a commodity `Spread` instrument when you use a `BlackScholes` model and `Kirk` and `BjerksundStensland` analytic pricing methods.

In the petroleum industry, refiners are concerned about the difference between their input costs (crude oil) and output prices (refined products — gasoline, heating oil, diesel fuel, and so on). The differential between these two underlying commodities is referred to as a crack spread. It represents the profit margin between crude oil and the refined products.

A spread option is an option on the spread where the holder has the right, but not the obligation, to enter into a spot or forward spread contract. Crack spread options are often used to protect against declines in the crack spread or to monetize volatility or price expectations on the spread.

### Define the Commodity

Assume that current gasoline prices are strong, and you want to model a crack spread option strategy to protect the gasoline margin. A crack spread option strategy is used to maintain profits for the following season. The WTI crude oil futures are at \$93.20 per barrel and RBOB gasoline futures contract are at \$2.85 per gallon.

```Strike = 20; Rate = 0.05; Settle = datetime(2020,1,1); Maturity = datemnth(Settle,3); % Price and volatility of RBOB gasoline PriceGallon1 = 2.85; % Dollars per gallon Price1 = PriceGallon1 * 42; % Dollars per barrel Vol1 = 0.29; % Price and volatility of WTI crude oil Price2 = 93.20; % Dollars per barrel Vol2 = 0.36; % Correlation between the prices of the commodities Corr = 0.42;```

### Create `Spread` Instrument Object

Use `fininstrument` to create a `Spread` instrument object.

`SpreadOpt = fininstrument("Spread", 'ExerciseDate', Maturity, 'Strike', Strike,'ExerciseStyle',"european",'Name',"spread_instrument")`
```SpreadOpt = Spread with properties: OptionType: "call" Strike: 20 ExerciseStyle: "european" ExerciseDate: 01-Apr-2020 Name: "spread_instrument" ```

### Create `BlackScholes` Model Object

Use `finmodel` to create a `BlackScholes` model object.

`BlackScholesModel = finmodel("BlackScholes", 'Volatility', [Vol1,Vol2], 'Correlation', [1 Corr; Corr 1]);`

### Create `ratecurve` Object

Create a flat `ratecurve` object using `ratecurve`.

`ZeroCurve = ratecurve('zero', Settle, Maturity, Rate, 'Basis', 1);`

### Create `BjerksundStensland` Pricer Object

Use `finpricer` to create a `BjerksundStensland` pricer object and use the `ratecurve` object for the `'DiscountCurve'` name-value pair argument.

`BJSPricer = finpricer("Analytic", 'Model', BlackScholesModel, 'SpotPrice', [Price1 , Price2], 'DiscountCurve', ZeroCurve,'PricingMethod', "BjerksundStensland");`

### Create `Kirk` Pricer Object

Use `finpricer` to create a `Kirk` pricer object and use the `ratecurve` object for the `'DiscountCurve'` name-value pair argument.

`KirkPricer = finpricer("Analytic", 'Model', BlackScholesModel,'SpotPrice', [Price1 , Price2], 'DiscountCurve', ZeroCurve,'PricingMethod', "Kirk");`

### Price `Spread` Instrument Using `BjerksundStensland` and `Kirk` Analytic Pricing Methods

Use `price` to compute the price and sensitivities for the commodity `Spread` instrument.

```[PriceKirk, outPR_Kirk] = price(KirkPricer, SpreadOpt, "all"); [PriceBJS, outPR_BJS] = price(BJSPricer, SpreadOpt, "all"); [outPR_Kirk.Results; outPR_BJS.Results]```
```ans=2×7 table Price Delta Gamma Lambda Vega Theta Rho _____ ___________________ ____________________ _________________ ________________ _______ ______ 11.19 0.67224 -0.60665 0.019081 0.021662 7.1907 -6.4891 11.299 9.8869 -14.539 3.1841 11.2 0.67371 -0.60816 0.018992 0.021572 7.2003 -6.4997 11.198 9.9878 -14.555 3.1906 ```