Skip to content

sueun-dev/upbit-market-intelligence-console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Upbit Market Intelligence Console

Formerly Upbit Alpha Desk. Full-stack intelligence console for KRW market structure, listings, and market data operations.

Upbit Alpha Desk is a full-stack trading-intel console for the KRW market.
It blends Upbit day-candles, cached tickers, saved trading-value files, and Bybit-based listing strategies into one React frontend backed by an Express + Redis API layer.

πŸ”§ Tech Stack

  • Backend: Node.js, Express, TypeScript, Redis (market-data cache), Axios schedulers
  • Frontend: React (Vite + TypeScript), React Query, Chart.js, date-fns
  • Scheduling: Listing calendar & listing strategy analyzers (3h), ticker cache persistence, saved_data parsing, midnight candle refresh
  • Package Manager: pnpm

πŸ“ Repository Layout

src/                    # Express server + schedulers
β”œβ”€β”€ server.ts           # API & static serving entry
β”œβ”€β”€ config.ts           # CORS / API key / rate-limit config
β”œβ”€β”€ clients/
β”‚   β”œβ”€β”€ redisClient.ts  # Lazy Redis connector
β”‚   └── bybitClient.ts  # Bybit hourly candle fetcher
β”œβ”€β”€ services/           # DataManager + schedulers
frontend/               # React/Vite SPA (served as static build)
β”œβ”€β”€ src/components/...  # Sidebar, analytics, listing lab, insights
β”œβ”€β”€ src/api/            # Typed API client + DTOs
public/                 # Legacy static assets (still served)
cache/                  # JSON snapshots for schedulers & ticker cache
saved_data/             # Trading-value JSON files parsed into Redis

πŸš€ Local Development

  1. Backend
    pnpm install
    pnpm dev           # tsx + nodemon
  2. Frontend
    cd frontend
    pnpm install
    pnpm dev           # http://localhost:5173 (uses VITE_API_BASE_URL)
  3. Production build
    pnpm build        # compiles backend + frontend
    pnpm start        # serves /api and the built SPA
    The Express server automatically serves frontend/dist (set SERVE_FRONTEND=false to disable).
  4. Tests
    pnpm test         # vitest unit tests (rate limiter, etc.)

πŸ” Environment

Copy .env.example (backend root):

CORS_ORIGINS=https://app.your-domain.com
API_KEY=optional-x-api-key
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX=120
REDIS_URL=redis://default:password@host:11219
SERVE_FRONTEND=true
PORT=3000

For the React dev server, copy frontend/.env.example and adjust:

VITE_API_BASE_URL=http://localhost:3000

πŸ”Œ Core API Endpoints

Route Description
GET /api/coins Supported KRW markets (volume sorted).
GET /api/data/:coin/latest?days=30 Latest day-candle slice.
GET /api/data/:coin/range?start=YYYY-MM-DD&end=YYYY-MM-DD Day-candle slice for a date range (start required, end defaults to today).
GET /api/data/:coin/statistics Min/Max/Range per coin.
GET /api/market-data/:coin Redis-backed trading-value overlay (falls back to saved files).
GET /api/coins/listing-dates Cached listing calendar snapshot (3h cadence).
GET /api/coins/listing-strategies Cached Bybit short-scenario lab (3h cadence).
GET /api/ticker / GET /api/ticker/:coins 1-minute cached Upbit tickers (API-key protected if set).

πŸ”„ Data Refresh Cadence

  • Ticker cache: 60s TTL + persisted JSON (restored on restart).
  • Day candles: Loaded on-demand and updated daily at 00:05 KST.
  • Market data overlay: Parsed once per saved_data mtime, then cached in Redis for 6h per coin.
  • Listing calendar & lab: Every 3 hours; results saved to cache/ and, after restart, to Redis for warm responses.

μ—…λΉ„νŠΈ μ•ŒνŒŒ 데슀크 (Korean)

Upbit Alpha DeskλŠ” KRW λ§ˆμΌ“μš© λ¦¬μ•‘νŠΈ 기반 λŒ€μ‹œλ³΄λ“œμž…λ‹ˆλ‹€.
Upbit 일봉, 1λΆ„ μΊμ‹œ 티컀, saved_data κ±°λž˜λŒ€κΈˆ, Bybit 상μž₯ 숏 μ „λž΅ 톡계λ₯Ό Redisκ°€ λ’·λ‹¨μ—μ„œ μΊμ‹±ν•˜κ³  Express API둜 μ œκ³΅ν•©λ‹ˆλ‹€.

πŸ”§ 기술 μŠ€νƒ

  • λ°±μ—”λ“œ: Node.js, Express, TypeScript, Redis μΊμ‹œ, Axios μŠ€μΌ€μ€„λŸ¬
  • ν”„λŸ°νŠΈμ—”λ“œ: React (Vite), React Query, Chart.js, date-fns
  • μŠ€μΌ€μ€„λŸ¬: 상μž₯ μΊ˜λ¦°λ” / 상μž₯ μ „λž΅(3μ‹œκ°„), 티컀 μΊμ‹œ, saved_data νŒŒμ„œ, μžμ • 데이터 κ°±μ‹ 

πŸ“ ꡬ쑰

src/                  # Express API + μŠ€μΌ€μ€„λŸ¬
frontend/             # React/Vite SPA
public/               # κΈ°μ‘΄ 정적 μžμ›
cache/, saved_data/   # 운영 μΊμ‹œ/데이터

πŸš€ 개발 방법

  1. λ£¨νŠΈμ—μ„œ pnpm install, pnpm dev (API μ„œλ²„).
  2. frontend/μ—μ„œ pnpm install, pnpm dev (Vite). .env에 VITE_API_BASE_URL을 λ°±μ—”λ“œ μ£Όμ†Œλ‘œ μ§€μ •.
  3. 배포 μ‹œ pnpm build (λ°±/ν”„λŸ°νŠΈ λ™μ‹œ λΉŒλ“œ) ν›„ pnpm start μ‹€ν–‰ β†’ Expressκ°€ frontend/dist(SPA)와 /api/*λ₯Ό ν•¨κ»˜ μ„œλΉ„μŠ€ν•©λ‹ˆλ‹€.
  4. pnpm test λͺ…λ ΉμœΌλ‘œ κΈ°λ³Έ μœ λ‹› ν…ŒμŠ€νŠΈ(레이트 리미터)λ₯Ό 돌릴 수 μžˆμŠ΅λ‹ˆλ‹€.

πŸ” ν™˜κ²½ λ³€μˆ˜

CORS_ORIGINS=https://app.example.com
API_KEY=선택적 인증 ν‚€
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX=120
REDIS_URL=redis://default:password@host:11219
SERVE_FRONTEND=true

ν”„λŸ°νŠΈλŠ” frontend/.env μ•ˆμ— VITE_API_BASE_URL을 μ„€μ •ν•˜μ„Έμš”.

πŸ”Œ μ£Όμš” API

경둜 μ„€λͺ…
/api/coins 지원 KRW λ§ˆμΌ“ λͺ©λ‘
/api/data/:coin/latest?days=N 졜근 N일 일봉 데이터
/api/data/:coin/range?start=YYYY-MM-DD&end=YYYY-MM-DD 기간별 일봉 데이터 (start ν•„μˆ˜, end λ―Έμ§€μ • μ‹œ 였늘)
/api/data/:coin/statistics 톡계 (졜고/μ΅œμ € λ“±)
/api/market-data/:coin Redis μΊμ‹œλœ κ±°λž˜λŒ€κΈˆ/κ±°λž˜λŸ‰
/api/coins/listing-dates 3μ‹œκ°„λ§ˆλ‹€ κ°±μ‹ λ˜λŠ” 상μž₯ μΊ˜λ¦°λ”
/api/coins/listing-strategies 3μ‹œκ°„λ§ˆλ‹€ κ³„μ‚°λ˜λŠ” 상μž₯ 숏 μ „λž΅ λ³΄κ³ μ„œ
/api/ticker / /api/ticker/:coins 1λΆ„ μΊμ‹œ Upbit 티컀

πŸ”„ κ°±μ‹  μ£ΌκΈ°

  • 티컀: 1λΆ„ TTL + λ””μŠ€ν¬ λ°±μ—…
  • 일봉 데이터: μžμ •(00:05) μžλ™ μ—…λ°μ΄νŠΈ
  • κ±°λž˜λŒ€κΈˆ: saved_data 파일 λ³€κ²½ μ‹œ μž¬νŒŒμ‹± β†’ Redis 6μ‹œκ°„ μΊμ‹œ
  • 상μž₯ μΊ˜λ¦°λ”/μ „λž΅: 3μ‹œκ°„λ§ˆλ‹€ μž¬κ³„μ‚° + λ””μŠ€ν¬/Redis μŠ€λƒ…μƒ·

μ˜μ–΄/ν•œκ΅­μ–΄ μ„€λͺ…을 ν•¨κ»˜ μ œκ³΅ν•˜λ‹ˆ ν”Œλž«νΌν™” μž‘μ—… μ‹œ μ°Έκ³ ν•˜μ„Έμš”.

About

Full-stack Upbit market intelligence console for listings, analytics, and KRW market data.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors