Skip to content

6. Exchanges and trading

Jeong Seongmoon edited this page Jul 15, 2026 · 1 revision

smtm supports real trading on Upbit, Bithumb, and Binance, and any configuration can be validated first with paper trading (virtual mode).

Everything is controlled by chatting with the Telegram AI Agent. Budget, currency, exchange, strategy, and interval are profile/session settings.

At a glance

Code Exchange Quote currency Coins Real trading Notes
UPB Upbit KRW BTC, ETH, DOGE, XRP Default
BTH Bithumb KRW BTC, ETH
BNC Binance USDT BTC, ETH, DOGE, XRP Budget & amounts are in USDT
(virtual) Simulation profile budget currency selected coin virtual With virtual: true, any code runs on the in-memory simulator

Combined data-source codes (UPN/UMN/USC/UFC/UBD, etc.) enrich market data. Only UPB/BTH/BNC have an order-executing Trader wired; use other codes in virtual mode.

Supported order types

Order type Upbit / Bithumb / Binance (real) Simulation
Limit
Market
Stop-loss / Take-profit ⏳ planned ✅ (local emulation)
OCO / Trailing ⏳ planned ⏳ planned
  • If a request has no ord_type field, it is treated as a limit order (backward compatible).
  • Stop-loss/take-profit currently fire in virtual mode by checking the trigger against each tick's quote. Native conditional orders (Binance stop/OCO) and a session-level auto stop/take-profit policy are planned.

Environment variables

# Required: LLM API key
SMTM_LLM_API_KEY=your_anthropic_api_key

# Upbit (UPB)
UPBIT_OPEN_API_ACCESS_KEY=your_upbit_access_key
UPBIT_OPEN_API_SECRET_KEY=your_upbit_secret_key
UPBIT_OPEN_API_SERVER_URL=https://api.upbit.com

# Bithumb (BTH)
BITHUMB_API_ACCESS_KEY=your_bithumb_access_key
BITHUMB_API_SECRET_KEY=your_bithumb_secret_key
BITHUMB_API_SERVER_URL=https://api.bithumb.com

# Binance (BNC) — spot
BINANCE_API_ACCESS_KEY=your_binance_access_key
BINANCE_API_SECRET_KEY=your_binance_secret_key
BINANCE_API_SERVER_URL=https://api.binance.com

Register real-trading accounts by the env-var names (register_account), never the key values.

Creating a trading session (chat)

The default session is virtual. For real trading, do this via chat:

  1. register_account — register an account by the env-var names holding the keys
  2. create_profile — set exchange/currency/budget/strategy/term with virtual: false and account
  3. create_session + start_session

Example — Upbit (KRW)

Create a profile called upbit-btc: exchange UPB, currency BTC, budget 500000, strategy RSI, term 60, virtual false, account my-upbit
Create a session from upbit-btc and start it

Example — Binance (USDT)

Create a profile called binance-eth: exchange BNC, currency ETH, budget 300, strategy SMA, term 60, virtual false, account my-binance
Create a session from binance-eth and start it

Binance trades USDT pairs (BTCUSDT, etc.), so budget and all amounts are in USDT (the 300 above is 300 USDT).

Caveats

  • Binance is USDT-based: budget, returns, and trade amounts are all in USDT. Don't mix them up with KRW exchanges.
  • ⚠️ Safety config for USDT sessions: SafetyGuard's amount-based defaults (max_trade_amount, initial_budget) assume KRW. For a Binance (USDT) session, set USDT-denominated values in the profile's safety config.
  • Market buy semantics: a market buy on Upbit/Binance spends price × amount (total); a market sell on all three uses the coin quantity.
  • API rate limits: each session polls its exchange independently — keep the session count modest.

See also: 0. How to setup and run

Clone this wiki locally