Skip to content

Core concepts

Architecture

A high-level map of how SatoriEx is put together. We share the shape of the system so you can reason about what guarantees you get; specific vendor and product choices are deliberately left out.

How to read this page

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โŒฌuserEdgeTLS ยท rate limit ยท geo ยท WAFGatewayrouting ยท healthWebuser-facing appAPIorders ยท balances ยท authMatcherprice-time priorityWorkerssettlement ยท notifications ยท scheduled jobsDBledger ยท markets ยท usersCache & Queuehot data ยท rate ยท order pipelineChainUSDC bridge ยท outcome tokensCustodial trade flowOn-chain bridge flow
High-level component diagram. Solid lines are custodial trade flow. Dashed lines are on-chain bridge flow.

Swipe left or right to see the full diagram.

The three layers

Each layer has a single job. Boundaries are explicit so any one piece can be replaced without touching the others.

Edge

Defends the perimeter

Terminates TLS, applies rate limits and geo rules, and forwards healthy requests to the Gateway. The Edge is the only public surface; everything behind it is private.

Core

Runs the application

The Web app serves the UI, the API authenticates requests and orchestrates business logic, the Matcher pairs buyers and sellers under price-time priority, and Workers handle settlement, notifications, and scheduled jobs. Each is a separate process so failures stay contained.

Data & Chain

Holds state and bridges to the chain

Balances and history live in the database as a double-entry ledger โ€” every change is a debit and a credit, never a one-sided write. A cache and queue sit in front for hot reads and the order pipeline. The blockchain is engaged only when funds enter or leave the system, or when a user wants self-custody.

How the API is layered inside

Inside the API server we follow a clean-architecture layout. Domain entities have zero dependencies on anything outside. Business logic depends only on domain. Transport (HTTP, events) and infrastructure (data stores, chain clients) depend on business logic, never the other way around.

Domain   โ”€โ”€โ–ถ   App           โ”€โ”€โ–ถ   Adapter             โ”€โ”€โ–ถ   Infra
entities       business logic       transport boundary         data stores
no imports     orchestration        request / response         DB ยท Cache ยท Queue ยท Chain

Dependencies point inward. The domain doesn't know that an HTTP server or a database exists.

Custodial vs self-custody

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.