copy-of-template-to-be-modified-(64).png
2023-07-11

SCP Research Report - After in-depth investigation of Uni V4, Permaswap insists on integrating tokens into the technical system

💡 Arweave is the infrastructure that undertakes the important mission in terms of permanently storing the crystallization of human wisdom. As the increasingly development of Web3, Arweave being an infrastructure will be applied by more developers to create a brand new and more diversified ecosystem. Based on this background, PermaDAO is established by a community of some co builders. All of the participants can find their own roles here to contribute to the Arweave ecosystem. Any proposals and tasks about Arweave can be published here as well as the support and feedback from the whole community. Join PermaDAO and build Web3!

Writing as UNI V4 launches, exploring possible paths for DeFi to eat the world

  1. The McDonaldization of DeFi. The McDonaldization of Society points out that in a highly commoditised society, people will enjoy the same product quality and aesthetic orientation in any region across the globe, such as McDonald's in the United States and China, which is unimaginable in the traditional era. However, after the release of Uniswap V4, users no longer need other swaps, but only need to realise their own customisation needs based on Uniswap.

  2. Uniswap's immutability and change. The principle of XY=K and AMM mechanism will not change, and the AMM and order book increasingly show a trend of integration, the new limit price single function is an example. AMM will be the dominant paradigm on the chain for a long time to come, while CEX will stick to the traditional order book to encourage market makers to provide liquidity and take advantage of the opportunity to collect fees from it. Hook and Singleton will be the ultimate killer, with Hook responsible for creative freedom and Singleton responsible for speeding up and reducing fees to encourage more retail investors to participate.

  3. Permaswap's disciplined innovation. Permaswap itself has no Gas Fee, while the SCP/Nostr paradigm based on off-chain calculation and on-chain settlement will give developers enough freedom to develop innovative transaction paradigms. Most importantly, in the design of Permaswap, the #PSN token is not a simple governance token, but will constitute a necessary element of decentralisation and deeply participate in the uninterrupted operation of the network.

Gains and losses of Uniswap

The most significant feature of Uniswap V4 update is the addition of Hook and Singleton mechanism. We will detail the new features of these two parts and their possible positive and negative effects below.

Born in 2018, Uniswap initially chose the classic XY = K and AMM mechanisms to provide liquidity. In on-chain transactions, the most important features are:

It provides a matchmaking mechanism without third-party guarantee to ensure that the transfer of funds only occurs between the two sides of the transaction, which is the biggest difference between DEX and the current mainstream CEX. The protocol itself does not participate in any process of the user's fund flow.

It provides a market-making mechanism with optimal capital efficiency to ensure that users participate in market-making, trading and governance without permission, while the agreement itself is only responsible for gathering the two parties and the complete operation of the transaction.

There is no need to say much about the miracle created by Uniswap, and the following is mainly to talk about its problems, which is the main background of its improved V4 version.

To some extent, Uniswap has achieved the above stated goals, and its trading volume is the most important on-chain trading venue besides CEX. However, it is not necessary to deny that Uniswap also has some problems, the main ones are MEV, unpaid losses and the inability of token holders to share the benefits of the protocol, and possible fraud.

MEV itself is not intentional by Uniswap, but it is due to the characteristics of the blockchain. In the process of on-chain confirmation, someone can always preempt or delay the transaction through various stages, resulting in a gap between the transaction initiation price and the final price, thus causing user losses.

Free loss can be understood in this way- the success or failure is determined by XY=K. Uniswap's matchmaking mechanism will be extremely efficient in the similar price range, but once it exceeds this range or liquidity is insufficient, it is likely to cause a large price difference, and then cause asset loss.

The insufficient value of the Uni token itself is only the appearance that the price cannot rise, and the core is the conflict of interest between LP and Uni holders caused by the characteristics of the AMM mechanism itself.

In the AMM mechanism, the core income source is not the price difference between buying low and selling high, but the transaction fee, which is different from the classic CEX Market Maker operation mechanism. The exchange commission is collected by the exchange, so it has the incentive to protect the interests of the market maker. In essence, only the market maker is large enough. In essence, only when the market maker is large enough, can it attract enough users to participate in the transaction. However, in the AMM mechanism, what LP fears most is not the sharp fluctuations of the price, but its market maker or OG, because they hope to erase the price difference as much as possible for arbitrage, which will cause the LP to be reversed arbitrage. Once the loss exceeds the commission income, the LP will provide liquidity for nothing.

In view of this, Uniswap will protect the interests of LP as much as possible to ensure the stable operation of the agreement, which is the main reason why Uniswap repeatedly entangled whether Uni holders have the right to share the income of the agreement.

Finally, there are the alleged scams. This is not the original intention of Uniswap, but there are gains and losses, because there is no way to conduct any kind of audit on both sides of the transaction, so naturally there is no restriction on the addition of tokens, the addition and deletion of liquidity. Of course, at least the detection and early warning means exist, but it does not change the nature of uncensored freedom.

Therefore, there is a certain amount of false behaviour in the token transaction on Uniswap for a long time. This is not a technical problem, but an inevitable governance phenomenon. If you want freedom, you will get everything free.

Uniswap V4 has two major features

As mentioned above, Uniswap V4 has some long-term problems, so it needs to be re-adjusted and designed in V4 version to meet future needs. There are two features in this feature set, Hook and Singleton, which respectively target ecological development and more general market expansion strategy. There is no fundamental revision to the foundation -- XY=K and AMM mechanism.

  1. Hooks allow developers to customise exclusive functions for different liquidity pools, so they can carry out local features different from the global ones. For example, in the official example, many features such as TWAMM, LimitOrder and Volatility are shown.

TWAMM (Time-Weighted Average Market Maker) can effectively support the matching and trading of large orders, and realise the exchange effect between large-value stable-coins similar to Curve.

LimitOrder allows traders to find trading opportunities at specified prices that are more precise and specialised. In fact, Limitorder is similar to CEX limit order such as Binance, but it runs on the chain without the intermediary role of the exchange.

Volatility: allows users to set fee parameters according to market status or their own needs, so as to adapt to market competition or meet their own characteristics specific demand.

According to the Uniswap V4 official example, you can view its specific code implementation process.

In general, the introduction of Hook mechanism actually turns Uniswap into a free DEX SaaS platform. Before the introduction of Hook mechanism, if Uniswap wants to implement features that do not exist by itself, it needs to Fork and create by itself, which is a waste of resources to reinvent the wheel.

Under the Hook mechanism, everything is customisable, and users/developers only need to set up their own "zone" to meet their own specialised needs. In this sense, Uniswap is turning enemies into friends, making any potential competitors a part of Uniswap, and Uniswap can focus on providing the underlying architecture.

In addition, Hook also has the possibility to resist MEV. Due to the customisability and dynamic cost, if the occurrence path of MEV can be clearly defined, then the strategy deployment can be customised, whether banning MEV or participating in its sharing, it is theoretically feasible.

If the degree of freedom based on Hook is large enough, then a carefully designed false transaction pool will also appear, and it will be more difficult to identify and identify, and a new round of security attack and defense war on the chain will also be carried out.

  1. Singleton will be the common smart contract for all transaction pools in Uniswap V4. Instead of existing separate contracts for each transaction pool, future Uniswap V4 will share a single smart contract.

Singleton will have two obvious benefits, it will save Gas Fee and improve the efficiency of smart contract operation. In essence, it is to cooperate with the upgrade measures of Ethereum, which is already an Achilles' heel. On the one hand, it ensures the security of the main network, on the other hand, it causes many retail investors to remain in the exchange, and there is a serious lack of motivation to migrate on the chain.

In order to solve this problem, Uniswap V4 introduces a universal smart contract for the whole pool, which can be centralised to maintain this smart contract to provide global services. Each liquidity pool only needs to be set up according to its own needs, and no longer needs to worry about the loss caused by cross-pool transfer of assets, which can promote the transfer between Uniswap pools. It will also facilitate more project parties to add their own Hook mechanism, which also reduces the necessity of forking Uniswap.

Secondly, saving money, Gas Fee is the biggest obstacle for retail investors to enter Uniswap and chain, and Cancun upgrade will also focus on speeding up and reducing fees. After introducing Blob mechanism, the main network will save more space. EIP-1153 will also introduce Transient Storage Opcodes, which belong to the code part that is abandoned when used up. It will still focus on reducing storage costs and improving the efficiency of mainnet transactions. At present, Geth, Besu, Nethermind,

Erigon, EthereumJS and other mainstream clients have merged EIP-1153, and they will be the priority deployment object.

Singleton will play its real value after Cancun upgrade, and is expected to provide users with a real transaction speed and cost comparable to CEX.

Permswap continues to evolve

Compared with Uniswap's universal path, Permaswap is still mainly focused on Arweave and compatible with EVM network. Different from Uniswap's universal strategy just started, Permaswap is ready to adapt to large-scale user scenarios from the beginning. As well as more general development strategies.

Permaswap compares to Uniswap in two main features: SCP/Nostr decoupling computation and execution, and Arweave network bringing unlimited capacity and transaction speed.

Permaswap adopts the Router-LP Clinets architecture of SCP/Nostr. In general, both are based on the strategy of "calculating off-chain and clearing on-chain". Specifically, when the SCP paradigm is finally successful, Permaswap will settle on-chain. The results are finally submitted to Arweave main network after bundling, which can save storage costs and satisfy the perpetuation of settlement results.

The details of the process are as follows:

Each LP reports to Router the scope and liquidity details of its market making;

After each user places an order, the Router generates an order based on the LP's market-making information and returns the order to the LP. After receiving the order assigned by the Router, the LP confirms it is correct and signs it, and returns the result to the Router.

The Router will link the order to everPay for settlement, and the final information will be stored on the Arweave mainnet.

In this process, due to the off-chain computing mechanism, the implementation of Router/LP-Client is not bound and limited by smart contracts, and can be implemented based on any programming language, such as Golang and JS client versions.

Therefore, it is also very easy to implement the Hook functions like Uniswap V4. Taking the limit price single function as an example, Permaswap has implemented an LP market-making setting that supports one-way price movement, allowing users to buy/sell an asset within a specific price range.

In addition, thanks to the characteristics of off-chain calculation, LP provides liquidity that is not limited by smart contracts, and has atomic transaction characteristics. What users see is what they get, and it is possible to achieve 0 Gas Fee transaction rate.

Arweave itself is a storage public chain, and there is no capacity limit. Therefore, the transaction capacity on Arweave is unlimited, and with the transaction speed of Permaswap, it is comparable to the traditional centralised exchange experience.

In addition, Permaswap also has its own token economics design. Different from UNI's governance token, Permaswap's token PSN will assume the responsibility of promoting network decentralisation.

PSN can essentially still be used as a governance token or fee discount certificate, but in addition, Permaswap requires LP to remain online to confirm or deny the order sent by Router to ensure real-time settlement of the network, and PSN will act as a pledge certificate, after the failure of a single node, The DAO will confiscate, prohibit and other measures to maintain the healthy operation of the network.

This is fundamentally different from Uniswap's token mechanism, as Uniswap can actually operate without the participation of tokens, and even ETH is more important than UNI, since it is the main transaction currency.

Summary

Uniswap is somewhat of a bellwether for #DEX development, but that doesn't mean it's the only option. In terms of technical paradigm, Nostr is robust enough to decentralise. And the Uni token was launched in large part to counter SushiSwap's desperation, which has not been able to reverse the protocol's value until now.

The goal of Permaswap is not to inloop between on-chain protocols, but to attract more #Web2 developers and asset types, to complete the introduction and re-engineering of #Web3 traffic with a close to traditional development experience and efficiency, as well as to provide transaction support for the next billion user market. In this sense, It is even more important to promote more innovative initiatives together.

🔗 More information about PermaDAO :Website | Twitter | Telegram | Discord | Medium | Youtube

Translator: Mic’s May @ Contributor of PermaDAO Reviewer: Xiaosong HU @ Contributor of PermaDAO

Sign up for newsletter

Sign up here to get the latest news and updates delivered directly to your inbox.