Skip to main content
Trading Interface

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:
  1. Validates your request (margin, leverage, asset).
  2. Simulates the transaction to ensure it will succeed.
  3. Constructs the transaction data.
  4. 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:
ParameterValue
Minimum Margin1 USDC
Maximum Margin1,000,000 USDC
Minimum Leverage1x
Maximum Leverage100x
Opening Fee0.20% (20 bps)
Liquidation Threshold80%
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.