Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ jobs:
with:
version: stable

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: services/rfq/package-lock.json

- name: Check formatting
run: forge fmt --check

Expand All @@ -33,3 +40,9 @@ jobs:

- name: Run tests
run: forge test -vv

- name: Run RFQ service smoke
working-directory: services/rfq
run: |
npm ci
npm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
out/
cache/
broadcast/
services/rfq/dist/
services/rfq/node_modules/
17 changes: 12 additions & 5 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Execution Integration Kit로 구성한다. Corner Store reference DEX는 이 공

| 경로 | 역할 |
| --- | --- |
| `src/` | 제품 Solidity 컨트랙트. 현재 Counter scaffold 상태 |
| `src/` | 제품 Solidity 컨트랙트: Compliance Core, Execution Integration Kit, reference adapters |
| `test/` | Foundry 단위·통합 테스트 |
| `script/` | Foundry 배포·운영 스크립트 |
| `docs/` | 제품 명세, 아키텍처, 로드맵과 Harness 문서 |
| `services/rfq/` | RFQ v1 quote signer reference service |
| `tools/deploy-v3/` | 독립적으로 유지하는 vendored Uniswap v3 배포 도구 |
| `lib/` | Foundry 의존성 |
| `scripts/` | 저장소 setup, 검증과 정리 명령 |
Expand Down Expand Up @@ -84,6 +84,13 @@ SDK와 reference DEX의 전체 실행 흐름은 제품 명세에, 세부 책임
## Where to Add New Code

제품 코드는 Compliance Core, Execution Integration Kit와 Corner Store reference
Adapter/configuration의 의존 방향이 드러나게 구성한다. 정확한 Solidity 디렉터리는
Foundation feature에서 확정하며, 기존 Counter scaffold를 제품 구조로 간주하지
않는다.
Adapter/configuration의 의존 방향이 드러나게 구성한다.

- 공통 compliance interface/type/library는 `src/interfaces`, `src/types`,
`src/libraries`에 둔다.
- compliance 구현은 `src/compliance`와 `src/registry`에 둔다.
- Router/venue registry/selector와 공통 adapter interface는 `src/execution`에 둔다.
- 구체 reference venue adapter는 `src/execution/adapters/<venue>/`에 둔다.
- RFQ offchain quote signer reference는 `services/rfq`에 둔다.
- production dealer, custody, matching, pricing engine은 별도 decision/feature 없이
reference adapter 내부에 섞지 않는다.
39 changes: 36 additions & 3 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ passing

### Behavior

- Counter template를 제품 개발 구조로 교체한다.
- Foundry template를 제품 개발 구조로 교체한다.
- 제품 interface, type, error와 mock fixture를 컴파일할 수 있다.
- 이후 compliance와 execution feature가 재사용할 테스트 기반을 제공한다.

Expand All @@ -77,8 +77,41 @@ passing

### State

not-started
passing

### Notes

- 현재 제품 구조는 Compliance Core, Execution Integration Kit, reference adapters와
Foundry unit/integration fixture를 포함한다.
- production Manifest lifecycle, RFQ dealer/custody, OrderBook은 별도 feature다.

## RFQ-001 — Reference RFQ Settlement

### Behavior

- RFQ가 AMM과 같은 `ExecutionRouter`/Adapter slot에 등록·교체될 수 있다.
- RFQ quote는 maker가 EIP-712로 서명하고 chainId, RFQAdapter, maker, taker,
token, amount, venue, nonce, expiry에 바인딩된다.
- RFQAdapter는 Router-only로 동작하고 direct adapter bypass를 거부한다.
- 매 fill은 Router의 최신 compliance evaluation 이후 full-fill/exact-taker로만
settlement된다.
- reference TypeScript service는 quote 생성, expiry/nonce 부여, EIP-712 signing
요청만 담당한다.

### Verification

- `forge fmt`
- `forge build`
- `forge test --offline --match-path test/unit/execution/RFQAdapter.t.sol -vv`
- `forge test --offline`
- `cd services/rfq && npm test`
- `git diff --check`

### State

passing

### Notes

- DOC-001에서 제품 구조와 구현 순서를 확정한 뒤 시작한다.
- Non-goals: partial fill, orderbook, production pricing engine, dealer inventory,
custody 확장, websocket/order discovery.
60 changes: 29 additions & 31 deletions PROGRESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

## Current Status

저장소는 SDK/reference DEX 아키텍처·개발 계획 문서, Foundry Counter scaffold와
vendored Uniswap v3 배포 도구를 포함한다. 제품 Solidity 컨트랙트는 아직 구현되지
않았다.
저장소는 SDK/reference DEX 아키텍처·개발 계획 문서, Foundry product scaffold,
reference execution contracts와 vendored Uniswap v3 배포 도구를 포함한다.

공식 문서는 DEX-level compliance SDK, Corner Store reference DEX,
Element/Recipe/Manifest/Operator 4-Layer와 cumulative multi-Recipe 모델을
Expand All @@ -13,55 +12,54 @@ source of truth로 사용한다.
## Active Feature

- 없음
- 다음 작업은 `FND-001 — Foundry Product Foundation`이다.

## Completed

- `HE-001 — Harness Baseline`
- `DOC-001 — Imported Architecture Alignment`
- `FND-001 — Foundry Product Foundation`
- `RFQ-001 — Reference RFQ Settlement`
- multi-venue 아키텍처와 책임 문서 작성
- Corner Store용 Uniswap v3 최소 배포 profile 분리와 테스트
- ExecutionRouter/VenueRegistry/VenueSelector와 AMM reference adapter skeleton

## Blocked

- 없음

## Next

1. `FND-001 — Foundry Product Foundation`의 Exec Plan을 작성한다.
2. Compliance Core, Execution Integration Kit와 Corner Store reference Adapter의
디렉터리·의존 방향을 확정한다.
3. 공통 context, interface, error와 mock fixture를 구현한다.
4. stateful Element commit hook과 acquisition data source는 구현 전에 별도 결정한다.
1. RFQ production hardening은 별도 feature로 분리한다: dealer/operator approval,
custody, quote cancellation, partial fill 정책.
2. production Asset Compliance Manifest lifecycle/schema와 operator approval flow를
구현한다.
3. acquisition/lot data source와 holding-period Recipe 활성화 조건을 결정한다.
4. live Anvil deployment/E2E와 security threat model을 추가한다.
5. Order Book은 matching/custody/surveillance 모델 결정 후 구현한다.

## Last Session Summary

- 변경한 파일:
- 제품 baseline, root architecture와 README
- 4-Layer compliance, Asset Manifest, execution/venue 책임 문서
- 구현 roadmap, decisions, security와 testing 기준
- DOC-001 Exec Plan과 Harness 상태 문서
- review에서 확인된 pair 평가, SDK/reference DEX 경계와 provenance 문제 수정
- RFQAdapter, RFQQuote type, RFQ-specific errors
- RFQAdapter Foundry tests
- `services/rfq` 최소 TypeScript quote signer reference
- RFQ v1 scope/non-goals 문서
- 실행한 명령:
- current 문서 legacy 용어 검색
- Markdown 로컬 링크 검사
- `forge build`
- `forge test --offline --match-path test/unit/execution/RFQAdapter.t.sol -vv`
- `cd services/rfq && npm test`
- `git diff --check`
- `scripts/check.sh`
- 통과한 검증:
- current 문서에서 이전 architecture terminology와 pending migration 표현 제거
- 비커밋 입력 경로에 대한 current 문서 직접 의존 제거
- 로컬 Markdown 경로 29개 파일 확인
- policy plugin과 execution Adapter plugin 경계 교차 검토
- mixed pair와 regulated-regulated pair의 양쪽 Manifest 평가 규칙 확인
- `forge fmt --check`
- `forge build`
- Foundry Counter 테스트 2개
- `tools/deploy-v3` 테스트 10개
- `git diff --check`
- RFQAdapter compile
- valid signed quote settlement
- invalid signature, expired quote, replay, wrong taker, mismatch, direct bypass,
compliance rejection 거부
- RFQ service typed-data/smoke check
- 전체 repo check 통과
- 남은 리스크:
- 제품 Solidity는 Counter template 상태다.
- CI, 제품 integration/E2E와 정적 분석이 아직 없다.
- acquisition data, stateful Element commit hook과 reject logging은 열린 결정이다.
- production dealer approval, custody, quote cancellation, partial fill은 RFQ v1
범위 밖이다.
- production Manifest lifecycle과 acquisition/lot source는 아직 결정·구현 전이다.
- live deployment/E2E와 static analysis는 아직 부족하다.
- production Element와 engine 허용 조건은 법률 승인 전 활성화할 수 없다.
- concrete Adapter는 reference DEX 소유이고 generic Router/Adapter 경계는 SDK
소유라는 구조를 구현 디렉터리에 반영해야 한다.
13 changes: 7 additions & 6 deletions QUALITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

| Module | Grade | Reason | Required Improvement |
| --- | --- | --- | --- |
| Product documentation | B | SDK/reference DEX, 4-Layer와 roadmap이 정합함 | 개별 Element·Manifest schema와 법률 승인 보강 |
| Harness / agent workflow | B | HE-001과 DOC-001 상태·검증 이력이 존재함 | CI 연계와 구현 feature 운영 검증 |
| Product Solidity | D | Counter template만 존재 | FND-001 제품 foundation 구현 |
| Foundry tests | D | Counter template test만 존재 | 제품 fixture와 behavior test 추가 |
| Product documentation | B | SDK/reference DEX, 4-Layer, RFQ v1 scope와 roadmap이 대체로 정합함 | production RFQ/OrderBook, Manifest lifecycle와 법률 승인 기준 보강 |
| Harness / agent workflow | B | HE-001, DOC-001, RFQ-001 상태·검증 이력이 존재함 | PR/CI 결과와 feature state 지속 동기화 |
| Product Solidity | B- | Compliance Core, registries, ExecutionRouter, AMM adapter와 RFQ v1 adapter가 컴파일·테스트됨 | production Manifest lifecycle, RFQ dealer/custody/cancel, OrderBook 미구현 |
| Foundry tests | B | unit/integration 122개와 RFQ failure-path 테스트 존재 | live Anvil deployment/E2E와 추가 adversarial/security tests |
| RFQ reference service | B- | EIP-712 typed-data 생성, nonce/expiry, unsafe number guard와 smoke test 존재 | 실제 API 서버, signer custody, dealer pricing/inventory는 production feature에서 결정 |
| `tools/deploy-v3` | B | profile 단위 테스트와 문서 존재 | 자동 Anvil integration test 추가 |
| CI / static analysis | D | CI와 정적 분석 설정 없음 | 향후 foundation feature에서 추가 |
| Security documentation | B | trust boundary와 구현 전 보안 규칙을 통합 문서화함 | 구현 및 위협 모델과 지속 동기화 |
| CI / static analysis | C | GitHub Actions가 Foundry와 RFQ service smoke를 실행함 | deploy-v3 CI, slither 등 정적 분석, warning budget 도입 |
| Security documentation | B | trust boundary, direct venue boundary와 구현 전 보안 규칙을 문서화함 | RFQ/dealer/custody 위협 모델과 production review 체크리스트 보강 |

## Grade Guide

Expand Down
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ are registered through a generic Router/Adapter boundary. Concrete Corner Store
adapters and deployment configuration are reference implementations.

The repository currently contains the architecture and development plan, a
vendored Uniswap v3 deployment tool, and the initial Foundry project scaffold.
Product Solidity contracts are not implemented yet.
vendored Uniswap v3 deployment tool, the Foundry product scaffold, and initial
reference execution adapters including AMM and RFQ settlement paths.

## Main Use Cases

Expand Down Expand Up @@ -49,14 +49,16 @@ Product Solidity contracts are not implemented yet.
- Contracts: Solidity + Foundry
- Tests: Forge
- Local chain: Anvil
- RFQ reference service: TypeScript
- Vendored deployment tooling: TypeScript, Yarn, ethers v5

## Local Setup

Required tools:

- Foundry (`forge`, `anvil`)
- Node.js and Yarn for `tools/deploy-v3`
- Node.js and npm for `services/rfq`
- Yarn for `tools/deploy-v3`

Install or refresh the vendored tool dependencies when needed:

Expand All @@ -67,8 +69,9 @@ yarn install --frozen-lockfile

## Development Commands

The product contracts use Foundry. The template `Counter` files remain only
until Roadmap Phase 0 replaces them with the product structure and fixtures.
The product contracts use Foundry. The current scaffold contains the Compliance
Core, Execution Integration Kit, AMM reference adapter, RFQ v1 reference
settlement adapter, and related fixtures/tests.

### Build

Expand All @@ -94,6 +97,20 @@ forge fmt
anvil
```

### RFQ Reference Service

`services/rfq` is a minimal quote signer reference for RFQ v1. It builds the
same EIP-712 typed data that `RFQAdapter` verifies, assigns expiry and nonce,
and returns a signed quote. It is not a production dealer, pricing engine,
inventory manager, custody service, websocket feed, orderbook, or compliance
decision engine.

```shell
cd services/rfq
npm ci
npm test
```

### Check All

```shell
Expand Down
Loading
Loading