Skip to content

Commit 01fdffd

Browse files
committed
Plan the RFQ backend SDK path
Record the RFQ backend as a TypeScript SDK and local-reference path before MVP demo backend work begins, while preserving pending PR context for RFQ hardening, E2E, CLI, and BUIDL fixtures. Constraint: Open PRs #24, #28, #29, #30, and #35 already cover parts of RFQ hardening, protected-router scenarios, live demo, CLI, and BUIDL-like fixtures. Rejected: Treating an RFQ backend as a Corner Store-operated production server | would blur operator responsibilities for pricing, signer custody, inventory, hosting, and compliance prechecks. Confidence: high Scope-risk: narrow Directive: Implement RFQ SDK interfaces first; any MVP backend must reuse merged E2E/CLI/BUIDL paths instead of creating parallel demo infrastructure. Tested: git diff --check Not-tested: services/rfq implementation or runtime tests; documentation-only change
1 parent 10c38e2 commit 01fdffd

5 files changed

Lines changed: 281 additions & 35 deletions

File tree

FEATURES.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,26 @@ passing
115115

116116
- Non-goals: partial fill, orderbook, production pricing engine, dealer inventory,
117117
custody 확장, websocket/order discovery.
118+
## DOC-002 — RFQ SDK and MVP Demo Planning
119+
120+
### Behavior
121+
122+
- RFQ backend 운영을 Corner Store가 제공하지 않는다는 제품 경계를 명확히 한다.
123+
- RFQ backend SDK, local reference example, MVP demo backend를 서로 다른 레이어로 분리한다.
124+
- 구현 순서는 SDK interface 정리 → local reference example → MVP demo backend로 기록한다.
125+
- production RFQ hardening(dealer approval, custody, cancellation, partial fill)은 별도 트랙으로 유지한다.
126+
- roadmap과 product spec index에서 RFQ SDK/MVP backend 후속 작업을 찾을 수 있다.
127+
128+
### Verification
129+
130+
- RFQ venue architecture, product-spec index, roadmap, FEATURES, PROGRESS 교차 검토
131+
- `git diff --check`
132+
133+
### State
134+
135+
passing
136+
137+
### Notes
138+
139+
- Product spec: `docs/product-specs/rfq-backend-sdk-and-demo.md`
140+
- 이 feature는 문서 계획 작업이며 `services/rfq` 구현은 후속 feature에서 진행한다.

PROGRESS.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ source of truth로 사용한다.
1919
- `DOC-001 — Imported Architecture Alignment`
2020
- `FND-001 — Foundry Product Foundation`
2121
- `RFQ-001 — Reference RFQ Settlement`
22+
- `DOC-002 — RFQ SDK and MVP Demo Planning`
2223
- multi-venue 아키텍처와 책임 문서 작성
2324
- Corner Store용 Uniswap v3 최소 배포 profile 분리와 테스트
2425
- ExecutionRouter/VenueRegistry/VenueSelector와 AMM reference adapter skeleton
@@ -29,37 +30,38 @@ source of truth로 사용한다.
2930

3031
## Next
3132

32-
1. RFQ production hardening은 별도 feature로 분리한다: dealer/operator approval,
33-
custody, quote cancellation, partial fill 정책.
34-
2. production Asset Compliance Manifest lifecycle/schema와 operator approval flow를
33+
1. RFQ backend SDK interface를 구현한다: signer, nonce store, pricing provider,
34+
validation과 local reference example.
35+
2. MVP RFQ demo backend milestone/user flow를 별도 문서·feature로 구체화한다.
36+
PR #29/#30이 머지되면 기존 live-Anvil E2E/CLI 경로를 재사용한다.
37+
3. pending RFQ/E2E/CLI/BUIDL PR stack(#24/#28/#29/#30/#35)이 머지된 뒤
38+
roadmap과 feature 상태를 재조정한다.
39+
4. 남은 RFQ production policy를 별도 feature로 분리한다: custody, partial fill,
40+
production dealer/operator 책임.
41+
5. production Asset Compliance Manifest lifecycle/schema와 operator approval flow를
3542
구현한다.
36-
3. acquisition/lot data source와 holding-period Recipe 활성화 조건을 결정한다.
37-
4. live Anvil deployment/E2E와 security threat model을 추가한다.
38-
5. Order Book은 matching/custody/surveillance 모델 결정 후 구현한다.
43+
6. acquisition/lot data source와 holding-period Recipe 활성화 조건을 결정한다.
44+
7. Order Book은 matching/custody/surveillance 모델 결정 후 구현한다.
3945

4046
## Last Session Summary
4147

4248
- 변경한 파일:
43-
- RFQAdapter, RFQQuote type, RFQ-specific errors
44-
- RFQAdapter Foundry tests
45-
- `services/rfq` 최소 TypeScript quote signer reference
46-
- RFQ v1 scope/non-goals 문서
47-
- 실행한 명령:
48-
- `forge build`
49-
- `forge test --offline --match-path test/unit/execution/RFQAdapter.t.sol -vv`
50-
- `cd services/rfq && npm test`
49+
- `docs/product-specs/rfq-backend-sdk-and-demo.md`
50+
- `docs/product-specs/index.md`
51+
- `docs/ROADMAP.md`
52+
- `FEATURES.md`
53+
- `PROGRESS.md`
54+
- 완료한 작업:
55+
- RFQ backend를 production server 제공이 아니라 SDK + local reference example + 후속 MVP demo backend로 분리한 계획 문서 추가
56+
- RFQ SDK interface, local reference example, MVP demo backend의 단계별 deliverable과 non-goal 정리
57+
- roadmap near-term issue 순서에 RFQ SDK와 MVP demo backend planning을 추가
58+
- product-spec index에 RFQ backend SDK/demo 계획 문서 등록
59+
- 열린 PR #24/#28/#29/#30/#35를 RFQ SDK/MVP backend 계획의 pending upstream context로 반영
60+
- 전반 문서 점검 결과를 RFQ planning 문서에 기록
61+
- 실행한 검증:
62+
- product-spec index, ROADMAP, RFQ venue architecture, FEATURES, PROGRESS 교차 검토
5163
- `git diff --check`
52-
- `scripts/check.sh`
53-
- 통과한 검증:
54-
- RFQAdapter compile
55-
- valid signed quote settlement
56-
- invalid signature, expired quote, replay, wrong taker, mismatch, direct bypass,
57-
compliance rejection 거부
58-
- RFQ service typed-data/smoke check
59-
- 전체 repo check 통과
6064
- 남은 리스크:
61-
- production dealer approval, custody, quote cancellation, partial fill은 RFQ v1
62-
범위 밖이다.
63-
- production Manifest lifecycle과 acquisition/lot source는 아직 결정·구현 전이다.
64-
- live deployment/E2E와 static analysis는 아직 부족하다.
65-
- production Element와 engine 허용 조건은 법률 승인 전 활성화할 수 없다.
65+
- 아직 `services/rfq` 구현 변경은 하지 않았다.
66+
- MVP demo backend의 HTTP/CLI/UI 선택은 후속 문서·feature에서 정하되, PR #29/#30이 머지되면 기존 E2E/CLI 경로를 재사용해야 한다.
67+
- production RFQ dealer approval, custody, cancellation, partial fill은 별도 hardening track이다.

docs/ROADMAP.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ Deliverables:
251251
- signature, nonce, expiry와 taker binding
252252
- Router-only RFQ Adapter와 latest compliance evaluation
253253
- 최소 TypeScript quote signer reference service
254+
- RFQ backend SDK interface와 local reference example 계획은 `docs/product-specs/rfq-backend-sdk-and-demo.md`를 따른다.
255+
- MVP demo backend는 SDK 정리 이후 별도 feature로 구현한다.
254256
- partial fill policy는 v1 non-goal로 유지
255257

256258
Completion:
@@ -317,16 +319,27 @@ SDK와 reference DEX를 반복 배포하고 Manifest/권한 상태를 검증 가
317319

318320
## Near-Term Issues
319321

322+
Open PR context:
323+
324+
- #24 covers RFQ maker approval and quote cancellation hardening.
325+
- #28 covers protected-router RFQ integration scenarios.
326+
- #29 covers live-Anvil E2E/demo runner.
327+
- #30 covers interactive CLI over the deployed demo stack.
328+
- #35 covers BUIDL-like ERC-3643 compliance fixture with mock TA facts.
329+
320330
가까운 후속 이슈:
321331

322-
1. `design(rfq): dealer/operator approval, custody, cancellation, partial-fill policy 확정`
323-
2. `security(rfq): direct venue, signer, custody, replay, quote-cancellation threat model 작성`
324-
3. `feat(compliance): production Asset Compliance Manifest lifecycle/schema 구현`
325-
4. `design(compliance): acquisition/lot data source와 holding-period Recipe 활성화 조건 결정`
326-
5. `test(e2e): live Anvil deployment와 regulated RFQ/AMM settlement smoke 자동화`
327-
6. `feat(orderbook): matching/custody/surveillance 모델 결정 후 Order Book adapter 구현`
328-
7. `chore(ci): deploy-v3 CI, static analysis, lint/warning budget 추가`
329-
8. `docs(ops): Manifest activation/suspension runbook과 incident drill 문서화`
332+
1. `feat(rfq): add TypeScript SDK interfaces for quote backend integration`
333+
2. `docs(demo): define MVP RFQ backend milestone and user flow`
334+
3. `feat(demo): add MVP RFQ backend using the RFQ SDK` — PR #29/#30이 머지되면 해당 E2E/CLI 경로를 재사용한다.
335+
4. `docs(roadmap): reconcile roadmap after pending RFQ/E2E/CLI/BUIDL PR stack merges`
336+
5. `design(rfq): remaining production RFQ policy beyond PR #24` — custody, partial fill, production dealer/operator 책임.
337+
6. `security(rfq): direct venue, signer custody, replay, quote-cancellation threat model 보강`
338+
7. `feat(compliance): production Asset Compliance Manifest lifecycle/schema 구현`
339+
8. `design(compliance): acquisition/lot data source와 holding-period Recipe 활성화 조건 결정`
340+
9. `feat(orderbook): matching/custody/surveillance 모델 결정 후 Order Book adapter 구현`
341+
10. `chore(ci): static analysis, lint/warning budget 추가`
342+
11. `docs(ops): Manifest activation/suspension runbook과 incident drill 문서화`
330343

331344
## Decision Backlog
332345

docs/product-specs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
| [`../architecture/asset-manifest.md`](../architecture/asset-manifest.md) | Asset Compliance Manifest 책임과 lifecycle | Current |
1010
| [`../ROADMAP.md`](../ROADMAP.md) | 구현 순서와 완료 조건 | Current |
1111
| [`../MVP.md`](../MVP.md) | 과거 AMM 중심 설계 기록 | Historical |
12+
| [`rfq-backend-sdk-and-demo.md`](./rfq-backend-sdk-and-demo.md) | RFQ backend SDK와 MVP demo backend 계획 | Planned |
1213

1314
DOC-001에서 연구·회의 입력을 반영했다. 내용이 다를 경우 위 current 문서를 source
1415
of truth로 사용한다. acquisition registry, Element commit hook과 reject logging은
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# RFQ Backend SDK and MVP Demo Plan
2+
3+
## Status
4+
5+
Planned. This document defines scope before implementation.
6+
7+
## Purpose
8+
9+
Corner Store needs an off-chain RFQ component because a maker must price and sign quotes before a taker submits settlement through `ExecutionRouter` and `RFQAdapter`.
10+
11+
Corner Store should not provide or operate a production RFQ server. The product should provide:
12+
13+
1. TypeScript SDK pieces for integrators to build their own RFQ quote backend.
14+
2. A local-only reference example that demonstrates those SDK pieces.
15+
3. A later MVP demo backend that uses the SDK from a user's point of view.
16+
17+
The separation matters: the SDK is reusable product infrastructure; the MVP backend is an application/demo built on top of it.
18+
19+
## Current baseline
20+
21+
Already implemented:
22+
23+
- Solidity `RFQAdapter` with EIP-712 quote verification.
24+
- Router-only settlement path.
25+
- full-fill / exact-taker v1 behavior.
26+
- nonce, expiry, signature and quote-field binding tests.
27+
- `services/rfq` minimal TypeScript quote signer reference.
28+
29+
Current gap on `main` before the stacked PRs land:
30+
31+
- `services/rfq` is not yet shaped as a backend SDK.
32+
- signer, nonce, pricing and risk boundaries are not explicit enough for reuse.
33+
- there is no MVP user-facing RFQ backend flow yet.
34+
35+
Open PR context to preserve when planning implementation:
36+
37+
- PR #24 adds RFQ maker approval and quote cancellation hardening.
38+
- PR #28 adds protected-router RFQ integration scenarios.
39+
- PR #29 adds a live-Anvil E2E runner and scripted demo vehicle.
40+
- PR #30 adds an interactive CLI using the deployed stack and RFQ quote path.
41+
- PR #35 adds the BUIDL-like ERC-3643 compliance fixture with mock TA facts.
42+
43+
Those PRs should be treated as pending upstream context. The RFQ SDK work should
44+
not duplicate their contract tests, E2E runner, CLI, or BUIDL fixture; it should
45+
provide the reusable TypeScript backend boundary those layers can call.
46+
47+
## Layering
48+
49+
```text
50+
src/execution/adapters/rfq/RFQAdapter.sol
51+
-> on-chain settlement, signature verification, replay/expiry checks
52+
53+
services/rfq SDK
54+
-> quote construction, typed-data shape, validation, signing abstractions
55+
56+
local reference example
57+
-> mock pricing + in-memory nonce + local signer for integration guidance
58+
59+
MVP demo backend
60+
-> user-facing quote API built from the SDK for demos only
61+
```
62+
63+
## Phase 1 — RFQ TypeScript SDK interfaces
64+
65+
Goal: make `services/rfq` usable as the reusable quote-backend integration layer.
66+
67+
Deliverables:
68+
69+
- SDK interfaces:
70+
- `TypedDataSigner`
71+
- `NonceStore`
72+
- `PricingProvider`
73+
- `InventoryRiskCheck` placeholder
74+
- quote request/response validation:
75+
- address format
76+
- safe integer / bigint / decimal string amount handling
77+
- positive amount checks
78+
- TTL and expiry checks
79+
- chainId and verifyingContract binding
80+
- venue binding
81+
- keep EIP-712 typed-data generation compatible with `RFQAdapter`.
82+
- keep backend compliance as a non-goal; final compliance remains at fill time in `ExecutionRouter`.
83+
- local reference implementation:
84+
- in-memory nonce store
85+
- fixed/mock pricing provider
86+
- capture/mock signer for tests
87+
- tests for:
88+
- quote generation
89+
- invalid request rejection
90+
- unsafe number rejection
91+
- nonce uniqueness
92+
- typed-data shape compatibility
93+
94+
Acceptance criteria:
95+
96+
- `cd services/rfq && npm test` passes.
97+
- repo-level check includes the RFQ service test.
98+
- docs clearly state this is an SDK layer, not a production server.
99+
100+
## Phase 2 — Local reference example
101+
102+
Goal: show how an operator would wire the SDK without implying Corner Store operates the backend.
103+
104+
Deliverables:
105+
106+
- local-only example entrypoint under `services/rfq`.
107+
- mock pricing.
108+
- in-memory nonce.
109+
- test signer or local private-key signer clearly marked as non-production.
110+
- sample request/response for signed quote generation.
111+
112+
Non-goals:
113+
114+
- no hosted server.
115+
- no production key custody.
116+
- no market-making strategy.
117+
- no inventory management.
118+
- no compliance final decision.
119+
- no dashboard.
120+
121+
Acceptance criteria:
122+
123+
- a developer can run a local command to produce a signed quote payload compatible with `RFQAdapter`.
124+
- documentation explains which parts an operator must replace in production.
125+
126+
## Phase 3 — MVP demo backend
127+
128+
Goal: provide a demo backend that uses the RFQ SDK from a user's point of view.
129+
130+
This is separate from the SDK issue and should be implemented after Phase 1. If
131+
PR #29/#30 are merged first, this backend should reuse the live-Anvil demo
132+
runner and CLI configuration instead of creating another deployment/demo path.
133+
If PR #35 is merged first, the BUIDL-like asset should be the default regulated
134+
asset scenario for this demo backend.
135+
136+
Target demo flow:
137+
138+
```text
139+
user requests quote
140+
-> MVP backend calls RFQ SDK
141+
-> mock maker prices and signs quote
142+
-> user receives signed quote
143+
-> user submits through ExecutionRouter/RFQAdapter
144+
-> on-chain compliance passes or rejects
145+
-> UI/CLI shows result
146+
```
147+
148+
Potential deliverables:
149+
150+
- local HTTP API or CLI wrapper.
151+
- `/quote`-style request/response shape if HTTP is chosen.
152+
- BUIDL-like demo asset pair config.
153+
- integration guide for local Anvil/Foundry deployment.
154+
- optional later dashboard issue.
155+
156+
MVP backend non-goals:
157+
158+
- no production RFQ operator service.
159+
- no real market maker.
160+
- no real custody.
161+
- no production signer/key-management claims.
162+
- no backend-side compliance override.
163+
164+
Acceptance criteria:
165+
166+
- demo flow can generate a quote and settle it through the protected Router path.
167+
- success and compliance rejection cases are both visible.
168+
- documentation states that production operators must replace pricing, signer custody, nonce persistence and risk controls.
169+
170+
171+
## Documentation audit notes
172+
173+
This planning pass checked the product-spec index, roadmap, RFQ venue architecture,
174+
feature state, progress notes and open PRs #24, #28, #29, #30 and #35. The gaps
175+
found in current source-of-truth docs were:
176+
177+
- RFQ backend SDK work was not explicitly separated from production RFQ server operation.
178+
- MVP demo backend was not listed as a later application/demo layer built on the SDK.
179+
- near-term roadmap issues jumped from RFQ v1 settlement to production hardening, skipping the SDK and demo-backend bridge.
180+
- pending E2E/CLI/BUIDL PRs were not called out as context for future RFQ backend planning.
181+
182+
This document fills those gaps. Production RFQ hardening remains a separate track
183+
for dealer approval, custody, cancellation and partial-fill policy.
184+
185+
## Product boundary
186+
187+
RFQ backend responsibilities remain split:
188+
189+
| Area | Corner Store provides | Operator provides in production |
190+
| --- | --- | --- |
191+
| Quote format | SDK and tests | integration into their backend |
192+
| EIP-712 typed data | SDK | signer custody and policy |
193+
| Pricing | mock/reference only | actual pricing strategy |
194+
| Nonce | interface + in-memory demo | persistent nonce store |
195+
| Inventory/risk | placeholder interface | actual inventory and risk controls |
196+
| Compliance | on-chain final gate | optional precheck only |
197+
| Hosting | none | operator-owned infrastructure |
198+
199+
## First implementation issue
200+
201+
Recommended first issue:
202+
203+
```text
204+
feat(rfq): add TypeScript SDK interfaces for quote backend integration
205+
```
206+
207+
That issue should not implement the MVP backend. It should prepare the SDK foundation the MVP backend will use.

0 commit comments

Comments
 (0)