CompletedData Planner / Full-stack / Exchange Backend  ~4 min read

'COCOMSS' — Crypto AI Portfolio Advisor

A crypto AI portfolio advisor that grew from a card recommender into one service consolidating whitepaper learning (widigg), XAI (TrustFin), and equity research. It connects a 'learn → understand → verify → decide & practice' journey through K-Means·Markowitz recommendation, XAI contribution breakdown, realistic backtests, and paper trading, and also builds exchange-core internals (price-time matching engine, double-entry ledger, a Rust sub-microsecond engine). Ran at cocomss.com until October 2026.

CryptoPortfolio RecommendationXAIBacktestingMatching EngineFintechFull-stack

At a glance

42nsRust matching engine latency (p50)

Context
Personal project · Mar–Jul 2026
My role
Data Planner / Full-stack / Exchange Backend
Problem
Crypto beginners invest on recommendations without knowing what they buy. Recommendations don't explain why, and backtests show only the good numbers.
Outcome
Merged four earlier projects into one learn-verify-practice service, run at cocomss.com until October 2026, and built the exchange matching engine in Rust myself.
'COCOMSS' — Crypto AI Portfolio Advisor

Overview

Personal project · Mar–Jul 2026 · Data planning · Full-stack · Exchange backend

COCOMSS was the service domain (cocomss.com) and is the name under which several projects merged. It began as a card recommender (KB Card) and pivoted to crypto. It then merged the methods of whitepaper learning (widigg), explainable AI (TrustFin), and equity research into one service.

Built a full-stack AI portfolio advisor that helps crypto beginners learn, understand, and verify before they put money into an asset they don't know. It is a technical demo with no real trading or fund movement.

  • In the learn step, users study blockchain whitepapers in a 3-level tree (source→translation→explanation→terms). Gemini cited Q&A and quizzes are included, and completion earns an ERC-721 badge on Base mainnet
  • In the understand step, a risk survey feeds K-Means clustering and Markowitz optimization to recommend a portfolio. XAI breaks the score into exact factor contributions so the sum equals the score, and "what if your profile were one step different?" counterfactuals are shown
  • In the verify step, DCA/momentum/rebalancing backtests include fees, slippage, signal lag, and walk-forward. Bootstrap confidence intervals attach a "probability this result was luck"
  • In the decide & practice step, learning-journey missions and a real-money-free paper portfolio track P&L
  • For the exchange core, a service that only consumed prices gained a hand-built price-time-priority order book (CLOB) and double-entry ledger. The Rust high-frequency engine reaches a matching latency of p50 42ns. HMAC-signed orders, settlement, and custody state machines run in a sandbox
  • Operations used a Bithumb/Upbit adapter toggle, live WS prices, zero-downtime rolling deploys (0 API/web failures), and CI with 4 jobs (191 pytest + Rust + Playwright E2E)
  • Skill: data planning/recommendation, ML (K-Means)·quant (Markowitz·backtest), explainable AI, exchange backend (matching·settlement), full-stack·infra operations
  • Stack: Python·FastAPI, scikit-learn·PyPortfolioOpt·pandas, Rust, Next.js 16·TS·Tailwind, MySQL·Docker·nginx·AWS EC2, Gemini·Solidity·Base

Problem

Crypto beginners easily invest off a recommendation without knowing what they are buying. Recommendations rarely explain why this coin. Backtests hide fees and luck behind good-looking numbers. To earn trust, the service needed a mechanism that tells you not to just trust the recommendation.

Key point

A learning buffer before investing makes people learn before they decide. Every number carries a "why" and a "chance it's luck."

Solution

  1. Designed learn→understand→verify→decide·practice as one flow and tracked each step with missions
  2. Modeled the score as a weighted sum of rules (60%) and ML cluster fit (40%) and broke each term's contribution down exactly, without approximation. Counterfactuals are derived by inverting thresholds from the formula and shown as they are
  3. Added trading costs, look-ahead prevention, and walk-forward to the backtests. Bootstrap reports the "probability of no edge over buy-and-hold"
  4. Enforced matching/settlement correctness (value conservation, no crossed book) with invariant tests. Dropped matching latency to nanoseconds in Rust
  5. Added a pre-use investment-responsibility consent modal and four legal docs (about, terms, privacy, policy)

Result

  • Consolidated four prior projects (card recommender · widigg · TrustFin · equity research) into one journey-shaped service, run at cocomss.com until October 2026
  • Made "why this recommendation" verifiable via XAI exact breakdown, counterfactuals, and an admin weight console
  • The matching engine enforces invariants with 8-seed × thousands-of-orders fuzzing. The Rust engine recorded p50 42ns · 13.45M orders/s
  • Zero-downtime deploys saw 0 failures across 542 API/web probes. CI ran 4 jobs green with 191 pytest + Rust + E2E
  • Carried it from planning through backend, frontend, Rust, and infra, hands-on

Retrospective

Merged scattered experiments (card recommender, whitepaper learning, XAI, research) into a single product logic of "a learning buffer before investing." This time I learned that adding features and building a story are different jobs.

Published performance tracking, confidence intervals, and XAI breakdowns put "don't trust, verify" into code. I confirmed that this attitude matters most in a financial domain.

Built matching, settlement, and custody on top of a service that only consumed exchange prices. To the experience of building services in the exchange ecosystem, this added the experience of building exchange-core correctness. Real funds, regulation, and real-key custody were marked as out-of-code territory.

Links

Screens — Learn: Blockchain Whitepaper Study

A 3-level whitepaper library (source→translation→explanation→terms) for the 26 coins listed on either exchange (Bithumb∨Upbit) out of a 45-doc catalog. Untradeable coins and non-coin tech papers are kept out of the journey. Live prices come from the exchange adapter. After learning, users can verify right away against prices and backtests.

COCOMSS whitepaper study — the whitepaper library

Screens — Understand: Explainable Portfolio Recommendation

A risk survey feeds K-Means clustering and Markowitz optimization to recommend a portfolio. "Why this score" is broken into exact factor contributions so the sum equals the score. One screen holds a cluster scatter/radar, per-coin metrics, and "what if your profile were one step different?" counterfactuals.

COCOMSS recommendation result — XAI contribution breakdown, K-Means clustering, counterfactuals

Screens — Verify: Honest Backtesting

DCA, momentum, and rebalancing strategies include fees, slippage, signal lag, and walk-forward. A 1,000-run bootstrap reports the "chance of no edge over buy-and-hold" with a 95% CI. The conclusion is stated first, then shown as a strategy-vs-Buy&Hold curve.

COCOMSS backtest result — conclusion hero, bootstrap CI, strategy vs buy-and-hold

Screens — Verify: Event Study (AR/CAR + t-test)

Answers "how far did it fall during the Terra collapse?" with numbers. A market model strips market-wide movement and keeps only the event's abnormal return (CAR). A t-test then separates it from luck. This is the equity-research methodology ported to crypto. Validated on BTC real data, it reproduces economically sensible figures. Terra/Luna collapse −24.7% · FTX bankruptcy −23.2% · Trump election +23.7% · Korea's crypto-user-protection act +16.7%, all significant. ETF approval was −8.3%, matching the "sell-the-news" view, and the 4th halving −16.2%, matching the "priced-in" view. Both were insignificant.

COCOMSS event study — per-event CAR·t·significance, SVB depeg CAR/AR chart

Screens — Verify: Cross-Asset Allocation

Combines stocks, gold, bonds, and crypto in one Markowitz optimization. All assets are priced in KRW to remove FX distortion. A risk-based cap limits crypto. The diversification from low correlations is shown as a treemap.

COCOMSS cross-asset allocation — Markowitz optimization, asset-class treemap

Screens — Exchange Core: Matching Engine Demo

A service that only consumed prices gained exchange-backend correctness built directly. It has a price-time-priority order book (CLOB) and a double-entry ledger. Orders match and settle in real time. Value conservation, no crossed book, and no negative balances are enforced as invariants (no real trading or funds).

COCOMSS matching engine demo — CLOB order book, double-entry ledger, invariants

Related

OperationsCOCOMSS — A crypto AI portfolio advisor that ran learn → understand → verify → decide·practice, down to hand-built exchange-core internalsJournalCOCOMSS Confirms Its Recommendation Engine Failed and Turns to 2027 TaxationJournalBuilding an Order Book and Ledger Inside COCOMSSJournalFour Projects Into One COCOMSS