Skip to content

36 featrfq add typescript sdk interfaces for quote backend integration#37

Merged
0xMuang merged 2 commits into
mainfrom
36-featrfq-add-typescript-sdk-interfaces-for-quote-backend-integration
Jul 14, 2026
Merged

36 featrfq add typescript sdk interfaces for quote backend integration#37
0xMuang merged 2 commits into
mainfrom
36-featrfq-add-typescript-sdk-interfaces-for-quote-backend-integration

Conversation

@0xMuang

@0xMuang 0xMuang commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

RFQ backend를 바로 서버로 제공하기 전에, integrator가 자신의 RFQ quote backend를 쉽게 만들 수 있도록 services/rfq를 TypeScript SDK 레이어로 확장했습니다.

이번 PR은 RFQ backend 자체를 운영/호스팅하는 작업이 아니라, 이후 MVP demo backend와 production backend가 공통으로 사용할 quote 생성 SDK 기반을 만드는 작업입니다.

What changed

  • services/rfq에 high-level RFQ quote API를 추가했습니다.

    • createRFQService(...).quote(...)
    • taker, token, amount, venue 정보를 넣으면 RFQAdapter와 호환되는 signed quote를 생성합니다.
  • RFQ backend에서 교체 가능해야 하는 책임을 interface로 분리했습니다.

    • signer
    • nonce store
    • pricing provider
    • inventory/risk check
  • 로컬 개발과 테스트용 reference 구현을 추가했습니다.

    • InMemoryNonceStore
    • FixedRatePricingProvider
    • NoopInventoryRiskCheck
  • quote 입력 validation을 강화했습니다.

    • unsafe JavaScript number 거부
    • invalid address 거부
    • invalid TTL / uint 값 거부
  • on-chain RFQAdapter nonce 구조에 맞춰 기본 nonce store를 maker-scoped로 맞췄습니다.

  • 문서와 테스트를 업데이트했습니다.

    • services/rfq/README.md
    • RFQ SDK / MVP demo backend product spec
    • roadmap / progress / testing docs
    • RFQ smoke test 확장

Why

RFQ는 maker가 off-chain에서 가격을 계산하고 quote에 서명한 뒤, taker가 on-chain ExecutionRouter / RFQAdapter를 통해 체결하는 구조입니다.

따라서 Corner Store가 production RFQ 서버를 직접 제공하기보다는, 각 운영자/integrator가 자신의 signer, pricing, nonce, risk policy를 꽂아서 backend를 만들 수 있는 SDK 형태가 더 적절합니다.

Not included in this PR

  • MVP용 HTTP RFQ demo backend
  • production signer / KMS 연동
  • persistent nonce store
  • real pricing / inventory system
  • partial fill, custody, advanced cancellation policy

위 항목들은 후속 feature에서 다루는 범위로 남겨두었습니다.

Verification

  • cd services/rfq && npm test
  • scripts/check.sh
  • git diff --check

All passed.

0xMuang added 2 commits July 14, 2026 16:18
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
Promote services/rfq from a minimal quote signer into a TypeScript SDK layer with a high-level quote API, validation helpers, replaceable signer/nonce/pricing/risk seams, and local reference components.

Constraint: RFQAdapter tracks quote nonce usage by maker, so the default in-memory nonce store must be maker-scoped.

Rejected: Adding an HTTP/backend server in this issue | would blur the SDK layer with the later MVP demo backend and production operator responsibilities.

Confidence: high

Scope-risk: moderate

Directive: Keep production pricing, signer custody, persistent nonce storage, inventory risk, hosting, and backend compliance prechecks as integrator/operator responsibilities.

Tested: cd services/rfq && npm test; scripts/check.sh; git diff --check

Not-tested: MVP HTTP/CLI backend, production signer/KMS integration, persistent nonce store, real pricing/inventory systems
@0xMuang 0xMuang linked an issue Jul 14, 2026 that may be closed by this pull request
@0xMuang
0xMuang merged commit 391468d into main Jul 14, 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.

feat(rfq): add TypeScript SDK interfaces for quote backend integration

1 participant