UniswapX: Pioneering the Uniswap V4 DeFi Experimental Hub

LD Capital
12 min readJul 26, 2023

--

Author:Yilan,LD Capital

The recently launched UniswapX is currently in an opt-in beta phase. It’s projected that Uniswap X will utilize its full chain routing function, resulting in structural impacts on existing aggregators and cross-chain bridge tracks. The immediate effect perceived by the market is the siphoning of transaction volume from the aggregators market (such as 1inch, Cowswap, etc.) where the fee rate competition takes place, with 1inch experiencing a significant price reduction after the launch of UniswapX.

Fundamentally, UniswapX is a non-custodial trading protocol based on Dutch auctions. The protocol allows third-party Fillers to execute trades (as takers). Fillers could be on-chain or off-chain liquidity providers such as market makers, MEV seekers, DEX, etc. Competition among Fillers is achieved through Dutch auctions, a method of setting the initial price of Dutch-style orders. The starting price of the Dutch auction is determined by an RFQ, an off-chain quotation system that votes for some Fillers (market makers will be incentivized to use private transaction relays to route the order to the on-chain liquidity pool). To incentivize the Filler network to offer the most favorable prices, UniswapX allows orders to designate a Filler, who exclusively has the right to fill the order for a brief period before the Dutch auction begins, after which any Filler can execute the order.

UniswapX’s optimizations and problem solutions:

1) Internalizing MEV benefits, some are subsidized to the swapper (in the form of lower transaction prices), some are acquired by the Filler, returning profits to users.

2) Off-chain transaction signing is user-friendly. Fillers will perform comprehensive calculations between optimizing gas costs and optimizing actual exchanges, utilizing this complexity to produce optimal results. Trading across multiple pools doesn’t require multiple gas fees or native gas tokens; failed transactions also don’t require gas.

3) Meeting the demand for cross-chain transactions.

Some criticisms:

1) Certain tokens with single pathways may already achieve the best price in the largest pools under normal mode. Using UniswapX could potentially result in double charging, not necessarily saving money.

2) The inherent transaction speed within Dutch auctions has a certain delay (see diagram below), which could lead to losses due to market price fluctuations, or Fillers waiting for the price to drop before trading (UniswapX hopes to resolve this issue through a reputation system).

3) The RFQ mode of Fillers is relatively centralized.

Dutch Auction Flow Diagram

I. How to Help Users Achieve Lower Gas Costs and Better Prices (Though it Might Not Save Money in Some Scenarios)

The principle behind UniswapX and 1inch Fusion in optimizing user transaction fees is the same, but UniswapX is more permissionless and lacks the whitelist system of 1inch.

From the user’s perspective, the 1inch Fusion mode appears to be a typical swap exchange, but technically, Fusion is actually implemented through a limit order model, with the exchange rate filled by a third party known as a “Solver” (similar to Filler in UniswapX). The exchange rate of the order gradually decreases from the initial exchange rate to a smaller amount (using a Dutch auction mechanism) until the Solver can profitably fill the order. Multiple Solvers compete for the order, ensuring that it is filled before the exchange rate drops to the minimum return amount. Here are some opportunities for Solvers to make profits:

Dutch auction continuously reducing the order exchange rate.

Saving gas costs when filling matching orders.

Saving gas costs due to batch filling.

UniswapX’s Fillers also profit through these methods. Additionally, Fillers compete not only with Uniswap v1, v2, v3, and the newly launched v4, but also with each other, providing users with better prices.

UniswapX Transaction Flow Diagram

In this process, transactions are submitted to the Reactor Contract and Fillers pay the gas. If the transaction fails, the gas loss is borne by the Filler. Although gas costs will ultimately reflect in the user’s transaction price, users no longer need a large number of gas tokens, only a small amount of gas for initial authorization. Price competition, reduction of MEV losses, lower gas costs — all these ultimately translate to users having better prices during transactions.

II. How to Achieve MEV Protection

By introducing a permissionless Filler network, Fillers choose various Reactors for settlement, and through methods such as auctioning a batch transaction and keeping the mempool confidential, they provide a certain degree of MEV protection for users, making users partakers in MEV profits.

Let’s briefly introduce how MEV (Maximal Extractable Value) occurs. MEV refers to the maximum value that miners or other traders can extract from transactions by prioritizing transaction processing, reordering transactions, or selectively including or excluding transactions. MEV is a phenomenon caused by the sequential nature of blockchain transactions and consensus mechanisms.

For instance, CoW Swap uses several protocols to match orders to avoid sandwich attacks. Some of CoW Swap’s MEV protection data for 2022 are as follows: In 2022, there were about 1.9K sandwich attacks on CoW Swap transactions. Compared with 239K transactions, sandwich attacks only accounted for about 0.8% of CoW Swap’s total transaction volume. Sandwich attacks extracted approximately $0.13 million from CoW Swap’s Solvers. Compared to CoW Swap’s total fee income of $8.55 million, sandwich attacks only accounted for about 1.5%. Through CoWSwap, the percentage of attacked transactions is an order of magnitude lower than the total sandwich attack percentage in Uniswap or Curve. In addition, compared to other decentralized exchanges, the volume of batch value transactions attacked on CoW Swap only accounted for 0.7% of the total transaction volume, also an order of magnitude lower.

Currently, the contracts most severely attacked are Uniswap V3 and Uniswap V2. UniswapX is a protocol designed to address this problem. If there were better pricing methods and resources, people would surely prefer them, meaning that over time, more transaction volume would shift from the original Uniswap to UniswapX.

In the use of UniswapX, traders first authorize Permits by signature to grant the right to transfer tokens. This process requires the payment of a certain amount of gas tokens. Next, traders need to sign to clarify some transaction parameters including the types and quantities of input and output tokens, and authorize the Reactor Contract (contract related to settlement) to spend tokens. Fillers compete for orders, and the winning Filler will submit the batch transaction to the Reactor Contract. The Reactor Contract calls the Executor Contract to execute the transaction. The Executor Contract obtains the output tokens from the Filler and sends them to the trader. The Reactor Contract checks if the execution result of the transaction matches the submitted transaction parameters and settles it.

In this process, traders trade directly with Fillers, reducing opportunities for attackers to perform MEV arbitrage. Even if an MEV attack occurs (a Filler could be an MEV searcher), the profits are shared with traders to some extent.

In the UniswapX scenario, through the auction, prices decay over time. As long as someone believes that including the transaction is profitable, they will submit the auction, and the order is fulfilled before the tolerance bottoms out, making the order profitable. This way, arbitrageurs can’t front-run trades as they used to. This system ensures that as soon as a profitable opportunity arises, the order is completed, which is an MEV protection mechanism in itself. For example, if there are a bunch of transactions off-chain at the same time, a submitter can discover all transactions and complete them all at once, meaning they would submit the orders early in the cycle. In a price auction, the earlier you bid, the higher the price, and the less value leakage.

III. How to Support Cross-Chain Transactions

UniswapX protocol can be extended to support cross-chain transactions, where traders can transact their holdings on the source chain to obtain the required assets on the target chain. Orders signed off-chain not only solve the complexity of the pool, but also solve the complexity of bridging. Complexity is addressed by the same service providers, the same submitters.

UniswapX cross-chain achieves the following features:

1) Quick Swap — As long as there’s a message-passing bridge between two blockchains, UniswapX can provide rapid asset exchange between any two chains.

2) Simplified Operations — Swap and bridging are combined into a single operation, eliminating the need for users to interact directly with the bridge, maintain gas tokens on each chain, or wait for settlement delays.

3) Fast Exit — UniswapX can realize almost instantaneous exit from layer 2 chains to its parent chain.

4) Native Asset Exchange — Traders can specify to receive native or normalized assets on the target chain, rather than bridged assets. For example, ETH on the mainnet can be directly exchanged with AVAX on the Avalanche chain.

5) Minimize Passive Bridge Risk — Traders do not assume any bridge-related risks when exchanging native assets, while Fillers only bear bridge risk when rebalancing between chains via bridging.

Simplified version of the cross-chain UniswapX protocol:

1) Traders sign an off-chain order, which, in addition to parameters identical to single-chain orders, includes the following additional parameters:

2) Settlement Oracle: A unidirectional oracle that can prove the occurrence of an event on a target chain. This could be a standard bridge between a parent chain and a layer 2 chain, a light client bridge, or a third-party bridge.

3) Filler Deadline: The order must be filled on the target chain before it is completed.

4) Filler Collateral Amount and Assets: The collateral that Fillers must deposit on the source chain.

5) Proof Deadline: The time by which the Filler must provide proof of filling on the source chain.

Orders from traders are propagated through the Filler network. Fillers compete to execute the order and submit it along with the trader’s funds and Filler’s collateral to the reactor contract on the source chain. The Filler fills the order by transferring the assets required by the trader on the target chain. The reactor contract on the target chain records the orders filled before a specified deadline and sends a message via a settlement oracle to the reactor contract on the source chain to confirm the fulfillment of the trader’s order. The trader’s assets and collateral are then released to the Filler on the source chain. If the Filler fails to execute the order within the proof deadline, the trader retrieves their input assets and Filler’s collateral from the reactor contract on the source chain.

The Optimistic cross-chain protocol can address issues where certain settlement oracles may be too slow or expensive. In the Optimistic cross-chain protocol, the Filler completes the order on the target chain, and if no one challenges the order fill within the challenge deadline, the Filler receives the trader’s funds and the Filler’s collateral on the source chain. Anyone can use the reactor contract on the source chain to challenge the fill before the end of the challenge deadline. If the Filler can provide valid fill proof within the proof deadline, they receive the challenger’s collateral. If the Filler fails to provide valid evidence, the Filler’s collateral is distributed to the challenger and the trader, and the trader’s funds are refunded to them on the source chain.

Hayden Adams believes that in the future, most assets will exist on their origin chains, or on their safest chains, or on their most typical asset chains, rather than on bridges. That is, if submitters make cross-chain exchanges, they must obtain tokens on the native chain of the token. In this way, the use of bridges seems to be really minimized. Rather than saying that cross-chain bridges are asset bridges, in this model, cross-chain bridges are just used to pass the final information. Not even that data package is needed, unless the submitter is lying. This can be called minimal viable bridging, where users only bear bridge risk when trading across bridges. Once the swapper has received the output tokens and the submitter has received the input tokens, neither party will have any more bridging risk.

So, UniswapX minimizes the degree to which people need to bridge, while also abstracting them. For instance, this system can support any possible bridge. You can think of it as a bridge aggregator, where submitters can use any bridge, but each transaction has a specific cross-chain bridge, or a “settlement oracle”, which can be any connector, or any other system, and can use a multi-signature system, governance system, or unilateral system, or trust the submitter.

IV. The Differences Between UniswapX and 1inch Fusion

UniswapX allows Fillers to accept and submit orders without permission, which is more open than the whitelist system of 1inch Fusion.

In 1inch Fusion, Solvers get order flow in the order of the number of 1inch tokens they have staked. This means that only one Solver can match the trade in the first minute of the order. Even after that, competition is very limited. That is, to fill an order, a Solver must be added to the whitelist and have enough balance to pay for the order fee. The way to enter the whitelist is as follows:

(1) Gain enough unicorn power to be listed among the top ten registered Solvers. There are two ways to increase Solver unicorn power:

• Stake more 1inch tokens or extend the staking period.

• Attract more delegates through farming to delegate their unicorn power to the Solver.

(2) Register as a Solver in the whitelist and delegation, and set a working address.

(3) Deposit 1inch tokens into FeeBank to pay for transaction resolution fees.

The ranking of the top ten whitelist depositors is determined by their “unicorn power”. Depositors can lock 1inch tokens in the staking contract to get st1inch tokens. The lock-up period can be set from one month to two years. st1inch tokens give depositors “unicorn power”. The longer the lock-up period, the more unicorn power the depositor gets, and the increase in unicorn power is not linear but according to the following rules:

Lock for 2 years, and each 1inch token locked will give the depositor 1 “unicorn power”.

Lock for 1.5 years, and each 1inch token locked will give the depositor 0.47 “unicorn power”.

Lock for 1 year, and each 1inch token locked will give the depositor 0.22 “unicorn power”.

Lock for 0.5 years, and each 1inch token locked will give the depositor 0.1 “unicorn power”.

Expired lock, each 1inch token locked will only give the depositor 0.05 “unicorn power”.

UniswapX adopts a permissionless admission system and uses a reputation system to mitigate the possibility of Fillers acting maliciously. It has the priority of trading rights for the best quote and a reputation system (to prevent Fillers from waiting for the price to drop before trading). The quotation system may benefit from using accompanying reputation or punishment systems to limit the choice provided by Fillers’ monopoly and ensure that the user experience of traders is not affected.

Other aspects are relatively similar.

V. Income Growth Forecast

UniswapX charges a 0.05% transaction fee. Given the current daily data of 35mln for 1inch and 22mlnd for CoWSwap, even if Uniswap gets half of the transaction volume of these two platforms, calculated with the existing market share, the daily increase is 25mln*0.05% ($12.5k), which is 1.25% growth compared to Uniswap’s current daily income of nearly 1mln, which is not significant.

Conclusion

The marginal changes in income growth of UniswapX will not fundamentally change the income of Uniswap itself in the short term, but will have a greater impact on other protocols in this track. While Uniswap’s layout of wallets, NFT market, aggregator market, etc., to squeeze other protocols in the stock market has not been widely accepted by the market, UniswapX is just one of the protocols that we can see V4 might enable. With the emergence of Uniswap V4, by embracing its core mission to build a better ecosystem, Uniswap is expected to get rid of criticisms of neglecting its main business and become an important infrastructure to support various applications. Its diverse layout in different fields will gradually develop it into a huge experimental base that cannot be ignored by the market.

LD Capital is a leading crypto fund who is active in primary and secondary markets, whose sub-funds include dedicated eco fund, FoF, hedge fund and Meta Fund.

LD Capital has a professional global team with deep industrial resources, and focus on develivering superior post-investment services to enhance project value growth, and specializes in long-term value and ecosystem investment.

LD Capital has successively discovered and invested more than 300 companies in Infra/Protocol/Dapp/Privacy/Metaverse/Layer2/DeFi/DAO/GameFi fields since 2016.

--

--

LD Capital
LD Capital

Written by LD Capital

We are one of earliest VC investors in the Blockchain field in Asia. We focus on : Innovation projects within finance, games, content publishing and IOT

No responses yet