跳到内容

核心概念

系统架构

SatoriEx 整体构成的高层次架构图。我们分享系统的整体形态,让您可以推断所获得的保证;刻意省略了具体的供应商和产品选择。

如何阅读本页

Three layers. The Edge handles security and routing. The Core runs the application and matching logic. Data & Chain stores balances and history, with a public-blockchain bridge for deposits, withdrawals, and (planned) self-custody. Most trades complete entirely inside the Core; only deposits and withdrawals touch the chain.
EDGECOREDATA & CHAIN用户边缘层TLS · 频率限制 · 地理 · WAF网关路由 · 健康检查Web面向用户的应用API订单 · 余额 · 身份验证撮合引擎价格优先、时间优先工作进程结算 · 通知 · 定时任务数据库账本 · 市场 · 用户缓存与队列热数据 · 频率限制 · 订单管道区块链USDC 桥接 · 结果代币托管交易流链上桥接流
高层次组件图。实线为托管交易流。虚线为链上桥接流。

Swipe left or right to see the full diagram.

三层架构

每一层只负责单一职责。边界明确,因此任何一个组件都可以在不影响其他组件的情况下被替换。

边缘层

防御外围

终止 TLS、应用频率限制和地理规则,并将健康请求转发到网关。边缘层是唯一的公开接口;其后的一切均为私有。

核心层

运行应用程序

Web 应用提供 UI,API 对请求进行身份验证并协调业务逻辑,撮合引擎按价格优先、时间优先配对买卖双方,工作进程处理结算、通知和定时任务。每个组件都是独立进程,因此故障保持隔离。

数据与链层

存储状态并桥接区块链

余额和历史作为复式账本存储在数据库中——每次变更都有借记和贷记,从不进行单方向写入。缓存和队列位于前端用于热读和订单管道。只有资金进出系统或用户需要自托管时才涉及区块链。

API 内部的分层方式

在 API 服务器内部,我们遵循整洁架构布局。领域实体对外部没有任何依赖。业务逻辑只依赖领域。传输层(HTTP、事件)和基础设施层(数据存储、链客户端)依赖业务逻辑,反之则不然。

Domain   ──▶   App           ──▶   Adapter             ──▶   Infra
entities       business logic       transport boundary         data stores
no imports     orchestration        request / response         DB · Cache · Queue · Chain

依赖关系指向内部。领域层不知道 HTTP 服务器或数据库的存在。

托管 vs 自托管

Custodial trading is fast and free of per-trade gas: matching and the ledger live inside the Core. Linking an external wallet today gives you an on-chain deposit/withdrawal path — your USDC moves between the wallet and the SatoriEx ledger across the chain, and a gas fee applies on each move. Trading itself still runs inside the Core in either case. A full self-custody trading mode — where outcome shares are represented on-chain as ERC-1155 CTF tokens during the position — is on the roadmap (see Contracts and Changelog); it is not active today.