統計的アービトラージは、cryptocurrency市場における魅力的な戦略です。本稿では、HolySheep AIを活用したデータパイプラインの構築と、機械学習モデルの特徴量設計について詳しく解説します。
HolySheep vs 公式API vs 他のリレーサービスの比較
| 比較項目 | HolySheep AI | 公式API | 他のリレーサービス |
|---|---|---|---|
| 料金体系 | ¥1=$1(85%節約) | ¥7.3=$1 | ¥3-6=$1 |
| 対応決済 | WeChat Pay / Alipay対応 | 国際カードのみ | 限定的 |
| レイテンシ | <50ms | 50-150ms | 100-300ms |
| 無料クレジット | 登録時付与 | なし | 限定的 |
| GPT-4.1 | $8/MTok | $60/MTok | $15-30/MTok |
| Claude Sonnet 4.5 | $15/MTok | $90/MTok | $25-45/MTok |
| DeepSeek V3.2 | $0.42/MTok | $0.5/MTok | $0.8-1.5/MTok |
| 安定性 | 高い | 高い | 中〜高 |
向いている人・向いていない人
向いている人
- 統計的アービトラージ戦略を実装したいquantトレーダー
- APIコストを85%削減したい開発者
- WeChat Pay/Alipayで支払いたい中国本土のユーザー
- 低レイテンシを求める高频取引システム構築者
- 複数のLLMを実験的に活用したいリサーチャー
向いていない人
- 公式APIの保証されたSLAが必要なエンタープライズ用途
- 非常に少量のリクエストしか行わない趣味レベルのトレーダー
- 公式SDKの特定の機能に直接依存しているプロジェクト
価格とROI分析
統計的アービトラージ戦略では、大量のAPIコールが発生します。HolySheep AIの料金体系は、このユースケースに最適です。
| モデル | HolySheep ($/MTok) | 公式 ($/MTok) | 節約率 |
|---|---|---|---|
| GPT-4.1 | $8.00 | $60.00 | 86.7%OFF |
| Claude Sonnet 4.5 | $15.00 | $90.00 | 83.3%OFF |
| Gemini 2.5 Flash | $2.50 | $7.50 | 66.7%OFF |
| DeepSeek V3.2 | $0.42 | $0.50 | 16%OFF |
ROI計算例:
月間100万トークンを処理するアービトラージシステムの場合:
- 公式API 비용:$60/月
- HolySheep AI費用:$8/月
- 月間節約額:$52(年間$624)
システムアーキテクチャ概要
統計的アービトラージ戦略のデータパイプラインは、以下のコンポーネントで構成されます:
┌─────────────────────────────────────────────────────────────┐
│ 統計アービトラージシステム │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ 市場データ │───▶│ 特徴量抽出 │───▶│ LLM 分析 │ │
│ │ 収集モジュー │ │ エンジン │ │ エンジン │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ HolySheep AI API │ │
│ │ base_url: https://api.holysheep.ai/v1 │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ シグナル │───▶│ リスク管理 │───▶│ 执行引擎 │ │
│ │ 生成 │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
データ取得モジュールの実装
HolySheep AIのDeepSeek V3.2モデルは、安価で高性能な分析能力を提供します。以下のコードは、価格データの取得と前処理を行います。
import requests
import json
from datetime import datetime, timedelta
import pandas as pd
class CryptoDataFetcher:
"""
加密货币市场数据获取器
HolySheep AI APIを使用して市場分析を強化
"""
def __init__(self, api_key: str):
self.api_key = api_key
self.base_url = "https://api.holysheep.ai/v1"
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
def get_market_features(self, symbol: str, lookback_days: int = 30) -> dict:
"""
市場の特徴量を抽出してHolySheepで分析
Args:
symbol: 通貨ペア (例: BTC/USDT)
lookback_days: 分析期間(日数)
"""
# 模拟市场数据获取(实际项目中连接交易所API)
market_data = self._fetch_ohlcv_data(symbol, lookback_days)
# 基本特徴量計算
features = self._calculate_basic_features(market_data)
# HolySheep AIで市場分析
analysis = self._analyze_with_holysheep(features, symbol)
return {
"symbol": symbol,
"features": features,
"analysis": analysis,
"timestamp": datetime.now().isoformat()
}
def _fetch_ohlcv_data(self, symbol: str, days: int) -> pd.DataFrame:
"""OHLCVデータの取得(モック実装)"""
# 实际应用中: CCXT等を使用して取得
dates = pd.date_range(
end=datetime.now(),
periods=days * 24, # 1時間足
freq='H'
)
# 模拟数据生成
import numpy as np
base_price = 50000 if 'BTC' in symbol else 3000
df = pd.DataFrame({
'timestamp': dates,
'open': base_price * (1 + np.random.randn(days * 24) * 0.02),
'high': base_price * (1 + np.random.randn(days * 24) * 0.03),
'low': base_price * (1 + np.random.randn(days * 24) * 0.03),
'close': base_price * (1 + np.random.randn(days * 24) * 0.02),
'volume': np.random.uniform(100, 10000, days * 24)
})
return df
def _calculate_basic_features(self, df: pd.DataFrame) -> dict:
"""基本特徴量の計算"""
returns = df['close'].pct_change()
features = {
"mean_return": float(returns.mean()),
"std_return": float(returns.std()),
"sharpe_ratio": float(returns.mean() / returns.std() * (24 * 365) ** 0.5) if returns.std() > 0 else 0,
"max_drawdown": float((df['close'] / df['close'].cummax() - 1).min()),
"volume_mean": float(df['volume'].mean()),
"volume_std": float(df['volume'].std()),
"price_range_pct": float((df['high'].max() - df['low'].min()) / df['close'].mean() * 100)
}
return features
def _analyze_with_holysheep(self, features: dict, symbol: str) -> dict:
"""HolySheep AI APIを使用した市場分析"""
prompt = f"""
分析 folgende Kryptowährungsdaten für {symbol}:
特徴量:
- 平均収益率: {features['mean_return']:.6f}
- 収益標準偏差: {features['std_return']:.6f}
- シャープレシオ: {features['sharpe_ratio']:.4f}
- 最大ドローダウン: {features['max_drawdown']:.4f}
- 平均出来高: {features['volume_mean']:.2f}
- 価格変動幅: {features['price_range_pct']:.2f}%
以下のJSON形式で返答してください:
{{
"trend": "bullish/bearish/neutral",
"volatility": "high/medium/low",
"recommendation": "short/hold/long",
"confidence": 0.0-1.0,
"risk_factors": ["factor1", "factor2"]
}}
"""
payload = {
"model": "deepseek-chat",
"messages": [
{"role": "system", "content": "あなたは暗号通貨市場分析の専門家です。"},
{"role": "user", "content": prompt}
],
"temperature": 0.3,
"max_tokens": 500
}
response = requests.post(
f"{self.base_url}/chat/completions",
headers=self.headers,
json=payload,
timeout=30
)
if response.status_code == 200:
result = response.json()
analysis_text = result['choices'][0]['message']['content']
# JSONとして解析
try:
return json.loads(analysis_text)
except:
return {"raw_analysis": analysis_text}
else:
raise Exception(f"API Error: {response.status_code} - {response.text}")
使用例
if __name__ == "__main__":
fetcher = CryptoDataFetcher(api_key="YOUR_HOLYSHEEP_API_KEY")
try:
result = fetcher.get_market_features("BTC/USDT", lookback_days=7)
print(f"シンボル: {result['symbol']}")
print(f"特徴量: {json.dumps(result['features'], indent=2)}")
print(f"分析結果: {result['analysis']}")
except Exception as e:
print(f"エラー: {e}")
特徴量エンジニアリングの詳細実装
統計的アービトラージでは、高度な特徴量設計が重要です。HolySheep AIのGPT-4.1モデルは、複雑な特徴量生成,支持向量化處理とリアルタイム分析を行います。
import requests
import numpy as np
import pandas as pd
from typing import List, Dict, Tuple
from collections import deque
class ArbitrageFeatureEngine:
"""
統計アービトラージ向け特徴量エンジニアリング
HolySheep AIで特徴量生成を最適化和
"""
def __init__(self, api_key: str):
self.api_key = api_key
self.base_url = "https://api.holysheep.ai/v1"
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
# 移動窓サイズの設定
self.windows = {
'short': 5, # 5分
'medium': 15, # 15分
'long': 60 # 60分
}
# 価格履歴(リングバッファ)
self.price_history = deque(maxlen=1000)
self.volume_history = deque(maxlen=1000)
def generate_features(self, tick_data: Dict) -> Dict[str, float]:
"""
単一ティックデータから全特徴量を生成
Args:
tick_data: {'price': float, 'volume': float, 'exchange': str}
"""
# 履歴に追加
self.price_history.append(tick_data['price'])
self.volume_history.append(tick_data['volume'])
if len(self.price_history) < 20:
return {}
prices = np.array(self.price_history)
volumes = np.array(self.volume_history)
features = {}
# 1. 价格动量特征
features.update(self._momentum_features(prices))
# 2. 波动率特征
features.update(self._volatility_features(prices))
# 3. 交易量特征
features.update(self._volume_features(prices, volumes))
# 4. 价差收敛特征
features.update(self._spread_features(prices))
# 5. 市场结构特征
features.update(self._market_structure_features(prices))
return features
def _momentum_features(self, prices: np.ndarray) -> Dict[str, float]:
"""モメンタム系特徴量"""
returns = np.diff(prices) / prices[:-1]
return {
"momentum_short": float(prices[-1] / prices[-self.windows['short']] - 1),
"momentum_medium": float(prices[-1] / prices[-self.windows['medium']] - 1),
"momentum_long": float(prices[-1] / prices[-self.windows['long']] - 1),
"momentum_acceleration": float(returns[-1] - returns[-5]),
"roc_5": float((prices[-1] - prices[-5]) / prices[-5]),
"roc_15": float((prices[-1] - prices[-15]) / prices[-15]),
"roc_60": float((prices[-1] - prices[-60]) / prices[-60]),
}
def _volatility_features(self, prices: np.ndarray) -> Dict[str, float]:
"""波动率系特徴量"""
returns = np.diff(prices) / prices[:-1]
return {
"volatility_short": float(np.std(returns[-self.windows['short']:])),
"volatility_medium": float(np.std(returns[-self.windows['medium']:])),
"volatility_long": float(np.std(returns[-self.windows['long']:])),
"volatility_ratio": float(
np.std(returns[-self.windows['short']:]) /
(np.std(returns[-self.windows['long']:]) + 1e-8)
),
"garch_proxy": float(np.mean(returns[-20:])**2 + 0.9 * np.var(returns[-20:])),
"parkinson_vol": float(self._parkinson_volatility(prices)),
"rogers_satchell_vol": float(self._rogers_satchell(prices)),
}
def _parkinson_volatility(self, prices: np.ndarray) -> float:
"""Parkinson波动率(高値・安値を使用)"""
highs = prices * (1 + np.random.uniform(0, 0.02, len(prices)))
lows = prices * (1 - np.random.uniform(0, 0.02, len(prices)))
log_hl = np.log(highs / lows)
return np.sqrt(np.mean(log_hl ** 2) / (4 * np.log(2)))
def _rogers_satchell(self, prices: np.ndarray) -> float:
"""Rogers-Satchell波动率"""
highs = prices * 1.01
lows = prices * 0.99
log_hc = np.log(highs[1:] / prices[:-1])
log_hc[log_hc == 0] = 1e-8
log_hc_log = np.log(highs[1:] / prices[:-1])
log_lc_log = np.log(lows[1:] / prices[:-1])
rs = log_hc_log * log_lc_log
return np.sqrt(np.mean(rs))
def _volume_features(self, prices: np.ndarray, volumes: np.ndarray) -> Dict[str, float]:
"""出来高系特徴量"""
returns = np.diff(prices) / prices[:-1]
# OBV (On-Balance Volume)
obv = np.cumsum(
np.where(returns > 0, volumes[1:],
np.where(returns < 0, -volumes[1:], 0))
)
# VWAP比率
typical_price = prices
vwap = np.sum(typical_price * volumes) / np.sum(volumes)
return {
"obv_slope": float(np.polyfit(range(20), obv[-20:], 1)[0]),
"vwap_deviation": float((prices[-1] - vwap) / vwap),
"volume_ratio": float(volumes[-1] / np.mean(volumes[-60:])),
"volume_momentum": float(np.mean(volumes[-5:]) / np.mean(volumes[-20:]) - 1),
"up_down_ratio": float(
np.sum(volumes[1:][returns > 0]) /
(np.sum(volumes[1:][returns < 0]) + 1e-8)
),
}
def _spread_features(self, prices: np.ndarray) -> Dict[str, float]:
"""スプレッド収束特徴量(アービトラージ用)"""
# 単純移動平均との偏差
sma_short = np.mean(prices[-self.windows['short']:])
sma_long = np.mean(prices[-self.windows['long']:])
# 収束速度
distance = prices[-1] - (sma_short + sma_long) / 2
prev_distance = prices[-5] - np.mean(prices[-10:-5])
return {
"mean_reversion_signal": float(-distance / (np.std(prices[-60:]) + 1e-8)),
"convergence_speed": float(prev_distance - distance),
"z_score_short": float((prices[-1] - sma_short) / (np.std(prices[-self.windows['short']:]) + 1e-8)),
"z_score_long": float((prices[-1] - sma_long) / (np.std(prices[-self.windows['long']:]) + 1e-8)),
}
def _market_structure_features(self, prices: np.ndarray) -> Dict[str, float]:
"""市場構造特徴量"""
# サポート・レジスタンス近接度
recent_high = np.max(prices[-20:])
recent_low = np.min(prices[-20:])
range_size = recent_high - recent_low
# トレンド強度
x = np.arange(len(prices[-30:]))
slope, _ = np.polyfit(x, prices[-30:], 1)
return {
"near_resistance": float((recent_high - prices[-1]) / (range_size + 1e-8)),
"near_support": float((prices[-1] - recent_low) / (range_size + 1e-8)),
"trend_strength": float(slope / (np.mean(prices[-30:]) + 1e-8) * 100),
"position_in_range": float(
(prices[-1] - recent_low) / (range_size + 1e-8)
),
}
def optimize_features_with_llm(self, features: Dict[str, float],
context: str = "BTC/USDT arbitrage") -> Dict:
"""
HolySheep AI GPT-4.1で特徴量重要度を分析・最適化建议
Args:
features: 生特徴量辞書
context: 分析コンテキスト
"""
feature_str = "\n".join([f"- {k}: {v:.6f}" for k, v in features.items()])
prompt = f"""
あなたは統計的アービトラージ戦略の特徴量エンジニアリング専門家です。
以下の特徴量セットを分析し、最適化建议を行ってください。
分析対象: {context}
特徴量:
{feature_str}
以下のJSON形式で返答してください:
{{
"top_features": ["feature1", "feature2", "feature3"],
"feature_importance": {{"feature1": 0.8, "feature2": 0.6, ...}},
"suggested_weights": {{"feature1": 0.4, "feature2": 0.3, ...}},
"new_feature_ideas": ["idea1", "idea2"],
"warnings": ["warning1"],
"confidence": 0.0-1.0
}}
"""
payload = {
"model": "gpt-4.1",
"messages": [
{"role": "system", "content": "あなたは金融ML特徴量エンジニアリングの専門家です。"},
{"role": "user", "content": prompt}
],
"temperature": 0.2,
"max_tokens": 1000
}
response = requests.post(
f"{self.base_url}/chat/completions",
headers=self.headers,
json=payload,
timeout=30
)
if response.status_code == 200:
result = response.json()
return result['choices'][0]['message']['content']
else:
raise Exception(f"Optimization failed: {response.status_code}")
使用例
if __name__ == "__main__":
engine = ArbitrageFeatureEngine(api_key="YOUR_HOLYSHEEP_API_KEY")
# 模拟ティックデータの生成
base_price = 50000
for i in range(100):
tick = {
'price': base_price * (1 + np.random.randn() * 0.001),
'volume': np.random.uniform(0.1, 10),
'exchange': 'binance'
}
features = engine.generate_features(tick)
if len(features) > 0 and i % 20 == 0:
print(f"Tick {i}: {len(features)} features generated")
print(f"Sample: {dict(list(features.items())[:5])}")
アービトラージシグナル生成システム
特徴量を統合して最終的な取引シグナルを生成します。HolySheep AIのClaude Sonnet 4.5は高度な推論能力でシグナル品質を向上させます。
import requests
import numpy as np
from typing import List, Tuple, Optional
from dataclasses import dataclass
from enum import Enum
class Signal(Enum):
STRONG_BUY = "STRONG_BUY"
BUY = "BUY"
HOLD = "HOLD"
SELL = "SELL"
STRONG_SELL = "STRONG_SELL"
@dataclass
class ArbitrageSignal:
signal: Signal
confidence: float
entry_price: float
target_price: float
stop_loss: float
position_size: float
reasoning: str
class ArbitrageSignalGenerator:
"""
統計アービトラージシグナル生成エンジン
HolySheep AIで最終判断を最適化
"""
def __init__(self, api_key: str):
self.api_key = api_key
self.base_url = "https://api.holysheep.ai/v1"
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
# シグナル生成パラメータ
self.thresholds = {
'strong_buy': 0.85,
'buy': 0.65,
'sell': 0.35,
'strong_sell': 0.15
}
# リスク管理パラメータ
self.risk_params = {
'max_position_size': 0.1, # ポートフォリオの10%
'stop_loss_pct': 0.02, # 2%ストップロス
'take_profit_pct': 0.05, # 5%利確
'min_sharpe': 0.5, # 最小シャープレシオ
'max_volatility': 0.03 # 最大ボラティリティ
}
def generate_signal(self, features: dict, current_price: float,
portfolio_value: float) -> ArbitrageSignal:
"""
全特徴量からシグナルを生成
Args:
features: 特徴量エンジニアリングからの特徴量
current_price: 現在価格
portfolio_value: ポートフォリオ総額
"""
# 特徴量スコア計算
raw_score = self._calculate_raw_score(features)
# LLMで最終判断を最適化
optimized = self._optimize_with_claude(features, raw_score)
# リスク管理適用
signal = self._apply_risk_management(
optimized, current_price, portfolio_value
)
return signal
def _calculate_raw_score(self, features: dict) -> float:
"""特徴量から基本スコアを計算"""
# 重み付きスコアリング
weights = {
'momentum_short': 0.15,
'momentum_medium': 0.10,
'momentum_long': 0.05,
'mean_reversion_signal': 0.25,
'convergence_speed': 0.15,
'volatility_ratio': 0.10,
'volume_ratio': 0.10,
'sharpe_ratio': 0.10
}
score = 0.0
for feature, weight in weights.items():
if feature in features:
# 特徴量正規化(-1〜1范围)
normalized = self._normalize_feature(features[feature], feature)
score += normalized * weight
return (score + 1) / 2 # 0-1範囲に正規化
def _normalize_feature(self, value: float, feature_name: str) -> float:
"""特徴量の 정규화"""
# 経験則に基づく正規化
if 'momentum' in feature_name:
return np.clip(value / 0.05, -1, 1) # 5%を基準に正規化
elif 'reversion' in feature_name or 'convergence' in feature_name:
return np.clip(value / 2, -1, 1)
elif 'volatility' in feature_name:
return np.clip(-(value - 1), -1, 1) # 低ボラ有利
else:
return np.clip(value / 3, -1, 1)
def _optimize_with_claude(self, features: dict, raw_score: float) -> dict:
"""Claude Sonnet 4.5でシグナルを最適化"""
feature_summary = "\n".join([
f"- {k}: {v:.6f}" for k, v in list(features.items())[:15]
])
prompt = f"""
あなたは統計的アービトラージの専門家です。
以下の特徴量と基本スコアを分析し、最適化されたシグナル判断を行ってください。
生スコア: {raw_score:.4f}
特徴量:
{feature_summary}
リスクパラメータ:
- 最大ポジショサイズ: {self.risk_params['max_position_size']*100}%
- ストップロス: {self.risk_params['stop_loss_pct']*100}%
- 利確: {self.risk_params['take_profit_pct']*100}%
以下のJSON形式で返答:
{{
"adjusted_score": 0.0-1.0,
"signal": "STRONG_BUY|BUY|HOLD|SELL|STRONG_SELL",
"confidence": 0.0-1.0,
"reasoning": "判断理由の简要説明",
"adjustments": ["調整1", "調整2"]
}}
"""
payload = {
"model": "claude-sonnet-4.5",
"messages": [
{"role": "system", "content": "あなたは高频取引シグナル生成の専門家です。"},
{"role": "user", "content": prompt}
],
"temperature": 0.1,
"max_tokens": 800
}
response = requests.post(
f"{self.base_url}/chat/completions",
headers=self.headers,
json=payload,
timeout=30
)
if response.status_code == 200:
result = response.json()
import json
try:
return json.loads(result['choices'][0]['message']['content'])
except:
return {
"adjusted_score": raw_score,
"signal": "HOLD",
"confidence": 0.5,
"reasoning": "Parse error"
}
else:
return {
"adjusted_score": raw_score,
"signal": "HOLD",
"confidence": 0.5,
"reasoning": "API error"
}
def _apply_risk_management(self, optimized: dict,
current_price: float,
portfolio_value: float) -> ArbitrageSignal:
"""リスク管理を適用して最終シグナル生成"""
score = optimized.get('adjusted_score', 0.5)
signal_name = optimized.get('signal', 'HOLD')
# シグナル閾値判定
if score >= self.thresholds['strong_buy']:
signal = Signal.STRONG_BUY
elif score >= self.thresholds['buy']:
signal = Signal.BUY
elif score <= self.thresholds['strong_sell']:
signal = Signal.STRONG_SELL
elif score <= self.thresholds['sell']:
signal = Signal.SELL
else:
signal = Signal.HOLD
# ポジションサイズ計算
if signal in [Signal.BUY, Signal.STRONG_BUY]:
direction = 1
elif signal in [Signal.SELL, Signal.STRONG_SELL]:
direction = -1
else:
direction = 0
max_position_value = portfolio_value * self.risk_params['max_position_size']
position_size = max_position_value * score if direction != 0 else 0
# 損切り・利確価格
if direction != 0:
stop_loss = current_price * (1 - direction * self.risk_params['stop_loss_pct'])
take_profit = current_price * (1 + direction * self.risk_params['take_profit_pct'])
else:
stop_loss = current_price
take_profit = current_price
return ArbitrageSignal(
signal=signal,
confidence=optimized.get('confidence', 0.5),
entry_price=current_price,
target_price=take_profit,
stop_loss=stop_loss,
position_size=position_size,
reasoning=optimized.get('reasoning', '')
)
使用例
if __name__ == "__main__":
generator = ArbitrageSignalGenerator(api_key="YOUR_HOLYSHEEP_API_KEY")
# テスト特徴量
test_features = {
'momentum_short': 0.02,
'momentum_medium': 0.01,
'momentum_long': -0.005,
'mean_reversion_signal': 1.5,
'convergence_speed': 0.3,
'volatility_ratio': 0.8,
'volume_ratio': 1.2,
'sharpe_ratio': 0.8
}
signal = generator.generate_signal(
features=test_features,
current_price=50000,
portfolio_value=100000
)
print(f"シグナル: {signal.signal.value}")
print(f"置信度: {signal.confidence:.2%}")
print(f"エントリー: ${signal.entry_price:,.2f}")
print(f"利確目標: ${signal.target_price:,.2f}")
print(f"損切り: ${signal.stop_loss:,.2f}")
print(f"ポジションサイズ: ${signal.position_size:,.2f}")
print(f"理由: {signal.reasoning}")
HolySheepを選ぶ理由
- 85%コスト削減:公式API比で圧倒的な料金優位性(月額$52節約、年額$624削減)
- ローカル決済対応:WeChat Pay・Alipayで”即時”入金可能
- <50ms超低レイテンシ:高频取引の要求を満たす応答速度
- 全主要モデル対応:GPT-4.1、Claude Sonnet 4.5、Gemini 2.5 Flash、DeepSeek V3.2を单一API