
Uniswap developers publish draft code for Uniswap v4
Uniswap Labs has posted on GitHub an early implementation of the code for the protocol’s next version, dubbed Uniswap v4.
1/ Today, we’re announcing our vision for Uniswap v4 ?
We see Uniswap as core financial infrastructure & think it should be built in public with space for community feedback and contribution.
An early implementation of the code can be found here:https://t.co/toy3k7plnU pic.twitter.com/9vGJElba2x
— Uniswap Labs ? (@Uniswap) June 13, 2023
“We regard Uniswap as a key financial infrastructure and believe it should be built publicly with space for community feedback and contribution,” the developers said.
One of the main features of v4 will be the use of hooks. These are plugins that allow liquidity pools to implement entirely new functions, such as dynamically adjusting fees or creating different types of orders.
To demonstrate the capabilities of the feature, the developers wrote several examples of hooks. Among them:
- time-weighted average market maker (TWAMM);
- custom on-chain oracles;
- on-chain limit orders.
3/ We’ve written a few sample hooks to demonstrate their expressiveness & capabilities:
⌛ Time-weighted average market maker (TWAMM)
? Customized onchain oracles
? Onchain limit ordershttps://t.co/Yu5OGIdxe3 pic.twitter.com/ZdFqElnsap
— Uniswap Labs ? (@Uniswap) June 13, 2023
As the range of pool configurations grows, the team has updated the architecture to better accommodate such variety.
In Uniswap v3, a separate smart contract is deployed for each pool. In v4, a single singleton contract will be used, delivering substantial gas savings.
“Preliminary estimates indicate that v4 reduces gas costs for creating a pool by 99%. Hooks open up a world of endless possibilities, and the singleton allows us to use them all efficiently,” said Uniswap founder Hayden Adams.
5/ v4 pools will live in a single contract, reducing the cost of pool creation by 99% ?
When combined with a new “flash accounting” system, this greatly reduces the cost of routing across many pools ⚡ pic.twitter.com/JNbmt9Smfz
— Uniswap Labs ? (@Uniswap) June 13, 2023
Back in April, Uniswap Labs lost the exclusive commercial rights to the Uniswap v3 code due to the expiration of the Business Source License BSL.
Рассылки ForkLog: держите руку на пульсе биткоин-индустрии!