LazaiSwap
A custom oracle-based DEX developed by LazaiTrader for predictable trade execution.
Overviewβ
LazaiSwap is a purpose-built decentralized exchange that uses oracle pricing instead of traditional AMM mechanics.
| Property | Value |
|---|---|
| Type | Oracle-Based |
| Chain | Testnet (Development) |
| Status | π§ͺ Development |
LazaiSwap is currently deployed on testnets for development and testing. Production deployment is planned for future releases.
How Oracle-Based DEXs Workβ
Traditional AMM Approachβ
Price = Pool Ratio
βββ Changes with every trade
βββ Slippage based on trade size
βββ MEV opportunities exist
LazaiSwap Approachβ
Price = Oracle Value
βββ Set by trusted price feed
βββ Updated before trades
βββ Predictable execution
Key Featuresβ
Zero Slippage Executionβ
Trades execute at the exact oracle price:
| Aspect | AMM | LazaiSwap |
|---|---|---|
| Expected: $2,500 | β | β |
| Received: ~$2,475 | Possible | No |
| Slippage: ~1% | Possible | 0% |
MEV Protectionβ
No front-running or sandwich attacks:
- Price determined by oracle, not pool
- Trade order doesn't affect price
- Predictable outcomes
Oracle-Updated Pricingβ
Before each trade cycle:
- Fetch latest market price
- Update oracle value
- Execute trades at known price
Architectureβ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LazaiSwap DEX β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββββββ βββββββββββββββββββ β
β β Token A Pool β β Token B Pool β β
β β (e.g., ETH) β β (e.g., USDC) β β
β βββββββββββββββββββ βββββββββββββββββββ β
β β β β
β ββββββββββ¬ββββββββββββββββ β
β β β
β ββββββββββΌβββββββββ β
β β Oracle Prices β β
β β β β
β β ETHβUSDC: 2500 β β
β β USDCβETH: 0.0004β β
β βββββββββββββββββββ β
β β β
β ββββββββββΌβββββββββ β
β β swap(token, β β
β β amount) β β
β βββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
How Swaps Workβ
Price Settingβ
Before trades execute:
Oracle Owner calls:
setPrices(ethToUsdc: 2500, usdcToEth: 0.0004)
Swap Executionβ
When you swap:
1. Send 1 ETH to contract
2. Contract calculates: 1 Γ 2500 = 2500 USDC
3. Contract sends 2500 USDC to you
4. No slippage, exact calculation
Two-Way Pricingβ
Separate rates for each direction:
- ETH β USDC: Sell rate
- USDC β ETH: Buy rate
Allows for bid-ask spread if desired.
Liquidity Modelβ
Managed Liquidityβ
Unlike AMMs where anyone provides liquidity:
- Protocol manages token reserves
- Sufficient liquidity ensured
- No impermanent loss concerns
Liquidity Checkβ
Before swaps complete:
require(tokenOut.balanceOf(address(this)) >= amountOut,
"Insufficient liquidity");
If insufficient liquidity:
- Swap reverts
- Your tokens returned
- No partial fills
Integration with LazaiTraderβ
Trade Flowβ
1. Trigger Detected
βββ Price moved 10%+
2. Update Oracle
βββ Bot updates DEX prices from market data
3. Execute Swap
βββ SCW calls swap() on LazaiSwap
4. Predictable Result
βββ Exact amount based on oracle price
Price Synchronizationβ
The bot ensures LazaiSwap prices match market:
- Fetch current price from APIs
- Update oracle on DEX
- Execute trade immediately after
Advantagesβ
For Tradersβ
| Benefit | Description |
|---|---|
| Predictable costs | Know exactly what you'll receive |
| No MEV | Can't be front-run |
| Fair pricing | Market rate from oracle |
For Automated Tradingβ
| Benefit | Description |
|---|---|
| Accurate triggers | Trade at the price that triggered |
| Better PnL | No slippage eating profits |
| Simpler math | Exact calculations possible |
Current Statusβ
Testnet Deploymentsβ
| Network | Address | Status |
|---|---|---|
| Hyperion Testnet | 0x4704759E4a426b29615e4841B092357460925eFf | Active |
| Zircuit Testnet | 0x547c2aBf7b604BfB9FfD8fADd678Bc9d449A39cD | Active |
Production Plansβ
LazaiSwap may be deployed to mainnet when:
- Testing complete
- Liquidity secured
- Security audited
Comparison to AMMsβ
| Feature | LazaiSwap | HerculesDEX |
|---|---|---|
| Price source | Oracle | Pool ratio |
| Slippage | Zero | Variable |
| MEV risk | None | Possible |
| Liquidity | Protocol | Community |
| Best for | Predictability | Deep liquidity |
Security Considerationsβ
Oracle Trustβ
LazaiSwap relies on accurate oracle prices:
- Only trusted operators can update
- Prices verified against multiple sources
- Updates timestamped
Smart Contract Securityβ
Contract features:
- ReentrancyGuard protection
- SafeERC20 for token transfers
- Owner-only price setting
- Explicit token validation
FAQsβ
When will LazaiSwap be on mainnet?β
LazaiSwap is currently in development on testnets. Mainnet deployment timeline will be announced in our roadmap updates.
Can I provide liquidity to LazaiSwap?β
Currently, liquidity is protocol-managed. Community liquidity provisions may be enabled in future versions.
What if the oracle price is wrong?β
Multiple safeguards:
- Prices from multiple sources
- Deviation checks
- Regular updates
Further Readingβ
- DEX Overview - DEX concepts
- HerculesDEX - AMM comparison
- Security - Protection measures