Conversion & FX Engine
The Conversion & FX Engine is the core component that ensures Epay users can move seamlessly between currencies—both fiat and stablecoins—at predictable and fair rates. Inspired by the Stellar SEP-38 standard for cross-asset quotes, the engine is designed to provide transparent pricing, minimize volatility exposure, and deliver reliable settlement across multiple liquidity sources.
Pricing Methodology
Epay determines cross-currency rates through a layered approach:
Real-Time Quotes
The system continuously aggregates live FX rates from multiple providers.
Users are shown the “all-in” rate (inclusive of fees and spreads) at the moment of initiating a transaction.
Locked Rate Execution
Once the user confirms, the quoted price is locked for a limited settlement window (e.g., 1–2 minutes).
This prevents users from being exposed to sudden FX swings during transaction finalization.
Conversion Path
Fiat → Stablecoin (via custodial partners, banks, or on-ramp APIs).
Stablecoin → Stablecoin (via on-chain liquidity pools or cross-chain swaps).
Stablecoin → Fiat (via off-ramp partners or direct settlement rails).
Data & Liquidity Sources
To maintain accuracy and liquidity depth, Epay’s FX engine integrates across:
Decentralized Oracles (e.g., Chainlink FX feeds, Pyth Network) for transparent pricing data.
On-Chain Liquidity Providers (AMMs like Uniswap, Curve, or specialized stablecoin DEXs).
Centralized Market Makers & Banks for bulk liquidity and regional FX coverage.
Epay Internal Order Book for routing flows efficiently across sources and capturing spread.
Flow of Execution
Quote Request → User initiates a transfer and requests a rate.
Quote Response → Engine returns a firm rate with spread/fees baked in.
Rate Lock → User accepts, system locks rate for defined window.
Conversion Execution → Stablecoin ↔ Fiat conversion completes at locked rate.
Settlement → Funds move through Epay’s settlement layer to destination currency.
Spread, Fees & Slippage Management
Spread Model: Epay applies a small spread on top of wholesale FX to cover risk and ensure profitability.
Transparent Fees: Transaction breakdown shows FX spread, network fees, and service fee (if any).
Slippage Controls:
Pre-trade slippage thresholds enforced at quote level.
If liquidity shifts outside tolerance during execution, the transaction is either re-quoted or auto-refunded.
Dynamic Routing: Smart routing logic ensures the lowest-cost and deepest-liquidity path is chosen for each trade.
Key Benefits
User Certainty: Locked-in rates prevent last-minute surprises.
Transparency: Users see exactly how rates are derived and fees applied.
Resilience: Multiple liquidity backstops ensure uptime across volatile markets.
Efficiency: Automated routing minimizes cost per transaction at scale.
Last updated