> For the complete documentation index, see [llms.txt](https://docs.bv7x.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bv7x.ai/agentic-commerce/copy-trading.md).

# Copy-Trading for Agents

Build an automated agent that replicates BV-7X trades on any exchange. This guide covers the architecture and integration points.

***

## Overview

BV-7X publishes a structured trade intent after each daily signal. Your agent can consume this intent and execute matching trades on Binance, Bybit, Bitget, or any exchange with an API.

***

## Two Integration Methods

### 1. Poll the Copy-Trade API

```bash
curl https://bv7x.ai/api/bv7x/copy-trade/next \
  -H "Authorization: Bearer <token>"
```

Poll once per day after 21:37 UTC. The response includes direction, confidence, Kelly sizing, and Polymarket token IDs. See [Copy-Trade API](/use-the-signal/trade-the-forecast/copy-trade.md).

### 2. Subscribe via WebSocket

```javascript
const ws = new WebSocket("wss://bv7x.ai/ws/signal?token=<token>");

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  if (msg.type === "signal.new") {
    executeTrade(msg.data);
  }
};
```

WebSocket delivers the signal the moment it fires (\~21:35 UTC), giving you a head start over polling. See [WebSocket](/use-the-signal/read-the-forecast/websocket.md).

***

## Example Agent Flow

```
21:35 UTC  Signal fires
    |
    v
  Agent receives signal.new via WebSocket
    |
    v
  Agent reads: direction=SELL, confidence=0.615, regime=BEAR_TREND
    |
    v
  Agent calculates position size (Kelly fraction * capital)
    |
    v
  Agent places short on exchange via API
    |
    v
  7 days later: signal.resolved event arrives
    |
    v
  Agent closes position and logs P&L
```

***

## Position Sizing

The copy-trade response includes a Kelly fraction:

```json
{
  "sizing": {
    "kellyFraction": 0.046,
    "suggestedSize": "4.6%",
    "maxLeverage": "3x"
  }
}
```

* **Kelly fraction**: Mathematically optimal bet size based on edge and odds
* **Suggested size**: Percentage of capital to allocate
* **Max leverage**: Upper bound on leverage (not a recommendation)

Most practitioners use half-Kelly (2.3% in this example) to reduce variance.

***

## Building Your Agent

### Minimum Requirements

1. **Authentication**: Verify wallet and obtain bearer token (see [Token Verification](/use-the-signal/read-the-forecast/token-verification.md))
2. **Signal consumption**: Poll API or subscribe to WebSocket
3. **Exchange integration**: API keys for your exchange of choice
4. **Position management**: Open, monitor, and close positions based on signals

### Recommended Additions

* **Regime filtering**: Skip trades in CHOP regime (low conviction)
* **Confidence threshold**: Only trade when confidence exceeds your minimum
* **Risk limits**: Cap position size, enforce max drawdown, set stop-losses
* **Logging**: Record every trade for performance analysis

***

## Python Skeleton

```python
import requests, time

TOKEN = "eyJhbGci..."
BASE = "https://bv7x.ai"

def check_signal():
    resp = requests.get(f"{BASE}/api/bv7x/copy-trade/next",
        headers={"Authorization": f"Bearer {TOKEN}"})
    return resp.json()["trade"]

def execute_trade(trade):
    direction = trade["direction"]
    size = trade["sizing"]["kellyFraction"] * CAPITAL * 0.5  # half-Kelly
    # Place order on your exchange here
    print(f"Placing {direction} for ${size:.2f}")

while True:
    trade = check_signal()
    if trade["confidence"] > 0.55:
        execute_trade(trade)
    time.sleep(86400)  # check once per day
```

***

## Important Notes

* BV-7X signals are informational, not financial advice
* Always use your own risk management on top of the oracle's sizing
* The 7-day horizon means positions are held for up to a week
* Signals update once daily -- there is no intraday re-balancing
* Premium tier (1B+ $BV7X) is required for the copy-trade endpoint

***

## Next

* [Copy-Trade API](/use-the-signal/trade-the-forecast/copy-trade.md) -- full response schema
* [WebSocket](/use-the-signal/read-the-forecast/websocket.md) -- real-time event subscription
