Cookies Research

发布于 2023-11-04到 Mirror 阅读

1inch Fusion: Cost-Efficient, MEV-resistant Swaps

Key Takeaways

  1. 1inch Fusion offers users the most favourable swap rates while being MEV-resistant

  2. A dutch auction model is utilized, where the swap rate is decreased over time

  3. Orders are filled by resolvers, which are professional market makers, to give the best rates

  4. Users get to swap gas-free, as gas is paid by the resolvers

What is 1inch?

1inch is a decentralized exchange (DEX) aggregator that aggregates liquidity across the various DEXs. This contributes to deep liquidity on 1inch, offering users better rates and minimizing the slippage incurred.

1inch Fusion

1inch Fusion was launched, with the goal of further improving the cost efficiency and security of swaps for users. This is achieved by utilizing a dutch auction order matching model, where users are able to customize order inputs (price range, time period for swap etc.). These orders are filled by parties known as resolvers, which are sophisticated market makers that source for the best settlement rates for swaps.

Through this model, users are able to get better rates while saving on gas fees (paid by resolvers). They also benefit from MEV-resistance from the batching mechanism utilized by resolvers. More details on the benefits can be found in the later part of this article.

In this article, we will explore the following:

  1. 1inch Fusion Stakeholders

  2. 1inch Swap Engine | Dutch Auction

  3. 1inch Fusion | Order Filling Mechanism

  4. 1inch Fusion Benefits

1inch Fusion Stakeholders

Let’s first begin by understanding the stakeholders involved in 1inch Fusion.

Resolvers

What are Resolvers?

Resolvers are the key to order-filling in 1inch Fusion. They are fully automated algorithms developed by professional market makers and comprises of the following components:(a) Resolver’s Backend: Server app that determines which orders and when to fill(b) Resolver’s Account: EOA that is whitelisted by staking $1INCH(c) Resolver’s Workers: Execute swaps received from resolver’s backend

Resolver Architecture

Resolver Whitelist

For resolvers to participate in swap execution, they have to be whitelisted.

Whitelist criteria:(a) The amount of unicorn power held must be among the top 10 of all resolvers(b) Resolver has to hold 5% or more of the total unicorn power in 1inch protocol

Unicorn power is received by staking $1INCH to receive $st1INCH. Resolvers can accumulate sufficient unicorn power through the following approaches:(a) Stake more $1INCH / Lock $1INCH for a longer period(b) Attract delegators to delegate their unicorn power

Resolvers are prioritized for order filling based on the total amount of unicorn power held (resolvers’ own + delegates’).

Dynamic whitelist

The unicorn power distribution among resolvers will change over time, based on the amount of $1INCH resolvers themselves stake, as well as the unicorn power received from delegators.

Resolvers who no longer meet the whitelist criteria will be removed from the whitelist, removing their rights to fill orders.

Fee Bank

In the process of filling orders, resolvers pay for the gas fees. This fee is automatically deducted from the resolver’s fee bank, a smart contract that escrows the deposit made by resolvers. Should there be insufficient balance in the fee bank to pay for transaction gas fee, users’ order will be reverted.

Setting Up a Resolver

The process of becoming a resolver can be summarized in these steps:

  1. Gain enough unicorn power to be listed among top 10 registered resolvers

  2. Pass through a verification procedure

    This is required to ensure that resolvers are trustworthy actors. The verification procedure involves KYC (know-your-client) / KYB (know-your-business) by Synaps as well as a wallet screening by TRM Labs to ensure that the resolver is not involved in illicit activities.

  3. Register as a solver and set up wallet address for trade execution

  4. Deposit $1INCH into FeeBank to cover resolving fees

  5. Start resolving swaps

Delegators

What are Delegators?

Users who have staked $1INCH to receive $st1INCH will be eligible to earn unicorn power. This unicorn power can be delegated to resolvers, helping resolvers qualify for the whitelist. In return, delegators will earn rewards, which differ based on the resolver they delegate to.

Delegation Process

1inch Fusion has created a default farm for each resolver, allowing users to delegate their unicorn power with a single click, as shown below.

Delegation User Interface

The rewards provided by the resolver will be distributed proportionally to the delegators based on the amount of unicorn power and period they have delegated. Rewards received by delegators can be staked on 1inch again to receive more unicorn power, which delegators can choose to delegate to their choice of resolver once again.

Delegation Process

Note: Delegators can only delegate their unicorn power to 1 resolver at a time.

1inch Swap Engine | Dutch Auction

Dutch Auction

The crux of 1inch Fusion lies in its swap engine, which features an order-matching mechanism known as the Dutch Auction model.

In this model, users will place a gas-less order with a certain price range (users decide the maximum and minimum they are willing to receive) and time range (the time users are willing to wait for order fulfilment). Upon the start of the auction, the swap rate will decrease over time to the minimal return amount (stipulated by users) until it becomes profitable for resolvers to fill the order. Multiple resolvers will be competing to fill the orders, increasing the chances of users receiving a favourable rate on their swaps.

Execution Options

There are 4 options for users to choose from:

  1. Auto

    The price and time range is automatically selected, based on market conditions and swap size, to provide users with the maximum return amount.

    This is a suitable choice for users looking to swap a large amount.

  2. Fast

    The auction time is reduced to 3 minutes for the order to be filled within the 1st few blocks.

    Users that choose this option are willing to accept slightly less desirable rates in order for their orders to be filled as fast as possible.

  3. Fair

    The auction time is increased to 6 minutes. This gives more time for the users to potentially receive a more desirable swap rate based on how the market conditions change during the auction period.

  4. Custom

    The price and time range is fully customizable by users.

    Note: Users have to be careful while choosing the minimum price range as it could potentially result in a large slippage.

1inch Fusion | Order Filling Mechanism

In this section, we will dive deeper into the order-filling mechanism.

Order Filling Mechanism

Resolver: Order Filling Mechanism

  1. User enters order details into the 1inch UI: (a) Token (b) Amount (c) Auction type

  2. Order details are sent from 1inch UI to quoter

  3. Quoter requests for the current market price from the pathfinder

  4. Pathfinder will return the current market price to quoter

  5. Based on user order input and current market price, quoter calculates price curve and returns it to 1inch UI

  6. 1inch UI displays the expected return amount to users

  7. User signs order with their wallet

  8. Signed orders are sent from the 1inch UI to 1inch relayer (backend)

  9. Resolver backend polls 1inch relayer for orders

  10. 1inch relayer will provide resolvers with available orders

  11. Resolver backend determines the orders to be filled and sends execution instruction to resolver worker

  12. Resolver worker executes the trade

Price Curve Calculation

The quoter mentioned above is a sophisticated backend service that is designed to maximize the return amount for users. Based on the input supplied to it, the quoter defines a proper limit price curve.

The price curve provided by the quoter is a piecewise linear function which is dependent on parameters including network swap volume, gas costs, order details (token type, price range, time range) etc. An example of the price curve can be seen in the following diagram:

Quoter: Calculated Price Curve

Blue Line: This is the price curve which determines the amount users will recieve at each block. As auction time elapses, the amount received by users will decrease, increasing the profitability for resolvers to fill the order, and thus the chances of user order being filled.

Top Horizontal Dotted Line: Marks the auction start amount. This corresponds to the maximum price set by the user, and returns the highest amount to the user should it be executed.

Middle Horizontal Dotted Line: Represents the amount returned to user should the order be executed at the market price (retrieved from pathfinder)

Bottom Horizontal Dotted Line: Mark the auction end amount. This corresponds to the minimum price set by the user, and returns the lowest possible amount to the user (within the order details inputted by users)

Blue Diamonds on Curve: These represent block timestamps. In each block, the minimum amount that the resolver has to return to users differ. If a resolver is able to execute the trade and receive an amount higher than the minimum, they get to keep the excess as profit.

Pink Diamonds on Curve: These represents the key points where the price curve will change its gradient, and determines the drop in swap rate.

1inch Fusion Benefits

Cost-Efficient

Users are able to benefit from gas-free transactions as it is paid for by the resolvers.

In addition, resolvers can divide the token amount to be traded into smaller batches for execution at several price points over the auction period. This can potentially reduce the price impact and users can have their orders filled at their desired price.

MEV-Resistant

Resolvers bundle the orders prior to sending them to the mempool. This prevents MEV attacks in the form of front-running and sandwiching, which traditionally has led to significant loss of user funds.

Deep Liquidity

Given that the 1inch swap engine powering 1inch Fusion is built on top of 1inch’s Aggregation Protocol and Limit Order Protocol, users benefit from deep liquidity at all times.

Thoughts & Questions

Thoughts

The resolver competition is very beneficial to users. Resolvers that have the best algorithm and execution will be able to return the greatest amount to users and also maintain high profitability. A portion of profits can be channeled to rewards for delegators, further increasing the unicorn power held by these high performing resolvers. They will then be prioritized for order filling based on the quantity of unicorn power held, creating a flywheel effect.

Resolvers are able to run incentive programs to attract delegators. This shows some resemblance to that of bribe markets such as Convex. It is an interesting mechanism, but I am curious with regards to resolvers’ profitability should this be a significant cost for them.

Questions

Is it possible to expand the number of resolvers to more than 10? With greater resolver competition to fill orders, users can potentially benefit from even more favourable rates. Is the cap on the resolver quantity meant to maintain resolvers’ profitability?

In the case of insufficient deposits in the fee bank, the user’s order will get reverted. Does this result in latency for user order fulfilment? Is it possible to integrate an auto top-up mechanism for resolvers, in order to reduce the frequency of such order reversion.

Is there any possibility to rehypothecate the unicorn power delegation?

Conclusion

All in all, 1inch Fusion features a suite of benefits for users with the increased cost-efficiency, as well as the MEV-resistance.

Stay tuned for a comparison of 1inch Fusion, CowSwap and UniswapX!