Minimize MEV while using Uniswap's Universal Router on any chain.
Arena X on SUAVE is an MEV application where users can submit signed intents for Uniswap's Universal Router on any chain. Signed intents are shared with searchers/peekers and they're able to backrun the intents with additional transactions.
Setup
- The constructor takes 2 inputs, an array of chain ids and an array of builder urls. These inputs will initialize a mapping called
builderUrlsByChainId
. Ensure that the indexes for both inputs correspond (i.e. chainIds[0] should have a builderUrl that is relevant to the id stored at chainIds[0]). - When Arena X is deployed, an admin is set (
msg.sender
). This admin can add / remove supported networks for Arena X with theupdateSupportedChains
function call.
Sending a transaction with SUAVE
- Users will create an
Order
. The order includes their signing address, a list of commands they want to perform, the corresponding data, a deadline, and the chain id they want to execute the transaction on. - Once they confirm the
Order
, they will sign it and create anOrderIntent
. ThisOrderIntent
will be sent to the Arena X MEV Application on SUAVE through thenewIntent
function. TheOrderIntent
is passed confidentially to SUAVE. - In the
newIntent
function, the details of theOrder
will be shared to searchers under the tagorderIntent
. Searchers can query theorderIntent
key on SUAVE and read details of the order. - If searchers want to fulfil the order, they can call
submitSolution
. This function gets the block number of the chain id specified in theOrderIntent
. If the block number is the same as when theOrderIntent
was passed in, then it'll rank the solution with other solutions for this block. If the block number has progressed, the best solution will be submitted on chain (based on the_rankSolution
function). - The
_rankSolution
function comparesegp
and ensures that the order is valid (signature, nonce, etc.) before considering it as a solution.
The Universal Router is an ERC20 and NFT swap router that allows for greater flexibility when tokens are traded. Transactions are encoded using a string of commands so multiple actions and the corresponding data for those actions can be executed on chain as a single transaction.
Currently, the Uniswap Universal Router is deployed on the following chains:
- Arbitrum
- Avalanche
- Base
- Binance Smart Chain
- Celo
- Mainnet
- Optimism
- Polygon
Custom precompile for suave-geth
SUAVE from Flashbots (suave-geth
) is added as a git module in this repo but slightly customized so that it could support a new function called getBlockNumber
. This function can be used in the MEV appliction (ArenaX) to fetch block numbers from any chain - all you have to do is pass in the RPC URL for the network you are trying to submit an order on.
- Figure out how to build blocks when there are multiple intents with the same chain id and block number
- Adding support for EIP-712 and EIP-1271 signatures
- Adding support for multiple RPCs per chain
- Build a dApp for users to support Arena X
- Add code to showcase how searchers and builders for Arena X can look
This project is licensed under AGPL-3.0-only.
This is experimental software and is provided on an "as is" and "as available" basis.