# Crack Spread Strategy AI Agent Connect

> Analyze refining margins and identify mean-reversion opportunities using a 3:2:1 crack spread model.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_gOihIUniw9W2YKCAoVjw2hd00JOl0O1Ymuqj6kl4/ai-agent-connect
- **Tags:** oil, refining, futures, quantitative, energy

## Description

This MCP server provides a deterministic toolset for analyzing refining margins. By applying a 3:2:1 ratio model, it calculates the crack spread--the profit margin between crude oil and its refined products (gasoline and heating oil). The server uses statistical Z-Scores to identify mean-reversion opportunities: a low Z-Score indicates compressed margins (BUY signal), while a high Z-Score indicates expanded margins (SELL signal). It includes built-in liquidity filters and historical context analysis to ensure executable and informed trading decisions.

## Tools

### analyze_crack_spread
Calculates the daily crack spread, statistical indicators, and generates trading signals

### get_historical_context
Retrieves the historical price range and seasonal trends

### validate_market_liquidity
Checks if the current market conditions meet the minimum requirements for profitable execution

## Prompt Examples

**Prompt:** 
```
Analyze the current crack spread using recent crude, gasoline, and heating oil prices.
```

**Response:** 
```
The current crack spread is $6.50 per barrel with a Z-Score of -2.2. Since the margin is above $5 and liquidity is sufficient, the signal is BUY (Short 3 Crude, Long 2 Gasoline, Long 1 Heating Oil).
```

**Prompt:** 
```
Check if the market is liquid enough for a crack spread trade.
```

**Response:** 
```
The market is liquid. All contracts meet the minimum open interest requirement of 10,000.
```

**Prompt:** 
```
What are the historical seasonal trends for crack spreads?
```

**Response:** 
```
Historically, crack spreads tend to peak during the summer driving season due to increased gasoline demand.
```

## Frequently Asked Questions

**What is the 3:2:1 ratio used in the analysis?**
The 3:2:1 ratio represents the standard refining yield where 3 barrels of crude oil produce 2 barrels of gasoline and 1 barrel of heating oil.

**How are trading signals generated?**
Signals are generated using the `analyze_crack_spread` tool, which calculates a Z-Score. A BUY signal is triggered when the Z-Score is below -2.0, and a SELL signal when it is above 2.0, provided liquidity and margin requirements are met.

**Does this tool check for market liquidity?**
Yes, the `validate_market_liquidity` tool ensures that all constituent contracts have an open interest greater than 10,000 before a signal is considered valid.
