bitflow-market-maker-public/docs/ROADMAP.md
Bought 16075e509b feat: local web console with sBTC and USDCx bridging
Adds a local web console for running and managing the market maker, with built-in bridging.

**Console** (`npm run ui`, http://127.0.0.1:5191)
- Fleet overview with total value, PnL vs HODL, and a Pause all button
- Per-bot pages: decisions, settings with validation, manual swap/add/withdraw, cash out to a saved payout address, dry-run to live checklist
- New-bot flow: create or import a wallet (key or recovery phrase), back up the key, fund it, pick a pool
- Bots are spawned as child processes with argv (no shell); key and phrase stay in the 0600 env file

**Bridging**
- BTC ↔ sBTC: deposit address per bot (sbtc library defaults), withdrawals via `initiate-withdrawal-request`, status from Emily
- USDC ↔ USDCx: deposits from an Ethereum wallet (EIP-6963) through Circle xReserve, withdrawals via `usdcx-v1.burn`; payouts are followed on Ethereum window by window
- Activity list with status and per-chain transaction links

**Security**
- Binds to 127.0.0.1 only; checks Host, Origin and Sec-Fetch-Site; JSON-only writes
- Routes that reveal a key or send funds to a typed address answer only the page
- Settings writes are allowlisted and validated; secrets are never returned

Tested end to end on mainnet in every bridge direction. `npm run build`, `npm test` (215 passing) and the UI build all pass. Docs: README, AGENTS.md, docs/RECOVERY.md, ROADMAP.
2026-10-28 16:13:58 -07:00

1.6 KiB

Roadmap

Ideas we have agreed to build later. Not scheduled yet.

Follow the price into the next pool

What: Bitflow runs more than one pool for the same pair (for example several sBTC / USDCx pools), each covering a different price band. When the price reaches the edge of the bins in the pool a bot is using, the bot should move its liquidity to the sBTC / USDCx pool that covers the next band, instead of sitting out of range.

Why: Today a bot is tied to one pool contract (POOL_ID). If the price leaves that pool's band, the bot holds one-sided inventory and earns nothing until the price comes back.

Rough shape:

  • A list of pools per pair with their price bands, instead of one pool id per profile in src/console/profiles.ts and .env.<pool>.
  • A trigger: the active bin is within N bins of the pool's edge (or past it) for M checks in a row, so a single wick does not cause a move.
  • The move: withdraw from the current pool, then add to the next pool, using the existing withdraw and add paths, so dry run, pause, and the safety halts still apply.
  • The page shows which pool the bot is in now and logs each move in Activity.

Open questions:

  • Where the band data comes from (Bitflow API, or a fixed list in the repo).
  • Whether the move should wait for the price to settle in the new band.
  • How "Vs. holding" and the profit baseline carry across a move.
  • What happens when there is no next pool.

Bridging, what is left

BTC ↔ sBTC and USDC ↔ USDCx are on the Bridge page and the Fund step. Still to build:

  • Reclaiming a failed sBTC deposit from the page (buildSbtcReclaimTx, signed with the bot key).