Liquidity Engine
The Liquidity Engine is Encrypto's core technical moat. It's the system that enables users to spend any crypto asset at point of sale by handling real-time conversion, route optimization, and risk management.
What It Doesβ
In simple terms: the Liquidity Engine takes any supported crypto asset and converts it to USDC at the best available rate, fast enough to settle a card transaction within Visa's authorization window (~3 seconds).
This is harder than it sounds.
Architectureβ
ββββββββββββββββββββββββββββββββββββββββββββββββββ
β Liquidity Engine β
β β
β ββββββββββββββββ ββββββββββββββββββββββββ β
β β Price Oracle β β Liquidity Aggregatorβ β
β β (Multi-src) β β (Multi-DEX) β β
β ββββββββ¬ββββββββ ββββββββββββ¬ββββββββββββ β
β β β β
β ββββββββΌββββββββββββββββββββββββΌββββββββββββ β
β β Route Optimizer β β
β β βββββββββββ ββββββββββββ βββββββββββββ β β
β β β Direct β βMulti-Hop β β Cross-DEX β β β
β β β Swap β β Routes β β Split β β β
β β βββββββββββ ββββββββββββ βββββββββββββ β β
β ββββββββββββββββββββ¬ββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββΌββββββββββββββββββββββββ β
β β Risk Manager β β
β β β’ Slippage bounds β’ Pool depth check β β
β β β’ Price staleness β’ Impact analysis β β
β β β’ Execution timeout β’ Fallback logic β β
β ββββββββββββββββββββ¬ββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββΌββββββββββββββββββββββββ β
β β Execution Engine β β
β β Atomic swap + settlement in single tx β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββ
Price Oracleβ
The engine maintains a real-time price feed from multiple sources to prevent single-source manipulation:
- On-chain TWAP β Time-weighted average price from DEX pools (30s, 60s, 300s windows)
- Chainlink / Pyth β Oracle feeds for major pairs
- CEX reference β Binance/Coinbase spot prices for cross-validation
The final price is a confidence-weighted median across sources. If sources diverge by more than 0.5%, the engine flags the asset as potentially manipulated and widens the slippage buffer or skips the asset entirely.
Liquidity Aggregationβ
Rather than relying on a single DEX, the engine aggregates liquidity across multiple venues:
| DEX | Chains | Notes |
|---|---|---|
| Uniswap V3 | Base, Ethereum, Arbitrum | Concentrated liquidity, best for major pairs |
| Aerodrome | Base | Native Base DEX, deep USDC pools |
| Curve | Ethereum, Base | Optimized for stablecoin swaps |
| Raydium | Solana | Primary Solana DEX |
| Jupiter | Solana | Aggregator, multi-route |
For each swap, the engine queries all available venues and selects the route with the best effective price (swap output minus gas minus fees).
Route Optimizationβ
The optimizer evaluates three types of routes for every conversion:
Direct Swapβ
ETH β USDC on a single DEX. Simplest and fastest, used when a deep pool exists.
Multi-Hopβ
DOGE β WETH β USDC across two pools. Used when the direct pair has insufficient liquidity but intermediate pairs are deep.
Cross-DEX Splitβ
Split a large order across multiple DEXs to minimize price impact. A $10,000 ETH β USDC conversion might execute 60% on Uniswap and 40% on Aerodrome to get better aggregate execution.
The optimizer runs in under 100ms and selects the route with the lowest total cost (slippage + gas + fees).
Risk Managementβ
Every conversion is evaluated against a risk model before execution:
Slippage Controlβ
# Simplified slippage check
expected_output = amount * oracle_price
simulated_output = simulate_swap(dex, amount, route)
slippage = (expected_output - simulated_output) / expected_output
if slippage > MAX_SLIPPAGE: # 1.0%
reject_or_fallback()
Pool Depth Analysisβ
The engine checks that the swap amount won't move the pool price by more than 0.5%. For large transactions, this prevents front-running and excessive market impact.
Execution Timeoutβ
Card authorizations have a strict timeout. If the Liquidity Engine can't find and execute a route within 3 seconds, it falls back to the user's USDC balance. No conversion that takes longer than 3 seconds is executed.
Why This Mattersβ
Most crypto card products require users to manually convert assets before spending. This is like requiring someone to go to a currency exchange before every purchase abroad. It's a solved problem β the infrastructure just needs to be built.
Encrypto's Liquidity Engine makes crypto spendable the same way Visa makes foreign currency spendable: invisibly, instantly, at a fair rate.