StandX CLI 스킬
StandX CLI는 StandX 거래소를 위한 암호화폐 트레이딩 명령줄 도구입니다.
설치
옵션 1: ClawHub (권장 - 자동 설치)
clawhub install standx-cli
옵션 2: Homebrew
보안 참고: 서드파티 탭(tap)을 사용합니다. 설치 전에 Formula를 확인할 수 있습니다:
# Formula 소스 확인 curl -sL https://raw.githubusercontent.com/wjllance/homebrew-standx-cli/main/standx-cli.rb # 설치 brew tap wjllance/standx-cli brew install standx-cli
brew tap wjllance/standx-cli
brew install standx-cli
빠른 시작
설치 확인:
standx --version
BTC 가격 조회:
standx market ticker BTC-USD
# 또는 짧은 별칭 사용
standx m t BTC-USD
명령어 짧은 별칭
StandX CLI는 더 빠른 입력을 위해 짧은 별칭을 지원합니다:
| 전체 명령어 | 짧은 별칭 |
|---|---|
standx market ticker | standx m t |
standx market depth | standx m d |
standx market kline | standx m k |
standx account balances | standx a b |
standx account positions | standx a p |
standx account orders | standx a o |
standx portfolio snapshot | standx p s |
standx dashboard --watch | standx d -w |
인증
대부분의 명령어는 인증이 필요합니다. StandX CLI는 여러 가지 안전한 인증 방법을 지원합니다.
환경 변수 (권장)
가장 안전한 인증 방식입니다. 자격 증명이 셸 히스토리나 명령어 로그에 저장되지 않습니다.
# ~/.bashrc 또는 ~/.zshrc에 추가
export STANDX_JWT="your_jwt_token"
export STANDX_PRIVATE_KEY="your_ed25519_private_key"
# 셸 설정 다시 로드
source ~/.bashrc
보안 모범 사례:
- 자격 증명을 명령어에 하드코딩하지 마세요 (셸 히스토리에 남습니다)
- 자격 증명을 버전 관리 시스템에 커밋하지 마세요
- 자격 증명이 포함된 파일의 권한을 600으로 설정하세요
- 토큰을 정기적으로 교체하세요 (7일 후 만료)
자격 증명 얻기
다음 항목을 생성하려면 https://standx.com/user/session 을 방문하세요:
- JWT 토큰 (필수) - 7일간 유효하며 계정 데이터 조회에 사용됩니다
- Ed25519 개인 키 (선택 사항이지만 권장됨) - 거래 작업에 필요합니다
인증 확인
standx auth status
대체 인증 방법
대화형 로그인
초기 설정 또는 테스트용:
standx auth login --interactive
파일 기반 로그인
환경 변수를 사용할 수 없는 자동화 스크립트용:
# 자격 증명을 파일에 저장하고 권한 제한
echo "your_jwt_token" > ~/.standx_token
echo "your_private_key" > ~/.standx_key
chmod 600 ~/.standx_token ~/.standx_key
# 파일을 사용하여 로그인
standx auth login --token-file ~/.standx_token --key-file ~/.standx_key
⚠️ 프로덕션에서는 피하세요:
# 위험: 자격 증명이 셸 히스토리에 노출됩니다
standx auth login --token "your_token" --private-key "your_key"
로그아웃
standx auth logout
시장 데이터 (인증 불필요)
거래 쌍 목록
standx market symbols
시세 조회
standx market ticker BTC-USD
standx market ticker ETH-USD
호가창 깊이
standx market depth BTC-USD --limit 10
캔들스틱(K-line) 데이터
# 최근 24시간, 1시간 캔들
standx market kline BTC-USD -r 60 --from 1d
# 최근 7일, 일일 캔들
standx market kline BTC-USD -r 1D --from 7d
# 특정 날짜 범위
standx market kline BTC-USD -r 60 --from 2024-01-01 --to 2024-01-07
펀딩 비율
standx market funding BTC-USD --days 7
계정 및 거래 (인증 필요)
계정 정보
standx account balances
standx account positions
standx account orders
standx account history --limit 20
주문 생성
# 지정가 매수
standx order create BTC-USD buy limit --qty 0.01 --price 60000
# 시장가 매도
standx order create BTC-USD sell market --qty 0.01
주문 취소
standx order cancel BTC-USD --order-id 123456
standx order cancel-all BTC-USD
거래 내역
standx trade history BTC-USD --from 7d
대시보드 및 포트폴리오 (인증 필요)
실시간 대시보드
자동 새로고침이 포함된 대화형 거래 대시보드:
# 자동 새로고침(감시 모드)으로 대시보드 실행
standx dashboard --watch
# 특정 심볼에 대한 대시보드
standx dashboard --symbols BTC-USD,ETH-USD
# 사용자 정의 새로고침 간격(초)
standx dashboard --watch --interval 5
대시보드 기능:
- 실시간 계정 잔고 표시
- 손익(PnL)이 포함된 활성 포지션
- 미체결 주문 요약
- 호가창 깊이 시각화
- 최근 거래 패널 (매수/매도)
- 자동 새로고침 및 정상 종료 (Ctrl+C)
포트폴리오 스냅샷
포트폴리오 요약 및 성과 확인:
# 포트폴리오 스냅샷
standx portfolio snapshot
# 짧은 별칭
standx p s
레버리지 및 마진 (인증 필요)
# 레버리지 조회
standx leverage get BTC-USD
# 레버리지 설정
standx leverage set BTC-USD 10
# 마진 모드 조회
standx margin mode BTC-USD
# 마진 모드 설정
standx margin mode BTC-USD --set isolated
실시간 스트리밍
공개 스트림 (인증 불필요)
# 가격 스트림
standx stream price BTC-USD
# 호가창 스트림
standx stream depth BTC-USD --levels 5
# 체결 스트림
standx stream trade BTC-USD
사용자 스트림 (인증 필요)
standx stream order # 주문 업데이트
standx stream position # 포지션 업데이트
standx stream balance # 잔고 업데이트
standx stream fills # 체결 업데이트
출력 형식
# JSON 출력
standx -o json market ticker BTC-USD
# CSV 내보내기
standx -o csv market symbols > symbols.csv
# Quiet 모드 (값만 출력)
standx -o quiet config get base_url
특수 모드
OpenClaw 모드 (AI 최적화 JSON)
standx --openclaw market ticker BTC-USD
Dry run (실행하지 않고 미리보기)
standx --dry-run order create BTC-USD buy limit --qty 0.01 --price 60000