← Back to Trading

Documentation

S

SUR Protocol Docs

Perpetual Futures DEX on Base L2

Overview

What is SUR Protocol?

SUR Protocol is a decentralized perpetual futures exchange built on Base L2. Trade BTC-USD and ETH-USD with up to 50x leverage (tiered by position size), near-instant settlement, and transparent on-chain execution.

Key Features

  • ●Perpetual futures with up to 50x leverage (tiered by position size)
  • ●On-chain order matching with price-time priority
  • ●Cross-margin trading with USDC collateral
  • ●Yield-bearing collateral support (cbETH, wstETH, sUSDe)
  • ●Paper trading mode for risk-free practice
  • ●Real-time WebSocket price feeds
  • ●EIP-712 signed orders for gasless submission

Getting Started

1. Connect Your Wallet

Click 'Connect Wallet' in the top right. SUR supports MetaMask, Coinbase Wallet, WalletConnect, Rainbow, and most EVM-compatible wallets. Make sure you're on Base Sepolia (testnet).

2. Get Testnet USDC

Visit the Base Sepolia faucet to get testnet ETH for gas, then use our faucet integration or bridge testnet USDC to start trading.

3. Deposit Funds

Use the Deposit panel on the right side of the trading interface. Enter the amount of USDC you want to deposit into the vault. Your vault balance is used as margin for trades.

4. Place Your First Trade

Select Long or Short, choose Market or Limit order, set your size and leverage, then submit. For market orders, your trade executes immediately at the best available price.

Paper Trading

Not ready for real funds? Toggle Paper Trading mode to practice with $100,000 virtual USDC. All positions track real-time prices from Binance. Practice the full trading cycle risk-free: deposit, trade, manage positions, and track P&L.

Trading

Order Types

  • ●Market β€” Executes immediately at best price. Pays taker fee (0.06%).
  • ●Limit β€” Rests on the book until filled at your price. Pays maker fee (0.02%) if Post Only.
  • ●Stop Limit β€” Triggers a limit order when the mark price reaches your trigger price.

Time in Force

  • ●GTC (Good Til Cancelled) β€” Stays on book until filled or cancelled.
  • ●IOC (Immediate or Cancel) β€” Fills what it can immediately, cancels the rest.
  • ●FOK (Fill or Kill) β€” Must fill entirely or is cancelled.
  • ●Post Only β€” Rejected if it would match immediately. Guarantees maker fee.

Leverage

Both BTC-USD and ETH-USD support up to 50x leverage, tiered by position size. As notional size increases, max leverage decreases: 50x up to $100K, 25x up to $500K, 10x up to $2M, 5x above. The order panel automatically adjusts max leverage based on your position size.

Fees

Maker fee: 0.02% (2 bps). Taker fee: 0.06% (6 bps). Fees are calculated on the notional value (price x size) and deducted from your margin at execution.

Hidden Orders

Mark an order as 'Hidden' to keep it off the public orderbook. Hidden orders still match normally but protect your strategy from being front-run. Only available for limit orders.

Positions & P&L

Position Management

Open positions are shown in the Positions panel at the bottom. Each position displays: market, side (Long/Short), size, entry price, mark price, unrealized P&L (in $ and %), margin, leverage, and liquidation price.

P&L Calculation

  • ●Long P&L = (Mark Price - Entry Price) x Size
  • ●Short P&L = (Entry Price - Mark Price) x Size
  • ●P&L % = (P&L / Margin) x 100

Closing Positions

Click 'Close' on any position to close it at the current mark price. Realized P&L is added to your balance. A taker fee is charged on the close.

Liquidation

When a position's margin ratio falls below the maintenance requirement, the protocol partially liquidates 25% of the position per round. This tiered approach gives traders a chance to add margin before full closure. The liquidation price is shown on each position.

Architecture

Smart Contracts (Base L2)

  • ●PerpEngine.sol β€” Position management, tiered margin calculation, partial liquidation, funding rate application.
  • ●PerpVault.sol β€” USDC custody, deposits/withdrawals, margin accounting.
  • ●OrderSettlement.sol β€” EIP-712 order verification, trade settlement, dynamic spread fees.
  • ●Liquidator.sol β€” Permissionless liquidation engine, 25% partial close per round.
  • ●InsuranceFund.sol β€” Protocol backstop for bad debt from liquidations.
  • ●AutoDeleveraging.sol β€” Last-resort ADL when insurance fund is depleted.

Off-Chain Engine

The matching engine runs off-chain for performance. It maintains an in-memory orderbook with price-time priority matching. Matched trades are batched and settled on-chain.

WebSocket API

Real-time data flows via WebSocket on port 3002. Channels: orderbook:{marketId} for order book snapshots and deltas, trades:{marketId} for trade executions. Orders are submitted via the WebSocket with EIP-712 signatures.

Frontend Stack

  • ●Next.js 15 + React 19 + TypeScript
  • ●Tailwind CSS for styling
  • ●lightweight-charts for TradingView-style charting
  • ●wagmi + RainbowKit for wallet connection
  • ●useReducer pattern for state management

Contract Addresses

Base Sepolia (Testnet)

  • ●PerpEngine β€” Position management, tiered margin, liquidation
  • ●PerpVault β€” USDC custody, deposits/withdrawals
  • ●OrderSettlement β€” EIP-712 trade verification, dynamic spread
  • ●Liquidator β€” Permissionless partial liquidation (25% per round)
  • ●InsuranceFund β€” Protocol backstop for bad debt
  • ●AutoDeleveraging β€” Last-resort ADL when insurance fund depleted
  • ●OracleRouter β€” Pyth Network price feeds

Audits

Smart contracts are undergoing security review. Full audit reports will be published here before mainnet launch.

SUR Protocol Β© 2026