一键导入
add-exchange
Scaffolds a new exchange connector with connector, provider, and trait implementations. Use when integrating a new exchange.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffolds a new exchange connector with connector, provider, and trait implementations. Use when integrating a new exchange.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generates numbered SQL migration files for tables, indexes, and views. Use when adding or modifying database schema.
Crawls exchange API documentation and generates structured markdown specs. Use when integrating a new exchange or updating API specifications.
Systematically diagnoses build, runtime, DB, API, and frontend errors with classification and fix workflow. Use when encountering errors or test failures.
Commits code changes with automated CHANGELOG and design document updates. Runs build/lint verification before commit. Use after completing a feature, bug fix, or refactoring.
Scaffolds a new API endpoint with router, handler, OpenAPI docs, and TS bindings. Use when adding REST endpoints to trader-api.
Adds a new trading strategy across 5 locations (mod.rs, routes, backtest, SDUI schema, frontend). Use when implementing a new strategy.
| name | add-exchange |
| description | Scaffolds a new exchange connector with connector, provider, and trait implementations. Use when integrating a new exchange. |
| disable-model-invocation | true |
| user-invocable | true |
| argument-hint | <거래소명_snake_case> [시장유형: kr|us|crypto|global] |
| allowed-tools | Read, Grep, Edit, Write, Bash(cargo *) |
| context | fork |
| agent | rust-impl |
새 거래소 $ARGUMENTS[0]을 추가합니다.
# 가장 유사한 기존 거래소 확인
ls crates/trader-exchange/src/connector/
ls crates/trader-exchange/src/provider/
추천 참조: upbit/ (가장 간결한 구조)
위치: crates/trader-exchange/src/connector/$ARGUMENTS[0]/
connector/$ARGUMENTS[0]/
├── mod.rs # pub 모듈 선언
├── client.rs # HTTP 클라이언트 (REST API 호출)
├── models.rs # API 요청/응답 타입
└── websocket.rs # WebSocket 스트림 (선택)
pub struct ExchangeClient {
base_url: String,
client: reqwest::Client,
}
impl ExchangeClient {
// 시세 조회
pub async fn get_ticker(&self, symbol: &str) -> Result<TickerResponse>;
pub async fn get_orderbook(&self, symbol: &str) -> Result<OrderbookResponse>;
pub async fn get_candles(&self, symbol: &str, interval: &str) -> Result<Vec<CandleResponse>>;
// 주문 (인증 필요)
pub async fn place_order(&self, order: &OrderRequest) -> Result<OrderResponse>;
pub async fn cancel_order(&self, order_id: &str) -> Result<()>;
pub async fn get_balance(&self) -> Result<BalanceResponse>;
}
Decimal (API의 f64/String 응답 즉시 변환)circuit_breaker.rs, retry.rs 활용)ExchangeError 사용위치: crates/trader-exchange/src/provider/$ARGUMENTS[0].rs
use crate::traits::{ExchangeProvider, OrderExecutionProvider};
pub struct ExchangeProviderImpl { /* ... */ }
impl ExchangeProvider for ExchangeProviderImpl {
async fn get_ticker(&self, symbol: &str) -> Result<Ticker>;
async fn get_orderbook(&self, symbol: &str) -> Result<Orderbook>;
// ...
}
impl OrderExecutionProvider for ExchangeProviderImpl {
async fn place_order(&self, order: OrderRequest) -> Result<OrderResult>;
async fn cancel_order(&self, order_id: &str) -> Result<()>;
async fn get_balance(&self) -> Result<Balance>;
}
crates/trader-exchange/src/connector/mod.rs — pub mod $ARGUMENTS[0];crates/trader-exchange/src/provider/mod.rs — pub mod $ARGUMENTS[0];crates/trader-exchange/src/lib.rs — 팩토리 함수에 match 분기 추가MarketStream trait 구현:
impl MarketStream for ExchangeStream {
async fn subscribe_ticker(&mut self, symbols: &[String]) -> Result<()>;
async fn subscribe_orderbook(&mut self, symbols: &[String]) -> Result<()>;
}
위치: docs/exchange/$ARGUMENTS[0]_openapi_spec.md
/crawl-api-spec스킬로 자동 생성 가능
cargo check -p trader-exchange
cargo clippy -p trader-exchange -- -D warnings
cargo test -p trader-exchange -- $ARGUMENTS[0]