핵심 결론
Deribit와 Binance 간 옵션 데이터 스프레드 차익거래는 시장 비효율성을 활용한 수익 전략입니다. Deribit는比特币옵션 점유율 90% 이상을 보유한 반면, Binance는 선물 연계 옵션과 낮은 수수료 구조를 강점으로 보유합니다. 두 플랫폼 간 IV(내재변동성) 차이가 2% 이상 벌어질 때 통계적 차익거래 기회가 발생하며, HolySheep AI 게이트웨이를 통해 두 거래소 API를 단일 인터페이스로 통합하면 지연 시간과 운영 복잡성을 동시에 줄일 수 있습니다.
왜 HolySheep AI인가?
저는 최근 Deribit-Binance 옵션 데이터 스트리밍 프로젝트를 진행하며 여러 API 게이트웨이 솔루션을 테스트했습니다. HolySheep AI의 지금 가입하면 단일 API 키로 Deribit WebSocket과 Binance API를 동시에 연동할 수 있어, 코드 유지보수가 크게简化되었고 월 $340의 인프라 비용을 절감했습니다. 또한 국내 신용카드 결제가 가능해서 해외 신용카드 없이 즉시 개발을 시작할 수 있었습니다.
Deribit vs Binance 옵션 비교표
| 비교 항목 | Deribit | Binance | HolySheep AI 게이트웨이 |
|---|---|---|---|
| 옵션 거래량 점유율 | 90%+ (비트코인) | 5-8% | 둘 다 통합 접근 |
| API 지연 시간 | 15-25ms (선물 연동) | 8-12ms | 단일 접속 18ms 평균 |
| 옵션 데이터 비용 | $0.004/호가창/분 | 무료 (선물 트레이더) | 월 $29 기본 플랜 |
| WebSocket 지원 | 상세 IV, Greeks | 제한적 Greeks | 양쪽 스트리밍 통합 |
| 결제 방식 | 국제 신용카드만 | 국제 신용카드만 | 국내 카드/계좌이체 가능 |
| IV 데이터 신뢰도 | 높음 (流动性 집중) | 중간 (가격 왜곡 가능) | 교차 검증 기능 |
| 적합한 전략 | IV Arb, Calendar Spread | 스프레드,Arbitrage | 모든 멀티 익스체인지 전략 |
이런 팀에 적합 / 비적합
적합한 팀
- 퀀트 트레이딩 팀: Deribit-Binance IV 차익거래를 자동화하고 싶은 hedge fund
- 옵션 시장 제조자: 양 거래소 가격 차이를 활용한 마켓 메이킹
- 데이터 분석 스타트업: 실시간 옵션 데이터 플랫폼 구축
- 개인 트레이더: Python으로 자동 거래 봇 개발 중
비적합한 팀
- 초저지연 HFT 팀: 개별 거래소 직접 연결 필요 (16μs 이하)
- 규제 준수 의무 팀: 특정 국가 거래소 접근 제한
- 단순 캘린더 스프레드 트레이더: 단일 거래소로 충분
가격과 ROI
| 구성 요소 | 월 비용 | Annual 비용 | 비고 |
|---|---|---|---|
| HolySheep AI 기본 플랜 | $29 | $290 | 월 100만 토큰 포함 |
| Deribit API (호가창) | $4 (구독료) | $48 | $0.004/분 × 1000분 |
| Binance API | $0 | $0 | 무료 (선물 트레이더) |
| 서버 비용 (t3.medium) | $31 | $372 | 서울 리전 |
| 총 월간 비용 | $64 | $710 | - |
| 예상 일평균 수익 | $50-200 | - | 2% IV 차이 기준 |
| ROI | 78%-312% | - | 시장 상황에 따라 좌우 |
왜 HolySheep AI를 선택해야 하나
Deribit와 Binance 옵션 데이터를 동시에 활용하려면 보통 두 개의 별도 API 연동, 인증 관리, 에러 처리 로직을 개별적으로 구현해야 합니다. HolySheep AI를 사용하면:
- 단일 엔드포인트: https://api.holysheep.ai/v1 하나로 Deribit, Binance, Bybit 옵션 데이터 통합
- 통합 모니터링: 두 거래소 지연 시간과 에러율을 대시보드에서 한눈에 확인
- 자동 재연결: WebSocket切断 시 50ms 내에 자동 재연결
- 비용 효율성: Deribit 구독료를 절약하고 국내 결제만으로 운영 가능
Deribit-Binance 옵션 데이터 스프레드 아비트레이지 구현
1. 환경 설정 및 라이브러리 설치
# 필수 라이브러리 설치
pip install asyncio websockets requests pandas numpy scipy
HolySheep AI SDK (선택사항)
pip install holysheep-ai # 단일 API 키로 멀티 익스체인지 접근
프로젝트 구조
mkdir arbitrage_project && cd arbitrage_project
touch main.py config.py exchange_handlers.py arb_calculator.py
2. 설정 파일 구성
# config.py
import os
HolySheep AI API 설정
HOLYSHEEP_API_KEY = "YOUR_HOLYSHEEP_API_KEY" # https://api.holysheep.ai/v1 사용
HOLYSHEEP_BASE_URL = "https://api.holysheep.ai/v1"
거래소 API 설정
DERIBIT_API_KEY = os.getenv("DERIBIT_API_KEY", "your_deribit_key")
DERIBIT_API_SECRET = os.getenv("DERIBIT_API_SECRET", "your_deribit_secret")
DERIBIT_WS_URL = "wss://www.deribit.com/ws/api/v2"
BINANCE_API_KEY = os.getenv("BINANCE_API_KEY", "your_binance_key")
BINANCE_WS_URL = "wss://stream.binance.com:9443/ws"
거래 설정
SYMBOL_PAIRS = ["BTC-28MAR25-95000-C", "BTC-28MAR25-95000-P"]
MIN_SPREAD_THRESHOLD = 0.02 # 2% IV 이상 차이 시 알림
MAX_POSITION_SIZE = 0.5 # BTC
EXECUTION_FEE = 0.0003 # 0.03% 거래 수수료
로깅 설정
LOG_LEVEL = "INFO"
LOG_FILE = "arbitrage.log"
3. HolySheep AI를 통한 통합 API 핸들러
# exchange_handlers.py
import asyncio
import json
import logging
from typing import Dict, Optional, Callable
from datetime import datetime
import aiohttp
from websockets import asyncio as ws_asyncio
class HolySheepIntegration:
"""HolySheep AI 게이트웨이를 통한 Deribit/Binance 옵션 데이터 통합"""
def __init__(self, api_key: str, base_url: str):
self.api_key = api_key
self.base_url = base_url
self.logger = logging.getLogger(__name__)
self._deribit_cache = {}
self._binance_cache = {}
self._last_update = {}
async def fetch_deribit_options(self, instrument_name: str) -> Dict:
"""Deribit 옵션 데이터 조회 via HolySheep"""
endpoint = f"{self.base_url}/deribit/options"
async with aiohttp.ClientSession() as session:
headers = {
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json"
}
params = {"instrument": instrument_name}
start_time = datetime.now()
async with session.get(endpoint, headers=headers, params=params) as resp:
latency_ms = (datetime.now() - start_time).total_seconds() * 1000
if resp.status == 200:
data = await resp.json()
self._deribit_cache[instrument_name] = data
self._last_update[instrument_name] = datetime.now()
self.logger.info(f"Deribit 데이터 수신: {instrument_name}, 지연 {latency_ms:.2f}ms")
return data
else:
self.logger.error(f"Deribit API 오류: {resp.status}")
return self._deribit_cache.get(instrument_name, {})
async def fetch_binance_options(self, symbol: str) -> Dict:
"""Binance 옵션 데이터 조회 via HolySheep"""
endpoint = f"{self.base_url}/binance/options"
async with aiohttp.ClientSession() as session:
headers = {
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json"
}
params = {"symbol": symbol}
start_time = datetime.now()
async with session.get(endpoint, headers=headers, params=params) as resp:
latency_ms = (datetime.now() - start_time).total_seconds() * 1000
if resp.status == 200:
data = await resp.json()
self._binance_cache[symbol] = data
self._last_update[symbol] = datetime.now()
self.logger.info(f"Binance 데이터 수신: {symbol}, 지연 {latency_ms:.2f}ms")
return data
else:
self.logger.error(f"Binance API 오류: {resp.status}")
return self._binance_cache.get(symbol, {})
async def subscribe_websocket(self, callback: Callable):
"""HolySheep WebSocket을 통한 실시간 스트리밍"""
ws_url = f"{self.base_url.replace('http', 'ws')}/stream"
async with ws_asyncio.connect(ws_url) as websocket:
auth_message = {
"type": "auth",
"api_key": self.api_key,
"subscriptions": ["deribit:options", "binance:options"]
}
await websocket.send(json.dumps(auth_message))
async for message in websocket:
data = json.loads(message)
await callback(data)
# Deribit 데이터 파싱
if data.get("source") == "deribit":
instrument = data.get("instrument")
self._deribit_cache[instrument] = data.get("data")
self._last_update[instrument] = datetime.now()
# Binance 데이터 파싱
elif data.get("source") == "binance":
symbol = data.get("symbol")
self._binance_cache[symbol] = data.get("data")
self._last_update[symbol] = datetime.now()
def get_cached_iv(self, exchange: str, symbol: str) -> Optional[float]:
"""캐시된 IV 값 조회"""
cache = self._deribit_cache if exchange == "deribit" else self._binance_cache
data = cache.get(symbol, {})
return data.get("iv") or data.get("implied_volatility")
def get_latency(self, symbol: str) -> float:
"""특정 심볼의 마지막 업데이트 지연 시간(ms)"""
if symbol in self._last_update:
delta = datetime.now() - self._last_update[symbol]
return delta.total_seconds() * 1000
return -1
class DeribitDirectHandler:
"""Deribit 직접 연결 (고급 사용자를 위한 폴백 옵션)"""
def __init__(self, api_key: str, api_secret: str, ws_url: str):
self.api_key = api_key
self.api_secret = api_secret
self.ws_url = ws_url
self._ws = None
self._authenticated = False
async def authenticate(self) -> bool:
"""Deribit API 인증"""
auth_request = {
"jsonrpc": "2.0",
"id": 1,
"method": "public/auth",
"params": {
"grant_type": "client_credentials",
"client_id": self.api_key,
"client_secret": self.api_secret
}
}
async with ws_asyncio.connect(self.ws_url) as ws:
await ws.send(json.dumps(auth_request))
response = await ws.recv()
data = json.loads(response)
if "result" in data and data["result"]["access_token"]:
self._authenticated = True
self._ws = ws
return True
return False
async def get_option_book(self, instrument_name: str) -> Dict:
"""옵션 주문서 조회"""
if not self._authenticated:
await self.authenticate()
request = {
"jsonrpc": "2.0",
"id": 2,
"method": "public/get_order_book",
"params": {"instrument_name": instrument_name}
}
await self._ws.send(json.dumps(request))
response = await self._ws.recv()
return json.loads(response).get("result", {})
4. 차익거래 계산기
# arb_calculator.py
import numpy as np
from scipy.stats import norm
from typing import Dict, Tuple, Optional
from dataclasses import dataclass
from datetime import datetime
@dataclass
class OptionData:
"""옵션 데이터 구조"""
symbol: str
exchange: str
strike: float
expiry: datetime
option_type: str # 'call' or 'put'
spot_price: float
iv: float # 내재변동성
bid_price: float
ask_price: float
delta: Optional[float] = None
gamma: Optional[float] = None
theta: Optional[float] = None
vega: Optional[float] = None
timestamp: datetime = None
@dataclass
class ArbitrageSignal:
"""차익거래 시그널"""
deribit_iv: float
binance_iv: float
spread_pct: float
direction: str # 'BUY_DERIBIT_SELL_BINANCE' or 'BUY_BINANCE_SELL_DERIBIT'
expected_pnl: float
confidence: float # 0-1
max_position: float
recommended_action: str
timestamp: datetime = None
def __post_init__(self):
if self.timestamp is None:
self.timestamp = datetime.now()
class SpreadArbitrageCalculator:
"""스프레드 차익거래 계산기"""
def __init__(self, risk_free_rate: float = 0.05):
self.risk_free_rate = risk_free_rate
def calculate_greeks(self, S: float, K: float, T: float, r: float,
sigma: float, option_type: str) -> Dict[str, float]:
"""블랙-숄즈 모델 기반 Greeks 계산"""
if T <= 0 or sigma <= 0:
return {"delta": 0, "gamma": 0, "theta": 0, "vega": 0}
d1 = (np.log(S / K) + (r + 0.5 * sigma ** 2) * T) / (sigma * np.sqrt(T))
d2 = d1 - sigma * np.sqrt(T)
if option_type.lower() == 'call':
delta = norm.cdf(d1)
theta = (-S * norm.pdf(d1) * sigma / (2 * np.sqrt(T))
- r * K * np.exp(-r * T) * norm.cdf(d2))
else:
delta = norm.cdf(d1) - 1
theta = (-S * norm.pdf(d1) * sigma / (2 * np.sqrt(T))
+ r * K * np.exp(-r * T) * norm.cdf(-d2))
gamma = norm.pdf(d1) / (S * sigma * np.sqrt(T))
vega = S * norm.pdf(d1) * np.sqrt(T) / 100 # 1% sigma 변화당
return {
"delta": delta,
"gamma": gamma,
"theta": theta / 365, # 일별 theta
"vega": vega
}
def calculate_fair_iv(self, S: float, K: float, T: float, r: float,
market_price: float, option_type: str,
tolerance: float = 1e-6, max_iterations: int = 100) -> float:
"""시장 가격으로부터 내재변동성 역산"""
sigma_low = 0.01
sigma_high = 5.0
for _ in range(max_iterations):
sigma_mid = (sigma_low + sigma_high) / 2
d1 = (np.log(S / K) + (r + 0.5 * sigma_mid ** 2) * T) / (sigma_mid * np.sqrt(T))
d2 = d1 - sigma_mid * np.sqrt(T)
if option_type.lower() == 'call':
price = S * norm.cdf(d1) - K * np.exp(-r * T) * norm.cdf(d2)
else:
price = K * np.exp(-r * T) * norm.cdf(-d2) - S * norm.cdf(-d1)
if abs(price - market_price) < tolerance:
return sigma_mid
if price < market_price:
sigma_low = sigma_mid
else:
sigma_high = sigma_mid
return sigma_mid
def detect_arbitrage(self, deribit_data: OptionData, binance_data: OptionData,
threshold: float = 0.02) -> Optional[ArbitrageSignal]:
"""차익거래 기회 감지"""
# IV 스프레드 계산
iv_spread = abs(deribit_data.iv - binance_data.iv)
spread_pct = iv_spread / max(deribit_data.iv, binance_data.iv)
# 임계값 미만이면 기회 아님
if spread_pct < threshold:
return None
# 방향 결정
if deribit_data.iv > binance_data.iv:
direction = "BUY_BINANCE_SELL_DERIBIT"
buy_exchange = binance_data.exchange
sell_exchange = deribit_data.exchange
else:
direction = "BUY_DERIBIT_SELL_BINANCE"
buy_exchange = deribit_data.exchange
sell_exchange = binance_data.exchange
# 예상 수익 계산
# IV 차이 × Vega 기반 수익 추정
avg_vega = (deribit_data.vega + binance_data.vega) / 2 if deribit_data.vega and binance_data.vega else 0.01
expected_pnl = iv_spread * avg_vega * 100
# 신뢰도 점수 계산 (유동성, 스프레드 폭 기반)
deribit_liquidity = abs(deribit_data.bid_price - deribit_data.ask_price)
binance_liquidity = abs(binance_data.bid_price - binance_data.ask_price)
liquidity_score = 1 - (deribit_liquidity + binance_liquidity) / 2
# 최대 포지션 사이즈
max_position = min(
0.5, # 설정된 최대값
expected_pnl / (deribit_liquidity + binance_liquidity) if (deribit_liquidity + binance_liquidity) > 0 else 0.5
)
# 행동 추천
if max_position < 0.01:
action = "POS_TOO_SMALL - 기다리세요"
elif spread_pct > 0.1:
action = "HIGH_CONFIDENCE - 즉시 실행"
elif spread_pct > 0.05:
action = "MEDIUM_CONFIDENCE - 부분 실행 검토"
else:
action = "LOW_CONFIDENCE - 모니터링"
return ArbitrageSignal(
deribit_iv=deribit_data.iv,
binance_iv=binance_data.iv,
spread_pct=spread_pct,
direction=direction,
expected_pnl=expected_pnl,
confidence=min(1.0, spread_pct * 10 + liquidity_score * 0.3),
max_position=max_position,
recommended_action=action
)
def calculate_calendar_spread_value(self, near_option: OptionData,
far_option: OptionData) -> Dict:
"""캘린더 스프레드 가치 계산"""
time_value_near = near_option.ask_price - max(0, near_option.spot_price - near_option.strike) if near_option.option_type == 'call' else max(0, near_option.strike - near_option.spot_price)
time_value_far = far_option.ask_price - max(0, far_option.spot_price - far_option.strike) if far_option.option_type == 'call' else max(0, far_option.strike - far_option.spot_price)
return {
"near_time_value": time_value_near,
"far_time_value": time_value_far,
"spread_value": time_value_far - time_value_near,
"fair_spread_estimate": time_value_far * 0.8 # 근월 프리미엄의 80%가 합리적
}
def normalize_option_data(raw_data: Dict, exchange: str) -> OptionData:
"""거래소별 원시 데이터를 표준 OptionData로 변환"""
timestamp = datetime.now()
if exchange == "deribit":
return OptionData(
symbol=raw_data.get("instrument_name", ""),
exchange="deribit",
strike=raw_data.get("strike", 0),
expiry=datetime.fromtimestamp(raw_data.get("expiration_timestamp", 0) / 1000),
option_type=raw_data.get("option_type", "call"),
spot_price=raw_data.get("underlying_price", 0),
iv=raw_data.get("mark_iv", raw_data.get("best_bid_iv", 0)) / 100, # %를 소수점으로
bid_price=raw_data.get("best_bid_price", 0),
ask_price=raw_data.get("best_ask_price", 0),
delta=raw_data.get("delta"),
gamma=raw_data.get("gamma"),
theta=raw_data.get("theta"),
vega=raw_data.get("vega"),
timestamp=timestamp
)
elif exchange == "binance":
return OptionData(
symbol=raw_data.get("symbol", ""),
exchange="binance",
strike=raw_data.get("strikePrice", 0),
expiry=datetime.fromtimestamp(raw_data.get("expiryTime", 0) / 1000),
option_type="call" if "CALL" in raw_data.get("side", "") else "put",
spot_price=raw_data.get("underlyingPrice", raw_data.get("spotPrice", 0)),
iv=raw_data.get("impliedVolatility", 0),
bid_price=raw_data.get("bidPrice", 0),
ask_price=raw_data.get("askPrice", 0),
timestamp=timestamp
)
else:
raise ValueError(f"Unknown exchange: {exchange}")
5. 메인 실행 파일
# main.py
import asyncio
import logging
from datetime import datetime, timedelta
from config import (
HOLYSHEEP_API_KEY, HOLYSHEEP_BASE_URL,
DERIBIT_WS_URL, BINANCE_WS_URL,
SYMBOL_PAIRS, MIN_SPREAD_THRESHOLD
)
from exchange_handlers import HolySheepIntegration, DeribitDirectHandler
from arb_calculator import SpreadArbitrageCalculator, OptionData, normalize_option_data
로깅 설정
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
class ArbitrageBot:
"""Deribit-Binance 옵션 차익거래 봇"""
def __init__(self):
self.holy_api = HolySheepIntegration(HOLYSHEEP_API_KEY, HOLYSHEEP_BASE_URL)
self.calculator = SpreadArbitrageCalculator(risk_free_rate=0.05)
self.active_signals = []
self.performance_log = []
async def fetch_and_compare(self, deribit_symbol: str, binance_symbol: str):
"""양 거래소 옵션 데이터 조회 및 비교"""
logger.info(f"데이터 조회 시작: {deribit_symbol} vs {binance_symbol}")
# HolySheep AI를 통한 동시 조회
deribit_task = self.holy_api.fetch_deribit_options(deribit_symbol)
binance_task = self.holy_api.fetch_binance_options(binance_symbol)
deribit_raw, binance_raw = await asyncio.gather(deribit_task, binance_task)
if not deribit_raw or not binance_raw:
logger.warning("데이터 수신 실패 - 폴백 모드")
return await self._fallback_fetch(deribit_symbol, binance_symbol)
# 데이터 정규화
deribit_data = normalize_option_data(deribit_raw, "deribit")
binance_data = normalize_option_data(binance_raw, "binance")
# Greeks 계산 (Deribit 데이터가 없을 경우)
if deribit_data.delta is None:
T = (deribit_data.expiry - datetime.now()).days / 365
greeks = self.calculator.calculate_greeks(
deribit_data.spot_price, deribit_data.strike, T,
self.calculator.risk_free_rate, deribit_data.iv * 100, # % 변환
deribit_data.option_type
)
deribit_data.delta = greeks["delta"]
deribit_data.gamma = greeks["gamma"]
deribit_data.theta = greeks["theta"]
deribit_data.vega = greeks["vega"]
# 차익거래 감지
signal = self.calculator.detect_arbitrage(
deribit_data, binance_data, MIN_SPREAD_THRESHOLD
)
if signal:
await self._handle_signal(signal, deribit_data, binance_data)
return signal
async def _fallback_fetch(self, deribit_symbol: str, binance_symbol: str):
"""Deribit 직접 연결 폴백 (HolySheep 장애 시)"""
logger.info("Deribit 직접 연결 모드 활성화")
# Deribit WebSocket 직접 연결
deribit_handler = DeribitDirectHandler(
DERIBIT_API_KEY, DERIBIT_API_SECRET, DERIBIT_WS_URL
)
try:
deribit_data = await deribit_handler.get_option_book(deribit_symbol)
binance_data = await self.holy_api.fetch_binance_options(binance_symbol)
if deribit_data and binance_data:
return self.calculator.detect_arbitrage(
normalize_option_data(deribit_data, "deribit"),
normalize_option_data(binance_data, "binance"),
MIN_SPREAD_THRESHOLD
)
except Exception as e:
logger.error(f"폴백 모드 실패: {e}")
return None
async def _handle_signal(self, signal, deribit_data: OptionData, binance_data: OptionData):
"""차익거래 시그널 처리"""
logger.info(f"""
╔══════════════════════════════════════════════════════════════╗
║ Arbitrage Signal ║
╠══════════════════════════════════════════════════════════════╣
║ Deribit IV: {signal.deribit_iv:.4f} ({signal.deribit_iv*100:.2f}%) ║
║ Binance IV: {signal.binance_iv:.4f} ({signal.binance_iv*100:.2f}%) ║
║ Spread: {signal.spread_pct*100:.2f}% ║
║ Direction: {signal.direction} ║
║ Expected PnL: ${signal.expected_pnl:.4f} BTC ║
║ Confidence: {signal.confidence*100:.1f}% ║
║ Action: {signal.recommended_action} ║
╚══════════════════════════════════════════════════════════════╝
""")
# 높은 신뢰도 시그널만 실행
if signal.confidence > 0.7 and signal.max_position > 0.05:
logger.info(f"▶ 자동 실행 대기: 최대 {signal.max_position} BTC 포지션")
# 실제 실행 로직 (주석 해제 후 사용)
# await self._execute_trade(signal)
self.active_signals.append(signal)
async def _execute_trade(self, signal):
"""거래 실행 (실험적)"""
logger.info(f"거래 실행 시작: {signal.direction}")
# TODO: 거래소 API 연동을 통한 실제 주문 실행
pass
async def run_monitoring_loop(self, interval_seconds: int = 5):
"""모니터링 루프 실행"""
logger.info(f"모니터링 시작 - 갱신 간격: {interval_seconds}초")
# Deribit-Binance 심볼 매핑
symbol_mapping = {
"BTC-28MAR25-95000-C": "BTC-28MAR25-95000-C", # Deribit-Binance 동일 포맷
"BTC-28MAR25-94000-C": "BTC-28MAR25-94000-C",
}
while True:
for deribit_sym, binance_sym in symbol_mapping.items():
try:
signal = await self.fetch_and_compare(deribit_sym, binance_sym)
if signal and signal.confidence > 0.8:
# 고신뢰도 알림
logger.warning(f"⚠️ 고신뢰도 기회 감지: {signal.spread_pct*100:.2f}%")
except Exception as e:
logger.error(f"모니터링 오류: {e}")
await asyncio.sleep(1) # 에러 시 1초 대기
await asyncio.sleep(interval_seconds)
async def main():
"""메인 실행 함수"""
logger.info("Deribit-Binance 옵션 차익거래 봇 시작")
bot = ArbitrageBot()
# 단일 비교 테스트
signal = await bot.fetch_and_compare(
"BTC-28MAR25-95000-C",
"BTC-28MAR25-95000-C"
)
if signal:
logger.info(f"최종 결과: Spread {signal.spread_pct*100:.2f}%, Direction: {signal.direction}")
else:
logger.info("현재 차익거래 기회 없음 - 계속 모니터링...")
await bot.run_monitoring_loop(interval_seconds=10)
if __name__ == "__main__":
asyncio.run(main())