Skip to content

Repository files navigation

Liquid Protocol

Liquid Protocol is a decentralized derivatives exchange that, for the first time, enables high-leverage trading on the probability of real-world events.

It solves the "gap risk" problem inherent in traditional prediction markets by pioneering a new financial primitive: probability futures with early expiry.

The Core Problem

Standard prediction markets (like Polymarket) cannot safely offer leverage. This is because at the moment an event resolves, the market price instantly jumps (gaps) from its last known probability (e.g., 45%) to either 100% or 0%.

A leveraged position would be instantly bankrupted, creating massive bad debt and protocol insolvency.

Our Solution

Liquid Protocol's core innovation is simple but powerful: our futures contracts expire and settle based on the event's probability before the final binary outcome is known.

By settling on the continuous probability instead of the discrete outcome, we completely eliminate gap risk. This allows us to use a standard, battle-tested liquidation engine and safely offer the high leverage and deep liquidity that traders demand.

Key Features

  • High Leverage on Probabilities: Go up to 20x long or short on the likelihood of real-world events.

  • Peer-to-Contract Model: Trade directly against the LLPVault, a single, deep liquidity pool, enabling zero-slippage execution.

  • Skew-Based Funding: LPs are protected and markets are kept balanced through dynamic funding rates paid by the majority side of the trade.

  • Manipulation-Resistant Oracles: We use a Time-Weighted Average Price (TWAP) oracle to ensure a secure and stable price feed.

  • Built on Base: Low fees and fast transactions for a CEX-like user experience.

How it Works

  • LPs Deposit: Liquidity Providers deposit USDC into the LLPVault to act as the collective counterparty for all trades.

  • Traders Trade: Traders open leveraged long/short positions against the vault at the oracle price.

  • Funding Balances Risk: The overcrowded side of the market pays a funding fee to the vault, keeping the system balanced.

  • Early Settlement: The market expires before the real-world event. All positions are settled in cash based on the final probability. The actual event outcome is irrelevant to the protocol's settlement.

🚀 Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/metastable-labs/liquid-protocol.git
cd liquid-protocol

# Install dependencies
forge install

Build

forge build

Test

# Run all tests
forge test

# Run tests with verbosity
forge test -vvv

Deploy

cd script/deploy

# Deploy to Base Sepolia (Testnet)
./base-sepolia.sh

# Deploy to Base Mainnet
./base.sh

📍 Deployed Contracts

Base Sepolia (Testnet)

Latest Deployment: October 29, 2025

Contract Address Explorer
USDC (Mock) 0xf60D727E9e23c6762Be1A380EB698057d7627472 View on BaseScan
ProbabilityOracle 0x0AF43F745d3Db1e184b72A6dA4023F131f6bFbD0 View on BaseScan
PositionManager 0x2026e99d4bA19A6447888548Bbaf085939Fa9EDE View on BaseScan
LLPVault 0xBCF9CEAA41165AfCD485C9dA224a9b99BA9a183b View on BaseScan
FundingRateManager 0x35dA26398AB9AE43741397E8f32a54184b7AafF7 View on BaseScan
LiquidationEngine 0xED20C313663E75f644562483E8d85267093fd5c9 View on BaseScan
LiquidRouter 0x095F6037892CAe2a43a7cBBA1FfD133F76BEC663 View on BaseScan
MarketFactory 0xEcc14021f2742b2BCf23d6d22A1435736ED0f386 View on BaseScan

⚠️ Note: This deployment includes margin management features. See CHANGELOG.md for details.

🔒 Security

  • External audit (pending)
  • Formal verification (pending)
  • Bug bounty program (pending)

📝 License

BUSL 3.0

🔗 Links

About

The first decentralized derivatives exchange (DEX) that enables high-leverage trading on the probability of real-world events.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages