Skip to content

QuantaTrade AI — Repository Bootstrap Plan

Source Code Mapping

Each QuantaTradeAI repo maps to an existing codebase that will be cloned and adapted.

graph LR
    subgraph Sources["Source Repositories"]
        EC2[QuantaTradeAI/exchange-platform<br/>Java matching engine]
        FE[QuantaTradeAI/fix-engine<br/>Rust OMS/execution]
        WUI[QuantaTradeAI/quantatrade-ui<br/>Next.js trading dashboard]
        BP[QuantaTradeAI/exchange-platform<br/>NestJS microservices]
        BMM[QuantaTradeAI/quantatrade-mm<br/>Java market maker]
        BT[QuantaTradeAI/backtest-engine<br/>Python/Rust backtesting]
    end

    subgraph Target["QuantaTradeAI Organization"]
        QEC[exchange-core]
        QOM[order-management]
        QUI[trading-ui]
        QPL[platform]
        QCS[custody-service]
        QCC[compliance-service]
        QCT[contracts]
        QPA[presale-app]
        QID[investor-dashboard]
        QAP[admin-panel]
        QCI[chain-indexer]
        QSE[strategy-engine]
        QMD[market-data]
        QMM[market-maker]
        QIF[infrastructure]
        QDO[docs]
    end

    EC2 -->|"clone & adapt"| QEC
    FE -->|"clone & adapt"| QOM
    WUI -->|"clone & adapt"| QUI
    BP -->|"extract services"| QPL
    BP -->|"extract custody-service"| QCS
    BP -->|"extract kyc-service"| QCC
    BP -->|"extract admin-ui"| QAP
    BMM -->|"clone & adapt"| QMM
    BT -->|"clone & adapt"| QSE

    style Sources fill:#fff3e0
    style Target fill:#e8f5e9

Detailed Mapping: Clone Source → Target

1. exchange-core ← QuantaTradeAI/exchange-platform (matching engine)

Aspect Details
Source QuantaTradeAI/exchange-platformservices/matching-engine/
Language Java Spring Boot
What to copy exchange-core2 library, matching engine gateway, order book logic
Adaptations Rebrand packages, configure $QTRA trading pairs, adjust scale model for crypto-only, remove legacy fiat pairs
New pairs QTRA-USDC, BTC-USDC, ETH-USDC, SOL-USDC, BTC-USDT, ETH-USDT
# Bootstrap
gh repo clone QuantaTradeAI/exchange-platform /tmp/emt-exchange
cp -r /tmp/emt-exchange/services/matching-engine/* exchange-core/
# Extract exchange-core2 Java library
cp -r /tmp/emt-exchange/libs/exchange-core2/* exchange-core/libs/
# Clean up, rebrand, push

2. order-management ← QuantaTradeAI/fix-engine

Aspect Details
Source QuantaTradeAI/fix-engine
Language Rust
What to copy Multi-exchange connector architecture, order execution, venue routing
Adaptations Replace FIX protocol with crypto exchange APIs (Binance, Bybit, OKX REST+WebSocket), add OMS state machine, add PMS position tracking, add smart order routing logic
# Bootstrap
gh repo clone QuantaTradeAI/fix-engine /tmp/fix-engine
cp -r /tmp/fix-engine/* order-management/
# Refactor: remove venue-specific, add crypto venue connectors

3. trading-ui ← QuantaTradeAI/quantatrade-ui

Aspect Details
Source QuantaTradeAI/quantatrade-ui
Language Next.js 14 + TypeScript
What to copy Trading dashboard layout, real-time WebSocket charts, order entry, portfolio view, auth flow
Adaptations Rebrand to QuantaTrade, add spot trading interface, add strategy monitoring dashboard, replace FX-specific components with crypto, add TradingView charts, add subscription management UI
# Bootstrap
gh repo clone QuantaTradeAI/quantatrade-ui /tmp/quantatrade-ui
cp -r /tmp/quantatrade-ui/* trading-ui/
# Rebrand, adapt for crypto trading

4. platform ← QuantaTradeAI/exchange-platform (services)

Aspect Details
Source QuantaTradeAI/exchange-platform
Language Node.js + NestJS + TypeScript
What to extract API gateway, order-router, ledger-service, risk-service, ws-gateway, shared packages (db, types, nats, common)
Adaptations Rebrand, remove QuantaTrade-specific business logic, add QuantaTrade API routes, adapt Prisma schema for $QTRA pairs, replace NATS with Kafka/Redpanda if needed
# Bootstrap - extract specific services into monorepo
gh repo clone QuantaTradeAI/exchange-platform /tmp/quantatrade
mkdir -p platform/{services,packages}
cp -r /tmp/quantatrade/services/api-gateway platform/services/
cp -r /tmp/quantatrade/services/order-router platform/services/
cp -r /tmp/quantatrade/services/ledger-service platform/services/
cp -r /tmp/quantatrade/services/risk-service platform/services/
cp -r /tmp/quantatrade/services/ws-gateway platform/services/
cp -r /tmp/quantatrade/packages/{common,db,types,nats} platform/packages/
# Adapt package.json, rebrand, push

5. custody-service ← QuantaTradeAI/exchange-platform

Aspect Details
Source QuantaTradeAI/exchange-platformservices/custody-service/
Language Node.js + TypeScript + Temporal workflows
What to copy BitGo API integration, wallet provisioning, deposit/withdrawal flows, address pooling
Adaptations Add multi-sig approval flows, add stablecoin rails (USDC/USDT on ETH/BSC/SOL/Tron), add fiat rails (SEPA/SWIFT/ACH), add treasury allocation framework (50/50 split)
# Bootstrap
cp -r /tmp/quantatrade/services/custody-service/* custody-service/
cp -r /tmp/quantatrade/services/treasury-service/* custody-service/treasury/

6. compliance-service ← QuantaTradeAI/exchange-platform

Aspect Details
Source QuantaTradeAI/exchange-platformservices/kyc-service/
Language Node.js + TypeScript
What to copy Sumsub KYC integration, webhook handlers, verification status management
Adaptations Add tiered KYC (Retail/HNWI/Institutional), add jurisdiction-based access controls, add AML transaction monitoring, add sanctions screening, add immutable audit logging
# Bootstrap
cp -r /tmp/quantatrade/services/kyc-service/* compliance-service/

7. contracts — NEW (Solidity)

Aspect Details
Source New development
Language Solidity 0.8.x + Hardhat
Deliverables $QTRA ERC20 token, SaleManager (6 rounds), Allocation & Vesting (Merkle), Staking + Rewards
# Bootstrap with Hardhat
cd contracts && npx hardhat init
npm install @openzeppelin/contracts

8. presale-app — NEW (Next.js)

Aspect Details
Source New development (reference trading-ui for patterns)
Deliverables Wallet connect, round pages (Private A/B/C, Public), buy flow, claim portal, tx receipts

9. investor-dashboard — NEW (Next.js)

Aspect Details
Source New development (reference trading-ui for patterns)
Deliverables Auth (wallet/OAuth), holdings by round, vesting schedule, claimable amounts, tx history

10. admin-panel ← QuantaTradeAI/exchange-platform

Aspect Details
Source QuantaTradeAI/exchange-platformservices/admin-ui/
Language React / Next.js
Adaptations Add presale management (configure rounds, CSV uploads, Merkle root), add allocation freeze, add TGE config, add CSV exports, add audit log viewer
# Bootstrap
cp -r /tmp/quantatrade/services/admin-ui/* admin-panel/

11. chain-indexer — NEW (TypeScript)

Aspect Details
Source New development
Deliverables Index on-chain events (purchases, allocations, claims, vesting), reconciliation against on-chain totals
Stack Node.js + ethers.js + PostgreSQL

12. strategy-engine ← QuantaTradeAI/backtest-engine

Aspect Details
Source QuantaTradeAI/backtest-engine + QuantaTradeAI/strategies
Language Python + Rust (PyO3)
Adaptations Replace strategies with crypto strategies (mean reversion, funding spread arbitrage), add signal engine, add AI prediction scanners, add backtesting environment, add custom signal builder
# Bootstrap
gh repo clone QuantaTradeAI/backtest-engine /tmp/backtester
cp -r /tmp/backtester/* strategy-engine/
gh repo clone QuantaTradeAI/strategies /tmp/strategies
cp -r /tmp/strategies/* strategy-engine/strategies/

13. market-data — MIXED (Rust + Node.js)

Aspect Details
Source Reference QuantaTradeAI/market-data-relay for data streaming patterns
Deliverables DOM, L2/L3 visualization, liquidity analytics, news aggregation, sentiment engine, microstructure analytics

14. market-maker ← QuantaTradeAI/quantatrade-mm

Aspect Details
Source QuantaTradeAI/quantatrade-mm
Language Java Spring Boot
Adaptations Configure for $QTRA pairs, add liquidity provisioning logic, add external incentives, add spread management
# Bootstrap
gh repo clone QuantaTradeAI/quantatrade-mm /tmp/quantatrade-mm
cp -r /tmp/quantatrade-mm/* market-maker/

15. infrastructure — NEW

Aspect Details
Source Reference QuantaTrade and QuantaTrade infra patterns
Deliverables Terraform (GCP/AWS), K8s manifests, Helm charts, CI/CD (GitHub Actions + ArgoCD), monitoring stack

16. docs — DONE (already pushed)


Bootstrap Execution Order

gantt
    title Repository Bootstrap Order
    dateFormat YYYY-MM-DD
    axisFormat %b %d

    section Week 0 — Bootstrap
    Clone sources & strip history           :w0a, 2026-03-31, 2d
    exchange-core (from QuantaTradeAI)             :w0b, after w0a, 1d
    order-management (from fix-engine)      :w0c, after w0a, 1d
    trading-ui (from quantatrade-ui)            :w0d, after w0a, 1d
    platform (from quantatrade services)          :w0e, after w0a, 2d
    custody-service (from quantatrade)            :w0f, after w0a, 1d
    compliance-service (from quantatrade)         :w0g, after w0a, 1d
    admin-panel (from quantatrade)               :w0h, after w0a, 1d
    market-maker (from quantatrade-mm)           :w0i, after w0a, 1d
    strategy-engine (from quantatrade)         :w0j, after w0a, 1d
    contracts (Hardhat scaffold)            :w0k, after w0a, 1d
    infrastructure (Terraform scaffold)     :w0l, after w0a, 1d
    presale-app (Next.js scaffold)         :w0m, after w0a, 1d
    investor-dashboard (Next.js scaffold)   :w0n, after w0a, 1d
    chain-indexer (Node.js scaffold)       :w0o, after w0a, 1d

Important: Clean Git History

When cloning from source repos, strip the git history to avoid leaking proprietary code lineage:

# For each cloned repo:
rm -rf .git
git init
git add -A
git commit -m "Initial commit - bootstrapped from internal codebase"
git remote add origin https://github.com/QuantaTradeAI/<repo>.git
git branch -M main
git push -u origin main

Source Access Requirements

Source Repo Org Access
QuantaTradeAI/exchange-platform QuantaTradeAI You (owner)
QuantaTradeAI/fix-engine QuantaTradeAI You (owner)
QuantaTradeAI/quantatrade-ui QuantaTradeAI You (owner)
QuantaTradeAI/backtest-engine QuantaTradeAI You (owner)
QuantaTradeAI/strategies QuantaTradeAI You (owner)
QuantaTradeAI/exchange-platform QuantaTradeAI You (owner)
QuantaTradeAI/quantatrade-mm QuantaTradeAI You (owner)

All source repos are owned by you — no access issues.