# Reverse Cash-and-Carry Arbitrage Engine AI Agent Connect

> Identify and calculate deterministic arbitrage signals in backwardation markets.

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

## Description

This MCP server provides a deterministic engine to exploit backwardation by identifying underpriced futures. It calculates the theoretical fair value of contracts and generates precise trade signals. Use `calculate_arbitrage_signals` to detect entry points where the annualized basis is attractive, or `get_theoretical_fair_value` to compute the fair market value based on the cost of carry. The engine also includes `evaluate_risk_metrics` to assess market safety by analyzing borrowing costs and convenience yield volatility.

## Tools

### calculate_arbitrage_signals
Determines if a trade signal is generated based on historical or daily market data and calculates position parameters

### evaluate_risk_metrics
Analyzes the risk profile of the current market environment to validate if the strategy is safe to execute

### get_theoretical_fair_value
Computes the fair market value of a futures contract at a specific point in time

## Prompt Examples

**Prompt:** 
```
Calculate arbitrage signals for these prices: spot [100, 102], futures [95, 96], open interest [15000, 16000], days to expiry [45, 44], risk-free rate 0.03, borrowing cost 0.02, convenience yield 0.01, transaction costs 0.1.
```

**Response:** 
```
The signal is a BUY futures and SELL spot position. Spot Price: 100, Futures Price: 95, Theoretical Price: 100.32, Basis: -5.0%, Annualized Yield: -8.2%, Days to Expiry: 45, Position Size: 1000, Margin Requirement: 5000.
```

**Prompt:** 
```
What is the theoretical fair value for a spot price of 50 with a 4% risk-free rate, 2% convenience yield, and 30 days to expiry?
```

**Response:** 
```
The theoretical fair value is 50.08.
```

**Prompt:** 
```
Evaluate the risk for a basis of -0.02, annualized basis of -0.09, borrowing cost of 0.04, and convenience yield volatility of 0.05.
```

**Response:** 
```
The market is safe to trade. Risk Score: 0.45. Convenience Yield Risk Alert: False.
```

## Frequently Asked Questions

**What is the primary market condition this tool targets?**
The engine specifically targets backwardation, where futures prices are lower than the spot price, allowing for a reverse cash-and-carry strategy.

**How are trade signals generated?**
Signals are generated via `calculate_arbitrage_signals` when the actual futures price is lower than the theoretical fair value minus transaction costs, provided the annualized basis is below -8% and liquidity requirements are met.

**Can I assess the risk of a trade before executing?**
Yes, you can use `evaluate_risk_metrics` to analyze the risk profile, including borrowing costs and potential spikes in convenience yield.
