Protocol Overview
Limora is a decentralized leveraged trading protocol built on Base. This document provides a technical overview of how the protocol works.Architecture
The Limora protocol consists of several interconnected components:Core Components
Trading Contract
The Trading Contract handles all trade-related operations:- Opening new positions (long/short)
- Closing existing positions
- Liquidating undercollateralized positions
- Processing stop-loss and take-profit orders
Matching Contract
The Matching Contract manages liquidity provision:- Depositing collateral from matchers
- Matching pending trades with available liquidity
- Tracking matched positions and interest accrual
- Processing withdrawal requests
Vault Contract
The Vault Contract serves as the secure storage layer:- Holds all deposited collateral
- Manages fund transfers between traders and matchers
- Enforces access controls and security policies
Trade Lifecycle
A typical trade follows this lifecycle:1
Trade Request
Trader submits a trade request with: - Trading pair - Direction (long/short)
- Collateral amount - Leverage - Optional stop-loss/take-profit
2
Pending State
Trade enters pending state, waiting for a matcher to provide liquidity.
3
Matching
A matcher deposits funds to match the trade, locking both parties’
collateral.
4
Active Position
Position is now active: - P&L calculated against oracle price - Interest
accrues to the matcher - Stop-loss/take-profit monitored
5
Closure
Position closes via: - Manual close by trader - Stop-loss/take-profit
trigger - Liquidation if margin insufficient
6
Settlement
Final settlement: - P&L calculated at closing price - Funds distributed to
both parties - Interest paid to matcher
Position Mechanics
Long Positions
When a trader opens a long position:- Trader profits if the asset price increases
- Matcher profits if the asset price decreases
- Liquidation occurs if price drops below the liquidation threshold
Short Positions
When a trader opens a short position:- Trader profits if the asset price decreases
- Matcher profits if the asset price increases
- Liquidation occurs if price rises above the liquidation threshold
Collateral and Margin
Initial Margin
Initial margin is the collateral required to open a position:Maintenance Margin
Positions must maintain a minimum margin level to avoid liquidation:Liquidation
When a position’s margin falls below the maintenance margin:- Position is flagged for liquidation
- Liquidation bot executes the close
- Remaining collateral distributed:
- Liquidation penalty to protocol
- Remaining to appropriate party
Interest Model
Interest accrues continuously on open positions:- Utilization rate of the matching pool
- Market conditions
- Protocol parameters
Security Model
Smart Contract Security
- All contracts are audited by reputable security firms
- Upgradability follows strict governance procedures
- Emergency pause functionality for critical situations
Oracle Security
- Multi-source price aggregation
- Deviation checks against historical data
- Staleness protection to reject outdated prices
Access Control
- Role-based permissions for administrative functions
- Time-locks on critical parameter changes
- Multi-sig requirements for sensitive operations
Protocol Parameters
Key configurable parameters:| Parameter | Description | Default |
|---|---|---|
| Max Leverage | Maximum allowed leverage | 100x |
| Liquidation Threshold | Margin level triggering liquidation | 80% |
| Opening Fee | Fee charged on position opening | 0.08% |
| Closing Fee | Fee charged on position closing | 0.08% |
| Base Interest Rate | Minimum hourly interest rate | 0.001% |
Network Details
Limora is deployed on the Base network:| Property | Value |
|---|---|
| Network | Base Mainnet |
| Chain ID | 8453 |
| Native Token | ETH |
| Block Time | ~2 seconds |