Crypto Exchange Platform (Spot)
Links
2025 ~ Present (Updated: 2026-03)
저지연 매칭 엔진과 복식부기 원장을 분리하고, WAL 기반 durable commit line·결정적 복구·실시간 시세 파이프라인·운영 검증 자동화까지 구현 중인 Spot 거래소 실험 프로젝트.
Tech Stack
- Rust
- Go
- Kotlin
- Spring Boot
- TypeScript
- React (web-user alpha)
- PostgreSQL
- Redpanda (Kafka API)
- Protobuf
- Flink
- Redis
- ClickHouse
- MinIO (S3)
- Kubernetes
- GitOps (ArgoCD baseline)
- OpenTelemetry
- Prometheus
Overview
- Trading Core(Rust)와 Ledger(Kotlin/PostgreSQL)를 분리해 성능(체결 경로)과 정합성(정산 경로)을 독립적으로 설계
- Core는 per-symbol single-writer + WAL + Snapshot + Replay 구조로 결정적 복구를 지원
- Edge Gateway(Go)는 REST/WS, 인증(HMAC), replay 방지, rate limiting, WS 백프레셔/slow-consumer close를 제공
- Ledger는 append-only double-entry, idempotent settlement, reconciliation(Engine seq vs Settled seq) 및 안전모드 전환을 제공
Architecture
- Commit line을
WAL durable append에 고정하고, 이후 outbox publish를 수행해 downstream 정산/재처리 단순화 TradeExecuted소비는 at-least-once + idempotent 적용으로 중복 전달에서도 exactly-once 효과를 보장하도록 설계- Market Data는 Flink(캔들/24h 티커) + Redis(핫 스냅샷) + ClickHouse(히스토리)로 분리
Data Flow
Order Ingress -> Auth/RateLimit -> Risk Check -> Match -> WAL Commit -> Outbox Publish(TradeExecuted/BookDelta)TradeExecuted -> Ledger Posting(append-only) -> Reconciliation -> Safety Mode(CANCEL_ONLY/HALT)Trade Stream -> Flink Aggregation(candles/ticker) -> Redis Snapshot + ClickHouse History -> WS/REST ServeWS RESUME(lastSeq) -> gap detection -> replay or snapshot fallback
Ops
- 핵심 지표:
engine seq gap,settlement lag,invariant violation,ws backlog/slow-consumer close,auth/replay fail - 운영 자동화: smoke/load/chaos/runbook-as-code 및
verification_factory기반 증적 번들 생성 - 프로덕션 가드레일: insecure/stub/localhost 의존 설정 시 서비스 부팅 차단(fail-closed)
Architecture Diagram
diagram rendering...