Skip to content

feat: drop Upbit/Bybit and reduce to Binance-only foundation#94

Merged
fray-cloud merged 2 commits intodevfrom
feat/binance-only-cleanup
May 2, 2026
Merged

feat: drop Upbit/Bybit and reduce to Binance-only foundation#94
fray-cloud merged 2 commits intodevfrom
feat/binance-only-cleanup

Conversation

@fray-cloud
Copy link
Copy Markdown
Owner

Summary

PR1 of 3 in the LLM-driven Binance Futures pivot. Cleanup only — removes everything not needed for the new direction so the next two PRs can build on a clean base.

  • Delete Upbit/Bybit adapters, all strategies/flows/backtests modules across worker, api-server, and web (~20k lines removed)
  • Reduce `ExchangeId` union to `'binance'` and update all DTOs/factories/REST_ADAPTERS/EXCHANGES constants accordingly
  • Reset Prisma schema (drop Strategy/Flow/Backtest/StrategyLog/BacktestTrace) and regenerate single fresh init migration
  • Trim Kafka contracts (StrategySignal/Backtest events + topics removed)
  • Convert docker-compose data dirs to named volumes (postgres_data, redis_data, kafka_data, zookeeper_data/log, nginx_logs, api_server_logs, worker_service_logs) — bypasses WSL2 bind-mount permission collisions
  • Drop `/app/node_modules` anonymous volume in web compose so pnpm symlinks resolve correctly inside the container
  • Disable client-side paper engine (Binance Testnet replaces it in PR2)
  • Add Karpathy coding behavior guidelines to CLAUDE.md (separate commit)

Why

Existing platform had Upbit/Binance/Bybit + indicator strategies + flow builder + backtest engine — too dispersed for the new goal of LLM-driven Binance Futures trading. Approved plan at `~/.claude/plans/sharded-dreaming-map.md` splits the pivot into three PRs:

  • PR1 (this): mechanical cleanup so the next PRs land on a clean base
  • PR2: Binance Futures (`fapi.binance.com`) adapter + futures fields on OrderRequest/Result/Order + ExchangeKey.network (testnet/mainnet)
  • PR3: Claude CLI integration (`claude -p` subprocess) + per-user OAuth token storage (`ClaudeToken` Prisma model + `/settings/claude` UI) + LLM trade form + 7 safety guards

Test plan

  • `pnpm build` green across all 9 workspace packages
  • `docker compose -f docker-compose.dev.yml up -d` brings the full dev stack up
  • `postgres`, `redis`, `kafka` containers report `healthy`
  • `prisma migrate dev --name init` runs cleanly against fresh volume → `20260430165222_init` migration created
  • `api-server` healthy + `/api/health` returns `200 {"status":"ok"}`
  • `worker-service` connects to Kafka and joins consumer group
  • `web` compiles + `/markets` returns `200`
  • Test suites (`pnpm test`) — known broken; will be fixed alongside the new feature in PR2/PR3
  • CI green

Out of scope

  • New futures adapter (PR2)
  • New LLM trade flow + Claude token UI (PR3)
  • Test suite repair (PR2/PR3)

🤖 Generated with Claude Code

fray-cloud and others added 2 commits May 1, 2026 01:59
Adds a four-principle "Coding behavior" section (Think before coding,
Simplicity first, Surgical changes, Goal-driven execution) above the
existing Skill routing rules. Surfacing these rules in CLAUDE.md keeps
implicit guidance explicit and actionable across future sessions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…only foundation

Foundation cleanup PR before introducing Binance Futures + Claude CLI driven
trading. Removes everything not needed for the new direction.

What's removed:
- Upbit and Bybit exchange adapters (REST + WS + tests, ~1300 lines)
- worker-service strategies/, backtesting/, backtests/, flows/, paper-engine.service.ts
- api-server strategies/, flows/, e2e/strategies tests
- web app/strategies, app/flows, app/orders, app/backtests routes + components
- web hooks for strategies/flows/orders/backtests, lib/indicators
- Strategy factory + indicator constants from test-utils and lib
- Strategy/Flow/Backtest/StrategyLog/BacktestTrace Prisma models
- StrategySignalEvent/BacktestRequested/Completed Kafka events and topics

What's reshaped:
- ExchangeId union narrowed to 'binance'; all DTOs, factories, REST_ADAPTERS,
  EXCHANGES constants updated accordingly
- Activity service drops strategy_signal/strategy_order/risk_blocked types
- Notification settings/event types reduced to order_filled/order_failed
- Markets service/gateway drops strategy:signal and backtest:completed listeners
- Prisma migrations folder cleared and a single fresh init migration is applied
  by `prisma migrate dev` against the empty volume

What's added (infra):
- Docker Compose data volumes converted to named volumes
  (postgres_data, redis_data, kafka_data, zookeeper_data/log) to bypass WSL2
  bind-mount permission collisions
- API/worker/nginx logs moved to named volumes (stdout logging in services)
- Web container's anonymous /app/node_modules volume removed so pnpm symlinks
  resolve correctly inside the container
- Postgres logging_collector and Redis --logfile flags removed (use stdout)

Verified end-to-end:
- pnpm build green across all 9 workspace packages
- docker compose up: postgres/redis/kafka healthy, api-server /api/health 200,
  worker connects to Kafka and joins consumer group, web renders /markets
- Prisma init migration generated and applied against fresh volume

Plan: PR2 will bring Binance Futures (fapi.binance.com) adapter + futures
fields on OrderRequest/Result/Order; PR3 will add Claude CLI driven LLM trade
flow + per-user OAuth token storage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 20000 lines

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
coin-web Ready Ready Preview, Comment Apr 30, 2026 5:01pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant