Skip to main content

Hybrid Architecture

Why EMPX uses a Hybrid approach combining Off-Chain Quoting with On-Chain Execution.

The Hybrid Advantage

EMPX employs a hybrid architecture that leverages the best of both worlds: the speed and computational power of off-chain servers for finding the best routes, and the security and trustlessness of on-chain smart contracts for settling trades.

Comparison

FeatureHybrid (EMPX)Pure On-ChainTraditional Off-Chain
Price DiscoveryFast & Comprehensive (Off-chain)Limited by gas/block limitsAPI-based
RoutingComplex & Optimal (Off-chain)Simple paths onlyServer-side
ExecutionAtomic On-ChainAtomic On-ChainOften multi-step / Trusted
SecurityTrustless SettlementTrustless SettlementTrusted Relayers/Servers
CostGas Efficient (Computation off-chain)High Gas (Computation on-chain)Variable

Execution Model

FeatureEMPX Hybrid Approach
Routing EngineOff-chain servers analyze thousands of pools to find the absolute best price, performing complex calculations that would be too expensive to do on-chain.
SettlementOnce the route is found, the trade is executed on-chain via the EMPX Router. This ensures the swap is atomic (all or nothing) and user funds are never in custody of the server.
Failure HandlingIf the on-chain conditions (like slippage or balance) are not met during execution, the transaction reverts immediately, protecting the user.

Speed & Efficiency

FeatureEMPX Hybrid
Quote TimeMilliseconds (Off-chain indexers)
Execution TimeSingle block (Direct interaction with contracts)
Route FindingCan search deep and wide across many protocols without gas cost constraints.

Security

FeatureEMPX Hybrid
MEV ProtectionBuilt-in resistance via optimized routing and slippage protection.
CustodyNon-custodial. The off-chain server never touches user funds.
Trust ModelTrustless execution. You verify the transaction data before signing.