Architecture
This page is a map of the components inside MetaFlux Core and how they connect.
This page names each major component inside MetaFlux Core, the L1. For each one, it gives a short description and a link to the page that explains it in full. Each linked page shows the status of its component (stable / preview / planned).
Summary
MetaFlux Core is one deterministic state machine that runs a fully on-chain exchange. Every participant sends actions. Consensus puts those actions in one canonical order. Then every node runs the same state transition over that order. The state machine is a set of components that work together:
- a matching engine that runs the order books;
- a clearinghouse that keeps the accounts;
- a pricing layer: oracle, mark and funding;
- a risk layer: margin and liquidation;
- an economics layer: fees, staking and token supply;
- extension layers: vaults, permissionless market deploy, an inline EVM and a cross-chain bridge.
Component layers
All layers sit on top of consensus. Consensus decides what happened and in what order. The trading core decides what that means for balances and positions. The pricing and risk layers value and protect those positions. The extension layers add markets, programmability and cross-chain value.
Trading core
The trading core is the order books that match orders and the ledger that settles them.
| Component | What it does | Learn more |
|---|---|---|
| Clearinghouse | The accounting core. It tracks the balances, open positions, collateral, realized and unrealized PnL, and margin usage of every account, across perps and spot. Every fill, funding payment and liquidation is a write to this ledger. | Perpetuals · Spot |
| Matching engine (on-chain CLOB) | The central limit order book and its deterministic matching. Resting limit orders, market and IOC/FOK fills, post-only and the other time-in-force rules all match against one stream in consensus order. The same inputs always produce the same fills. | Order types · FBA |
| Order types and trading features | The order and account tools on top of matching: TWAP and scale orders, TP/SL trigger orders, reduce-only, hedge (two-way) mode, sub-accounts, agent wallets and multi-sig accounts for institutions. | Order types · Hedge mode · Sub-accounts · Agent wallets · Multi-sig · RFQ |
Pricing and risk
These components value positions and keep accounts solvent.
| Component | What it does | Learn more |
|---|---|---|
| Oracle price feed | The reference price per asset that the protocol uses for each market. It is a spot price that validators aggregate, so no single source controls it. It anchors the mark price and is an input to risk calculations. | Oracle prices |
| Mark price + funding | The mark price is the value for margin, liquidation and triggers. It resists manipulation. It is built from the oracle, the book and external references, not from the last trade. Funding is the periodic payment between longs and shorts that keeps each perp near its underlying. Traders pay it directly to each other. | Mark prices · Funding rates |
| Margin system | Sets how much collateral each position needs, and whether collateral is shared or kept separate. It covers cross and isolated margin, cross-asset portfolio margin (SPAN-style) for large accounts, and spot-margin borrowing that the Earn lending pool supplies. | Margin modes · Portfolio margin · Spot margin · Earn |
| Liquidation | Keeps accounts solvent when the margin of a position runs out. A tiered ladder unwinds positions in steps: first a warning, then partial reductions, not one full close. Auto-deleverage is the last backstop. | Tiered liquidation · ADL |
Economics
These components are the fee mechanics and the token.
| Component | What it does | Learn more |
|---|---|---|
| Fee engine | Computes the fee on every fill: maker/taker tiers by volume, maker rebates, staking discounts, builder and referrer credits, and separate spot and liquidation fees. It also sets where collected fees go. | Fees · Fee schedule |
| Tokenomics | The MTF token: supply, emissions, the buyback and burn that fees fund, and how value accrues. Staking rewards and governance weight both depend on it. | Tokenomics |
Consensus and governance
Consensus is the base that every other component runs on. Governance changes its parameters.
| Component | What it does | Learn more |
|---|---|---|
| Consensus (MetaFluxBFT) | The Byzantine-fault-tolerant Proof-of-Stake protocol. It puts every transaction into one canonical chain. A committed block is final, with no reorgs and no probabilistic confirmations. This total order makes fair on-chain matching possible. | Consensus |
| Staking | The Proof-of-Stake layer. Delegators stake MTF to back validators, earn rewards, and share the slashing and jailing risk. Stake sets the validator set and the voting power of each validator. | Staking |
| Governance | Changes protocol parameters, such as fee, risk and market parameters, and new market listings. A stake-weighted validator vote enacts each change, not a single operator. The change commits through the chain like any other state change. | Consensus · Improvement proposals |
Extensibility
These components add pooled strategies and new markets.
| Component | What it does | Learn more |
|---|---|---|
| Vaults (metaliquidity) | Vaults that depositors fund and a whitelisted operator runs. The protocol's own vault is the insurance and backstop pool. In a community vault, depositors pool capital into a strategy that a designated operator runs. They share profit and loss pro-rata by shares. | Vaults · MIP-2 metaliquidity |
| Permissionless market deploy | Anyone who meets the requirements can list new markets: spot tokens and pairs, and builder-deployed perp markets. No gatekeeper approves them. On-chain safeguards apply. | MIP-3 permissionless perp deploy · MIP-1 spot deploy |
Cross-chain and EVM
These components add programmability and move value into and out of Core.
| Component | What it does | Learn more |
|---|---|---|
| EVM execution layer | An inline EVM that runs ordinary Solidity contracts as part of every consensus block, with the same finality as Core. Contracts read Core state through system precompiles and send Core actions through a system contract. Value moves between Core and the EVM through dedicated transfer paths. | EVM overview · Execution model · Interacting with Core · Core ↔ EVM transfers |
| MetaBridge | The custody bridge that validators co-sign, for deposits and withdrawals across chains (Base first, then more). A contract on the source chain holds custody. A co-signature from validators with two-thirds of the stake releases funds after a dispute window. The trust assumption is the same as the chain's, and there is no admin key. | Bridge |
An order through Core
This trace shows how the components connect for one perp order:
- You send a signed order, directly or through an agent wallet.
- Consensus gives it a fixed position in the canonical order.
- The matching engine matches it against the book and produces fills.
- The clearinghouse updates your position and balance, and the fee engine charges the fill.
- After that, the mark price values your position. The position pays or receives funding and uses margin.
- If the margin runs out, tiered liquidation starts, with ADL as the backstop.
Every node runs steps 3–6 in the same way over the same ordered input. Thus the exchange stays in exact agreement without trust in any single node.
See also
- Start here: an introduction for new users.
- Products: the tradeable markets (perpetuals, spot, spot margin).
- Concepts: all the mechanism pages.
- Consensus (MetaFluxBFT): the base for order and finality.
- Glossary: a definition of every protocol-specific term.