Skip to main content
Architecture
The Lemon Trading Engine is built on the SyntheticPerpetualWithVmarkets smart contract, designed for performance and security.
1. Frontend (UI)
The interface you interact with. It handles:
- Wallet connection.
- Data visualization (Charts, Tables).
- Transaction preparation.
2. Execution Layer (API)
When you submit an order, our API:
- Validates your request (margin, leverage, asset).
- Simulates the transaction to ensure it will succeed.
- Constructs the transaction data.
- Sends it back to your wallet for signature.
3. Smart Contracts (Onchain)
The core logic is modular and distributed across several key contracts on the Base blockchain:
- SyntheticPerpetualRouter: The primary user entry point for orchestrating trades.
- MarketManager: The Brain that manages the registry of markets and coordinates the payout waterfall.
- PositionManager: An ERC-721 contract that manages the position lifecycle and NFT encapsulation.
- Vault: The liquidity layer managing the Buffer Pool and Insurance Pool.
- Market Instances: Lightweight contracts for specific asset pairs (e.g., BTC, ETH).
Trading Parameters
To ensure market stability and risk management, the following limits are enforced:
| Parameter | Value |
|---|
| Minimum Margin | 1 USDC |
| Maximum Margin | 1,000,000 USDC |
| Minimum Leverage | 1x |
| Maximum Leverage | 100x |
| Opening Fee | 0.20% (20 bps) |
| Liquidation Threshold | 80% |
Leverage limits may vary depending on the specific asset’s volatility and liquidity profile.
Supported Assets
Currently, Lemon Markets supports a wide range of Crypto pairs. We are actively developing support for:
- Forex (e.g., EUR/USD, JPY/USD)
- Commodities (e.g., Gold, Oil)
- Stocks (e.g., AAPL, TSLA)
All assets are traded against USDC.