Solver Node

Solver Node의 내부 아키텍처와 최적 실행 경로 탐색 메커니즘을 설명합니다.


Overview

Solver Node는 유동성 어그리게이터입니다. 하나의 Solver Node가 복수의 LP(Liquidity Provider)에게 호가를 수집하고, Cost Model로 최적 후보를 선별하여 네트워크에 제안합니다.

┌─────────────────────────────────────────────────────────────────────────┐
│  Solver Node                                                             │
│                                                                         │
│   Intent ──▶ ┌──────────────────────────────────────────────────────┐  │
│              │                                                      │  │
│              │  ┌──────────┐    ┌─────────────┐    ┌────────────┐  │  │
│              │  │ Quote    │───▶│  Liquidity  │───▶│ Cost Model │  │  │
│              │  │Collector │    │  Registry   │    │ (Scoring)  │  │  │
│              │  └──────────┘    └──────┬──────┘    └─────┬──────┘  │  │
│              │                         │                  │         │  │
│              │                  ┌──────┴──────┐     ┌────▼─────┐   │  │
│              │                  │    LPs      │     │  Ranked  │   │  │
│              │                  │             │     │Candidates│   │  │
│              │                  │ ┌────┐┌────┐│     └────┬─────┘   │  │
│              │                  │ │LP α││LP β││          │         │  │
│              │                  │ └────┘└────┘│          ▼         │  │
│              │                  │ ┌────┐      │   ┌────────────┐  │  │
│              │                  │ │LP γ│      │   │ Execution  │  │  │
│              │                  │ └────┘      │   │  Proposal  │  │  │
│              │                  └─────────────┘   └─────┬──────┘  │  │
│              │                                          │         │  │
│              └──────────────────────────────────────────┼─────────┘  │
│                                                         │            │
│                                                         ▼            │
│                                               Submit to Network      │
│                                                                      │
└─────────────────────────────────────────────────────────────────────────┘

Formal Definition


Module Architecture

Solver Node는 다음 모듈들로 구성됩니다:

Module
역할

Intent Gateway

Intent 수신, 유효성 검증 (통화쌍, 금액, TTL)

Quote Collector

등록된 LP들에게 병렬로 호가 요청 및 수집

Liquidity Registry

LP 정보 관리, 통화쌍별 적합 LP 매핑

Cost Model

수집된 호가를 다차원 비용 함수로 평가

Proposal Generator

최적 후보로 Execution Proposal 생성

Settlement Planner

Execution 확정 후 Settlement Plan 생성


Quote Collection

Solver Node는 등록된 LP들에게 병렬로 호가를 요청하고, 응답을 단일 후보 리스트로 병합합니다.

Collection Flow

설계 원칙:

원칙
설명

Graceful Degradation

일부 LP 응답 실패 시에도 나머지 결과로 진행

Timeout 관리

LP별 응답 제한시간 초과 시 해당 LP 결과 제외

Oracle 검증

모든 LP 호가는 Price Oracle 기준가 대비 검증


Cost Model

수집된 호가 후보들을 다차원 비용 함수로 평가하여 최적 후보를 선별합니다.

Scoring Formula

score낮을수록 우수한 후보입니다.

Scoring Example

Constraint Validation

Cost Model은 스코어링 외에 Intent의 constraints 위반도 탐지합니다:


Execution Proposal

Cost Model에서 최적 후보가 선택되면, Solver Node는 Execution Proposal을 생성하여 네트워크에 제출합니다.

Proposal Structure

Field
설명

proposalId

Proposal 고유 ID

validatorId

제출한 Solver Node (Validator) ID

intentId

원본 Intent ID

selectedQuote

선택된 LP 호가 정보

costModelScore

Cost Model 평가 점수

signature

Solver Node의 서명


Execution Pipeline

Intent 수신부터 네트워크 제출까지의 전체 파이프라인:


Next Steps

Last updated