Uniswap v4 introduces innovations while maintaining its core functionality, such as new contract structures, increased developer flexibility, and more incentives for liquidity providers. It combines simplicity, efficiency, and flexibility, further solidifying its position as a leading decentralized exchange protocol in the DeFi ecosystem. Buidler DAO references the story of the Mayflower to illustrate Uniswap’s updates.
The main focus of v4 innovation is on the following four aspects: 1) New contract structure: Uniswap v4 adopts a new contract structure, which reduces gas consumption, improves efficiency and engineering aesthetics by introducing singleton and library contracts. 2) Sophisticated ledger design: v4’s lightning ledger design separates trading and liquidity operations from token transfers, balances assets and equity through double-entry accounting, and reduces liquidity fragmentation costs. 3) Higher developer freedom: Developers can customize AMM curves and liquidity calculations. 4) More protection for liquidity providers, such as liquidity restrictions and fee tiers.
- Inventory of the Top Five Hacker Attacks in the Crypto Industry in 2023
- Midas Capital suffers another attack, with losses exceeding $600,000.
- Understanding SCAC: The Ultimate Conflict of Smart Contracts
In v4-core, only one contract, PoolManager, bears the core business logic, and PoolManager will be responsible for all liquidity aggregation tasks of the protocol, using the PoolKey field to index the corresponding currency pair market, while AMM curves and liquidity-related calculations are abstracted to libraries. Liquidity positions are no longer wrapped in tokenization, but managed by addresses.
Lightning accounting separates trading and liquidity-related operations from token transfers and balances assets and equity through double-entry accounting by building a set of double-entry accounting ledgers and implementing callback functions. This design changes the traditional coding logic and ensures balance is maintained upon completion of each transaction by updating the internal net balance (delta), thereby achieving a debt-clearing with the liquidity pool. In addition, the protocol’s debt is tokenized through the introduction of ERC-1155 semi-fungible tokens. The combination of singleton contract structure and lightning accounting makes it possible to route more efficiently between multiple v4 pools and reduces the cost of liquidity fragmentation.