> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/exchange/ko/overview/architecture.md).

# 아키텍처

Exchange를 구성하는 구성 요소와 현재 실행 중인 부분을 설명합니다.

Nexus Exchange는 **자체 매칭 엔진, 리스크 시스템, 오라클을 갖춘 중앙 지정가 오더북**입니다. 주문은 오더북에 대기하다가 가격·시간 우선 원칙에 따라 매칭되며, 거래소가 보관하는 증거금을 기준으로 정산됩니다. AMM이나 인텐트 매칭 프로토콜이 아니라 중앙화 파생상품 거래소와 같은 방식으로 작동합니다.

오더북, 매칭, 증거금, 청산 로직은 **Exchange 엔진의 기본 구성 요소**이며, 체인에 배포된 스마트 컨트랙트가 아닙니다. 이 설계 덕분에 거래소는 CEX 수준의 주문 확인(acknowledgement) 지연 시간을 목표로 할 수 있고, 트레이더와 애플리케이션은 하나의 API로 이 모든 기능에 접근합니다.

## 구성 요소

네 가지 구성 요소가 작업을 수행합니다. 각 구성 요소는 하나의 책임을 맡으며, 이 섹션에 별도 페이지가 있습니다.

```mermaid
flowchart LR
  C[Clients — traders, market makers] --> API[API<br/>REST + WebSocket]
  API --> ME[Matching Engine<br/>order books, matching, fills]
  API --> RE[Risk Engine<br/>margin, liquidations, funding]
  ME <--> RE
  OR[Oracle<br/>mark and index prices] --> RE
  OR --> ME
```

| 구성 요소      | 담당 영역                                                                     | 문서 위치                                                                                                                                                                                         |
| ---------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **API**    | 모든 입출력 경로: 주문 입력, 취소, 수정, 계정 및 시장 조회, WebSocket 스트림. 자체 거래 상태는 보유하지 않습니다. | [API 및 요청 한도](/exchange/ko/apis-and-rates/apis-and-rates.md), [API 레퍼런스](https://docs.nexus.xyz/api-reference)                                                                                |
| **매칭 엔진**  | 오더북, 가격·시간 우선 매칭, 그리고 매칭에서 발생하는 체결.                                       | [주문 유형](/exchange/ko/trading/trading/perpetuals/order-types.md), [가격 발견 범위](/exchange/ko/trading/trading/perpetuals/discovery-bounds.md)                                                      |
| **리스크 엔진** | 증거금, 청산, 자동 디레버리징, 펀딩, 보험 기금.                                             | [증거금](/exchange/ko/trading/trading/perpetuals/margining.md), [청산](/exchange/ko/trading/trading/perpetuals/liquidations.md), [펀딩 비율](/exchange/ko/trading/trading/perpetuals/funding-rates.md) |
| **오라클**    | 증거금, 펀딩, 청산 계산의 기준이 되는 지수 가격과 마크 가격.                                      | [가격 오라클](/exchange/ko/trading/trading/perpetuals/price-oracles.md)                                                                                                                            |

이 설계의 두 가지 특성은 트레이더가 보게 될 동작을 설명해 줍니다.

**매칭 엔진과 리스크 엔진은 양방향으로 통신합니다.** 리스크 엔진은 오더북을 관찰하기만 하지 않고 직접 작용합니다. 계정이 유지 증거금을 밑돌거나 오라클 변동으로 트리거가 발동되면, 리스크 엔진은 포지션 종료 주문을 제출하고 대기 중인 주문을 취소합니다. 따라서 직접 제출하지 않은 체결이 계정에 나타날 수 있습니다. [청산](/exchange/ko/trading/trading/perpetuals/liquidations.md)을 참조하십시오.

**오라클 업데이트는 가격을 기록하는 데 그치지 않습니다.** 마크 가격을 움직여 트리거를 발동하고 청산 스캔을 유발합니다. 따라서 조용한 시장에서도 새 주문이 들어오지 않았는데 트리거 주문과 청산이 한꺼번에 발생할 수 있습니다.

## 현재 실행 중인 부분

|             |                                                                 |
| ----------- | --------------------------------------------------------------- |
| 매칭, 증거금, 청산 | Exchange 엔진 내부                                                  |
| 담보          | 테스트넷에서는 포셋이 지급하는 합성 USDX. 실제 USDX는 Ethereum의 입금 브리지를 통해 입출금될 예정 |
| 시장          | USDX로 호가가 표시되고 증거금이 운용되는 무기한 선물. 상장 목록은 `GET /markets`가 기준      |

**현재 거래하는 거래소는 이 엔진입니다.** 위의 구성 요소는 엔진을 이루는 부분이며, [요청 및 연결 한도](/exchange/ko/apis-and-rates/apis-and-rates/rate-limits.md)에 연동에 적용되는 수치가 나와 있습니다.

그 밖의 모든 내용은 거래소에 대한 설명이 아니라 로드맵입니다. [로드맵](https://docs.nexus.xyz/exchange-layer-1/overview/roadmap)을 참조하십시오. 이 페이지의 어떤 내용도 특정 일자를 약속하지 않습니다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nexus.xyz/exchange/ko/overview/architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
