decker-client
Official Python SDK for the Decker crypto signal & narrative engine.
Install
pip install decker-client
PyPI 미등록 시 로컬 설치:
pip install ./sdk/python
API 키 발급
https://app.decker-ai.com/settings/apikey 에서 발급
또는 Telegram 봇 /apikey 명령으로 발급
Quickstart
from decker_client import Client
client = Client(api_key="dk_live_xxx")
주요 사용 패턴
1. 지금 진입해도 되나? — 엔진 상태 확인
state = client.state.get_live("BTCUSDT", tf="4h")
print(state.action_gate) # "GO" | "WATCH" | "HOLD"
print(state.key_direction) # "+" (롱) | "-" (숏)
print(state.c_state) # "B_FORMING" | "A_FORMING" | "BREAK_PLUS" | ...
# MTF(멀티 타임프레임) 상태
for tf, snap in state.mtf.items():
print(f"{tf}: gate={snap.action_gate}, dir={snap.key_direction}")
2. 구체적 진입가·목표가·손절가 — 소비자 시그널
sig = client.signals.get_consumer("BTCUSDT")
print(sig.entry_price) # 진입가
print(sig.target_t1) # 목표가 T1
print(sig.stop_price) # 손절가
print(sig.risk_reward_ratio) # R:R 비율
print(sig.mtf_verdict) # "ALIGNED" | "NEUTRAL" | "MIXED" | "CONFLICT"
print(sig.action_gate) # "GO" | "WATCH" | "HOLD"
# 내 스킬 overlay 결과 (스킬 설정 시)
print(sig.overlay_filter_pass) # True / False / None
print(sig.overlay_skill_id) # "conservative_v0" | "standard_v0" | ...
3. AI 판독 — 지금 시장이 뭐라고 하나
reading = client.reading.explain("BTCUSDT", "4h")
print(reading.narrative) # 자연어 시장 설명
print(reading.stance) # "LONG_BIAS" | "SHORT_BIAS" | "NEUTRAL"
print(reading.preferred_direction) # "+" | "-"
print(reading.mtf_verdict) # "ALIGNED" | "CONFLICT" | ...
4. 전체 흐름 — 에이전트 통합 예시
from decker_client import Client, RateLimitError
with Client(api_key="dk_live_xxx") as client:
# Step 1: 엔진 게이트 확인
state = client.state.get_live("BTCUSDT", tf="4h")
if state.action_gate != "GO":
print(f"대기 중 — gate={state.action_gate}")
else:
# Step 2: 진입 정보
sig = client.signals.get_consumer("BTCUSDT")
if sig.overlay_filter_pass is False:
print("내 스킬 조건 미달 — 스킵")
else:
# Step 3: AI 판독
reading = client.reading.explain("BTCUSDT", "4h")
print(f"[{state.key_direction}] {reading.stance}")
print(f"진입: {sig.entry_price} / 목표: {sig.target_t1} / 손절: {sig.stop_price}")
print(reading.narrative)
5. 기존 메서드 — narrative, latest
# 자연어 요약
narr = client.signals.get_narrative("BTCUSDT", "1h")
print(narr.text)
# 최신 시그널 (단순)
latest = client.signals.get_latest("BTCUSDT")
print(latest.direction, latest.entry_price)
Rate Limits
| Tier | 일일 한도 |
|---|---|
| FREE | 100 req |
| PRO | 10,000 req |
| ENTERPRISE | 100,000 req |
from decker_client import RateLimitError
try:
sig = client.signals.get_consumer("BTCUSDT")
except RateLimitError as e:
print(f"한도 초과 — {e.retry_after}초 후 재시도")
# 매 요청 후 잔여 확인
rl = client.last_rate_limit
print(f"오늘 {rl.remaining}/{rl.limit} 남음")
에러 처리
| 예외 | HTTP | 의미 |
|---|---|---|
AuthError |
401 | API 키 없음 또는 무효 |
PermissionError |
403 | 권한 없음 |
NotFoundError |
404 | 심볼 없음 |
RateLimitError |
429 | 일일 한도 초과 |
APIError |
5xx | 서버 오류 |
전체 API 레퍼런스
OpenAPI 스펙: api.decker-ai.com/docs
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file decker_client-0.2.0.tar.gz.
File metadata
- Download URL: decker_client-0.2.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a600183e4f468ae93a43f3e6d6ecf6134dffc06777dbcd5693e9a6461f86181
|
|
| MD5 |
c27aa888e6a3bde1fabbcefc12f4ee75
|
|
| BLAKE2b-256 |
c52a492b66321184a9c407924a1e148f2428b20083fce32b08cfc1313bc76711
|
Provenance
The following attestation bundles were made for decker_client-0.2.0.tar.gz:
Publisher:
publish-sdk.yml on gigshow/decker-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decker_client-0.2.0.tar.gz -
Subject digest:
2a600183e4f468ae93a43f3e6d6ecf6134dffc06777dbcd5693e9a6461f86181 - Sigstore transparency entry: 2490930667
- Sigstore integration time:
-
Permalink:
gigshow/decker-ai@9e1b754945ccb870272855d422c95fb795911243 -
Branch / Tag:
refs/tags/sdk-v0.2.0 - Owner: https://github.com/gigshow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@9e1b754945ccb870272855d422c95fb795911243 -
Trigger Event:
push
-
Statement type:
File details
Details for the file decker_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: decker_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29b79712c64a772e1b58101ec2b17f0075f7bb5178c7d5116963ac8c2c1a7c2d
|
|
| MD5 |
cde37029a4ca9cb98a338bf588626c29
|
|
| BLAKE2b-256 |
d2906cc5b447f46d367a70e4915ed94a93dc82d333ca74a828eb54997c681a06
|
Provenance
The following attestation bundles were made for decker_client-0.2.0-py3-none-any.whl:
Publisher:
publish-sdk.yml on gigshow/decker-ai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
decker_client-0.2.0-py3-none-any.whl -
Subject digest:
29b79712c64a772e1b58101ec2b17f0075f7bb5178c7d5116963ac8c2c1a7c2d - Sigstore transparency entry: 2490930713
- Sigstore integration time:
-
Permalink:
gigshow/decker-ai@9e1b754945ccb870272855d422c95fb795911243 -
Branch / Tag:
refs/tags/sdk-v0.2.0 - Owner: https://github.com/gigshow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@9e1b754945ccb870272855d422c95fb795911243 -
Trigger Event:
push
-
Statement type: