Liquidity Book is an innovative, highly-capital efficient Automated Market Maker (AMM) protocol designed to support high volume trading with lower liquidity requirements. It introduces unique features that enhance the trading experience and optimize earnings for Liquidity Providers.
- Zero Slippage: Liquidity Book allows traders to swap tokens with zero slippage within designated bins, ensuring optimal trading conditions.
- Surge Pricing: During periods of high market volatility, Liquidity Providers earn additional dynamic fees, increasing their potential earnings.
- High Capital Efficiency: Unlike many existing AMMs, Liquidity Book supports high volume trading with significantly lower liquidity requirements.
- Flexible Liquidity: Liquidity Providers can strategically build flexible liquidity distributions according to their specific trading strategies.
While both Liquidity Book and Uniswap V3 operate as concentrated liquidity AMMs, there are a few key differences:
Feature | Liquidity Book | Uniswap V3 |
---|---|---|
Price Ranges | Discretized into bins | Utilizes ticks |
Invariant used | Constant sum | Constant product |
Bin Steps/Tick Sizes | Can be more than 1 basis point | Generally 1 basis point |
Liquidity Aggregation | Vertically aggregated | Horizontally aggregated |
Fungibility of Liquidity Positions | Yes | No |
Liquidity Distribution | Not restricted to uniform, can take any desired shape | Typically uniform across price range |
Swap Fees | Fixed + variable pricing, allows higher fees during volatility | Fixed pricing |
Zero Slippage | Yes | No |
Surge Pricing | Yes | No |
High Capital Efficiency | Yes | Variable |
Flexible Liquidity Distributions | Yes | Limited |
This repository contains the Liquidity Book contracts, as well as tests and deploy scripts.
- The LBPair is the contract that contains all the logic of the actual pair for swaps, adds, removals of liquidity and fee claiming. This contract should never be deployed directly, and the factory should always be used for that matter.
- The LBToken is the contract that is used to calculate the shares of a user. The LBToken is a new token standard that is similar to SNIP-1155.
- The LBFactory is the contract used to deploy the different pairs and acts as a registry for all the pairs already created. There are also privileged functions such as setting the parameters of the fees, the flashloan fee, setting the pair implementation, set if a pair should be ignored by the quoter and add new presets. Only the owner of the factory can create pairs.
- The LBRouter is the main contract that user will interact LbPair when swapping
- The LBQuoter is a contract that is used to return the best route of all those given. This should be used before a swap to get the best return on a swap.