Bitkub คืออะไร — แพลตฟอร์มซื้อขายคริปโตไทย
Bitkub Exchange
Bitkub Cryptocurrency Exchange ซื้อขาย Bitcoin Ethereum KUB USDT เงินบาท กลต. KYC API Trading Bot Staking Bitkub Chain
| Exchange | ค่าธรรมเนียม | เหรียญ | ฝาก THB | ใบอนุญาต |
|---|---|---|---|---|
| Bitkub | 0.25% | 100+ | ฟรี | กลต. ไทย |
| Satang Pro | 0.25% | 50+ | ฟรี | กลต. ไทย |
| Binance | 0.1% | 600+ | ไม่รับ THB | ต่างประเทศ |
| Coinbase | 0.5% | 250+ | ไม่รับ THB | ต่างประเทศ |
การใช้งาน Bitkub
=== Bitkub API Trading ===
Bitkub API Documentation: https://github.com/nicespace/bitkub-api
Python — Bitkub API Client
import hashlib
import hmac
import json
import time
import requests
API_KEY = "your-api-key"
API_SECRET = "your-api-secret"
BASE_URL = "https://api.bitkub.com"
def create_signature(payload):
msg = json.dumps(payload, separators=(',', ':'), sort_keys=True)
sig = hmac.new(API_SECRET.encode(), msg.encode(), hashlib.sha256)
return sig.hexdigest()
def get_ticker():
response = requests.get(f"{BASE_URL}/api/market/ticker")
return response.json()
def get_balance():
ts = int(time.time())
payload = {"ts": ts}
payload["sig"] = create_signature(payload)
headers = {"X-BTK-APIKEY": API_KEY}
response = requests.post(f"{BASE_URL}/api/market/balances",
json=payload, headers=headers)
return response.json()
def place_order(symbol, side, amount, rate):
ts = int(time.time())
payload = {
"sym": symbol, # e.g., "THB_BTC"
"amt": amount,
"rat": rate,
"typ": "limit",
"ts": ts,
}
payload["sig"] = create_signature(payload)
headers = {"X-BTK-APIKEY": API_KEY}
endpoint = "place-bid" if side == "buy" else "place-ask"
response = requests.post(f"{BASE_URL}/api/market/{endpoint}",
json=payload, headers=headers)
return response.json()
from dataclasses import dataclass
@dataclass
class CryptoPrice:
symbol: str
name: str
price_thb: float
change_24h: float
volume_24h: float
market_cap_b: float
prices = [
CryptoPrice("BTC", "Bitcoin", 2850000, 2.5, 1500000000, 55800),
CryptoPrice("ETH", "Ethereum", 115000, 1.8, 800000000, 13800),
CryptoPrice("KUB", "Bitkub Coin", 45.5, -1.2, 50000000, 4.5),
CryptoPrice("USDT", "Tether", 35.2, 0.1, 2000000000, 1100),
CryptoPrice("BNB", "Binance Coin", 22000, 0.8, 200000000, 3300),
CryptoPrice("SOL", "Solana", 5800, 3.2, 300000000, 2500),
]
print("=== Crypto Prices (THB) ===")
for p in prices:
arrow = "+" if p.change_24h > 0 else ""
print(f" [{p.symbol}] {p.name}: {p.price_thb:,.0f} THB ({arrow}{p.change_24h}%)")
print(f" Volume 24h: {p.volume_24h:,.0f} | MCap: {p.market_cap_b:,.0f}B")
Trading Bot
=== Simple Trading Bot ===
DCA Bot (Dollar Cost Averaging)
import schedule
import time
def dca_buy():
"""Buy fixed amount of BTC every day"""
amount_thb = 500 # 500 baht per day
ticker = get_ticker()
btc_price = ticker["THB_BTC"]["last"]
btc_amount = amount_thb / btc_price
result = place_order("THB_BTC", "buy", amount_thb, btc_price)
print(f"DCA Buy: {btc_amount:.8f} BTC at {btc_price:,.0f} THB")
return result
# Run daily at 9:00 AM
schedule.every().day.at("09:00").do(dca_buy)
while True:
schedule.run_pending()
time.sleep(60)
Grid Trading Bot
class GridBot:
def __init__(self, symbol, lower, upper, grids, total_investment):
self.symbol = symbol
self.lower = lower
self.upper = upper
self.grids = grids
self.grid_size = (upper - lower) / grids
self.per_grid = total_investment / grids
def create_grid_orders(self):
orders = []
for i in range(self.grids):
price = self.lower + (i * self.grid_size)
orders.append({
"price": price,
"amount": self.per_grid / price,
"side": "buy",
})
orders.append({
"price": price + self.grid_size,
"amount": self.per_grid / price,
"side": "sell",
})
return orders
@dataclass
class DCAResult:
month: str
invested_thb: float
btc_accumulated: float
avg_price: float
current_value: float
pnl_pct: float
dca = [
DCAResult("Jan", 15000, 0.00530, 2830000, 15105, 0.7),
DCAResult("Feb", 30000, 0.01100, 2727000, 31350, 4.5),
DCAResult("Mar", 45000, 0.01620, 2778000, 46170, 2.6),
DCAResult("Apr", 60000, 0.02200, 2727000, 62700, 4.5),
DCAResult("May", 75000, 0.02750, 2727000, 78375, 4.5),
DCAResult("Jun", 90000, 0.03350, 2687000, 95475, 6.1),
]
print("\n=== DCA Bot Results (500 THB/day) ===")
for d in dca:
print(f" [{d.month}] Invested: {d.invested_thb:,.0f} | BTC: {d.btc_accumulated:.5f}")
print(f" Avg Price: {d.avg_price:,.0f} | Value: {d.current_value:,.0f} | PnL: {d.pnl_pct}%")
Security และ Best Practices
# === Crypto Security ===
# API Security
# - ใช้ API Key แยกสำหรับ Trading Bot
# - จำกัด IP Whitelist
# - ไม่เก็บ API Secret ใน Code ใช้ Environment Variable
# - เปิด 2FA ทุก Account
# - ใช้ Withdraw Whitelist
# import os
# API_KEY = os.environ.get("BITKUB_API_KEY")
# API_SECRET = os.environ.get("BITKUB_API_SECRET")
# Portfolio Tracking
@dataclass
class Portfolio:
coin: str
amount: float
avg_buy_price: float
current_price: float
portfolio = [
Portfolio("BTC", 0.05, 2700000, 2850000),
Portfolio("ETH", 1.5, 110000, 115000),
Portfolio("KUB", 500, 50, 45.5),
Portfolio("USDT", 1000, 35.0, 35.2),
]
print("=== Portfolio ===")
total_invested = 0
total_value = 0
for p in portfolio:
invested = p.amount * p.avg_buy_price
value = p.amount * p.current_price
pnl = value - invested
pnl_pct = pnl / invested * 100 if invested > 0 else 0
total_invested += invested
total_value += value
print(f" [{p.coin}] {p.amount} coins")
print(f" Invested: {invested:,.0f} | Value: {value:,.0f} | PnL: {pnl:,.0f} ({pnl_pct:.1f}%)")
total_pnl = total_value - total_invested
total_pnl_pct = total_pnl / total_invested * 100
print(f"\n Total Invested: {total_invested:,.0f}")
print(f" Total Value: {total_value:,.0f}")
print(f" Total PnL: {total_pnl:,.0f} ({total_pnl_pct:.1f}%)")
# Security Checklist
security = [
"เปิด 2FA (Google Authenticator) ทุก Account",
"ใช้ Hardware Wallet (Ledger/Trezor) เก็บเหรียญจำนวนมาก",
"ไม่เก็บเหรียญทั้งหมดบน Exchange",
"API Key จำกัด IP Whitelist",
"ไม่แชร์ Seed Phrase กับใคร",
"ตรวจสอบ URL ก่อน Login ระวัง Phishing",
"ใช้ Password ไม่ซ้ำกับเว็บอื่น",
]
print(f"\n\nSecurity Checklist:")
for i, s in enumerate(security, 1):
print(f" {i}. {s}")
เคล็ดลับ
- DCA: ใช้ DCA ซื้อสม่ำเสมอ ไม่ต้อง Time the Market
- 2FA: เปิด 2FA ทันทีหลังสมัคร ป้องกัน Account ถูก Hack
- Wallet: เก็บเหรียญใน Hardware Wallet ถ้ามีมากกว่า 50,000 บาท
- API: ใช้ API Key แยก จำกัด Permission เฉพาะที่ต้องการ
- Tax: เก็บหลักฐานการซื้อขายสำหรับยื่นภาษี
Bitkub คืออะไร
Exchange Crypto ใหญ่สุดไทย 2018 กลต. BTC ETH KUB USDT เงินบาท 0.25% Volume สูง Staking Bitkub Chain แอปมือถือ