# Market-Neutral ETH/BTC & COIN/BTC Pair Trading Agent on Eterna MCP

> Use Eterna's unified USDT perpetual margin to run market-neutral pair trades - such as long ETHUSDT / short BTCUSDT or long COINUSDT / short BTCUSDT - sized in equal USD notionals inside one `execute_code` block so both legs fill milliseconds apart at 0.014%/0.035% fees.

- Canonical URL: https://ai.eterna.exchange/strategies/btc-eth-pair-trading-agent
- Last updated: November 23, 2026
- Author: Eterna Quant & AI Team (Agent Strategy Playbooks)
- MCP endpoint: https://mcp.eterna.exchange/mcp

Directional crypto bets live or die on Bitcoin beta. Pair-trading agents isolate relative outperformance (for example SOL vs ETH or MSTR vs BTC) while hedging broad market direction.

## Key Facts

| Metric | Value | Notes |
|--------|-------|-------|
| Unified Collateral | Single USDT Margin | Long & short legs share margin |
| Cross-Asset Pairs | Crypto + xStocks | Trade COIN/BTC or MSTR/BTC 24/7 |
| Leg Sync | <200ms atomic block | Minimizes leg-execution drift |
| Fee Advantage | 0.014% / 0.035% | Crucial for 2-leg round trips |

## 1. Relative Strength Ratio Monitor (`execute_code`)

### pair-ratio-check.ts

```typescript
const [btc, eth, btcRsi, ethRsi] = await Promise.all([
  eterna.getTickers({ symbol: "BTCUSDT" }),
  eterna.getTickers({ symbol: "ETHUSDT" }),
  eterna.getRsi({ symbol: "BTCUSDT", interval: "240", period: 14 }),
  eterna.getRsi({ symbol: "ETHUSDT", interval: "240", period: 14 }),
]);

const btcPx = Number(btc[0].lastPrice);
const ethPx = Number(eth[0].lastPrice);
const ratio = ethPx / btcPx;

return {
  ethBtcRatio: Number(ratio.toFixed(6)),
  rsiSpread: Number((ethRsi.value - btcRsi.value).toFixed(2)),
  bias:
    ethRsi.value - btcRsi.value < -12
      ? "MEAN_REVERT_LONG_ETH_SHORT_BTC"
      : ethRsi.value - btcRsi.value > 12
        ? "MEAN_REVERT_SHORT_ETH_LONG_BTC"
        : "NEUTRAL",
};
```

## Frequently Asked Questions

### Can an Eterna agent pair-trade a crypto stock like MSTR or COIN against BTC?

Yes. Because both MSTRUSDT/COINUSDT xStocks and BTCUSDT perpetuals settle in USDT inside the same margin account, an agent can open equal-notional long/short pairs 24/7.

## References & Primary Sources

- [MSTR AI Market Guide](https://ai.eterna.exchange/markets/mstr): MicroStrategy (MSTR) 24/7 USDT perp specs.

## Related Guides

- [AI Trading for Bitcoin (BTCUSDT) via Eterna MCP](https://ai.eterna.exchange/markets/btc)
- [AI Trading for Ethereum (ETHUSDT) via Eterna MCP](https://ai.eterna.exchange/markets/eth)
- [AI Trading for Strategy (MSTR) Stock Perp (MSTRUSDT) via Eterna MCP](https://ai.eterna.exchange/markets/mstr)
- [AI Trading for Coinbase Stock Perp (COINUSDT) via Eterna MCP](https://ai.eterna.exchange/markets/coin)
