# Futures Statistical Arbitrage Strategy AI Agent Connect

> Identify mean-reverting opportunities between futures contracts using cointegration testing.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_6XVJTVY6v6Lz6svDppsQGEmUwQm02VaZXf9mnZ0P/ai-agent-connect
- **Tags:** futures, arbitrage, cointegration, statistical-arbitrage, quantitative-finance

## Description

This MCP server provides deterministic statistical arbitrage tools for futures markets. It uses the Engle-Granger cointegration test to identify stable relationships between asset pairs. Users can use `analyze_pair_cointegration` to verify if a pair is mathematically suitable for trading based on liquidity and stationarity. Once a pair is validated, `generate_trading_signals` calculates precise entry, exit, and dollar-neutral position sizing based on z-score deviations. Additionally, `get_market_regime_summary` provides real-time health assessments of the asset relationship.

## Tools

### analyze_pair_cointegration
Evaluates if two futures contracts are mathematically suitable for a mean-reversion strategy

### generate_trading_signals
Calculates entry, exit, and sizing instructions based on current spread deviation

### get_market_regime_summary
Provides a high-level summary of the relationship health between two assets

## Prompt Examples

**Prompt:** 
```
Check if Gold and Silver futures are suitable for a mean-reversion strategy using a 252-day lookback.
```

**Response:** 
```
The pair is viable. The ADF p-value is 0.03, the half-life is 42 days, and both assets have sufficient liquidity.
```

**Prompt:** 
```
Generate a trading signal for a spread with a z-score of 2.5, a hedge ratio of 1.2, and $100,000 available capital.
```

**Response:** 
```
Signal: BUY_SPREAD. Position Size A: $50,000, Position Size B: $50,000 (adjusted by hedge ratio).
```

**Prompt:** 
```
What is the current market regime for a pair with a p-value of 0.07 and a half-life of 30 days?
```

**Response:** 
```
The regime status is Weakly Cointegrated.
```

## Frequently Asked Questions

**How does the system determine if a pair is tradeable?**
The system uses `analyze_pair_cointegration` to check if the pair has an ADF p-value below 0.10, a half-life of mean reversion under 60 days, and both assets have an Open Interest greater than 10,000.

**What kind of signals are generated?**
The `generate_trading_signals` tool produces BUY_SPREAD, SELL_SPREAD, EXIT, or HOLD signals based on z-score thresholds, ensuring dollar-neutral position sizing.

**Can I monitor the stability of the spread?**
Yes, you can use `get_market_regime_summary` to receive a status report such as 'Stable Cointegrated' or 'Unstable' based on the current p-value and half-life.
