# Order Book Imbalance Detector AI Agent Connect

> Detect market microstructure imbalances and spoofing risks in the Polymarket CLOB.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_Twshezh7vSWDSkeh0qjeSKxYty0A8hNbWPOliEqO/ai-agent-connect
- **Tags:** polymarket, clob, imbalance, spoofing, liquidity

## Description

This MCP server provides deterministic microstructure analysis for the Polymarket Central Limit Order Book (CLOB). It allows AI agents to identify short-term price direction by analyzing liquidity skew and execution flow. Key capabilities include calculating the exact imbalance ratio to predict price pressure, evaluating `assess_spoofing_risk` to detect manipulative large orders, and using `calculate_execution_strategy` to determine optimal limit order placement. It is designed to help agents identify BUY or SELL signals based on real-time supply and demand imbalances.

## Tools

### assess_spoofing_risk
Evaluates whether large orders are likely being used to manipulate the perception of liquidity

### calculate_execution_strategy
Recommends specific limit order placement to capitalize on the identified imbalance

### get_imbalance_metrics
Calculates the core imbalance ratio and identifies the predicted price pressure

## Prompt Examples

**Prompt:** 
```
What is the current market imbalance and predicted direction?
```

**Response:** 
```
The current imbalance ratio is 0.75, which indicates upward price pressure and a BUY signal.
```

**Prompt:** 
```
Is there any significant spoofing risk in the current order book?
```

**Response:** 
```
No, all large orders are currently within 5% of the mid-price, indicating low spoofing risk.
```

**Prompt:** 
```
Recommend a limit order strategy based on the current imbalance of 0.25.
```

**Response:** 
```
With an imbalance ratio of 0.25, the recommended strategy is a SELL limit order at the best available ask price.
```

## Frequently Asked Questions

**How is the imbalance ratio calculated?**
The ratio is calculated as the sum of all bid volumes divided by the total volume (sum of bid volumes plus sum of ask volumes).

**What triggers a BUY or SELL signal?**
A BUY signal is triggered when the imbalance ratio exceeds 0.70, indicating upward pressure. A SELL signal is triggered when the ratio falls below 0.30, indicating downward pressure.

**How does the tool detect spoofing?**
The `assess_spoofing_risk` tool flags a high risk if any large order is positioned more than 5% away from the current mid-price.
