Skip to content

feat: add reference solver bot - #18

Merged
james2177 merged 1 commit into
mainfrom
feat/solver-ws-client
Jul 13, 2026
Merged

feat: add reference solver bot#18
james2177 merged 1 commit into
mainfrom
feat/solver-ws-client

Conversation

@james2177

Copy link
Copy Markdown
Contributor

Summary

Final item from the original migration/roadmap backlog: a reference solver bot demonstrating the accept → fill flow.

  • scripts/solver-bot.ts connects to /ws, and for every open intent it sees (initial snapshot or live intent_created) calls POST /api/v1/intents/:id/accept then POST /api/v1/intents/:id/fill
  • Intentionally naive strategy — accepts everything, fills at exactly minDstAmount, no pricing/profitability check or real settlement (documented clearly in scripts/README.md so nobody mistakes it for production-ready)
  • npm run solver:demo to run it; configurable via API_BASE/WS_URL/SOLVER_ADDRESS env vars
  • scripts/ now included in npm run lint
  • README: marks the last roadmap item done, links to scripts/README.md

Test plan

  • npm run typecheck / lint / build / test / test:e2e all pass
  • Ran the bot for real against a live instance: booted the app (3 seeded open intents), ran npm run solver:demo, watched it accept and fill all three via genuine WebSocket events and real HTTP calls (logs show each accepted/filled per intent)
  • Confirmed the fills actually persisted, not just logged: GET /api/v1/intents/open went from 3 → 0, GET /api/v1/stats fill rate went from 0.20.8 with totalVolume increasing by the correct amount

Last roadmap item: a reference implementation showing how a solver
connects to the /ws intent feed and executes the accept -> fill
flow against the live REST API. Naive strategy - accepts every open
intent it sees and fills at exactly minDstAmount, no pricing or real
settlement, as documented in scripts/README.md. Adds npm run
solver:demo and lints scripts/ alongside src/ and test/.

Verified end-to-end against a real running instance: booted the app
(3 seeded open intents), ran the bot for real, and watched it accept
+ fill all three via genuine WS events and HTTP calls. Confirmed via
GET /api/v1/intents/open (3 -> 0) and GET /api/v1/stats (fillRate
0.2 -> 0.8, totalVolume increased correctly) that the fills actually
persisted, not just logged.
@james2177
james2177 merged commit d5781d3 into main Jul 13, 2026
1 check passed
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