What is Aori?
April 10th, 2024

Published in collaboration with Shoal Research

Aori: A New Paradigm to Market Making Protocols

Part 1: Introduction

Aori is an orderbook DEX that aims to enable efficient on-chain markets through a non-custodial HFT environment that benefits market makers and takers alike. We are part of an emerging shift in DeFi towards leveraging off-chain infrastructure to enable greater capital efficiency and user experience on-chain. Outsourcing various computational logic off-chain has enabled projects like CoWSwap, 0x, 1inch Fusion, and now Aori, to offer users better price settlement on-chain than traditional AMMs. The internalization of MEV profits, as formalized by OFAs, represents a significant paradigm shift in the dynamics between retail users and sophisticated market makers, searchers, and other resourceful on-chain actors. By providing powerful infrastructure for market makers to efficiently operate in a non-adversarial manner, Aori empowers traders through better price settlement in turn. However, in order to fully understand the significance of Aori, it is beneficial to understand the history of market making and the problems we have set out to solve.

Market Making 101

To understand Aori, it is key to understand market making which is the act of buying and selling assets in a structured manner for the purpose of injecting liquidity and trading volume into markets. Market makers ultimately seek to create efficient markets to incentivize trading activity, and in turn earn a profit on the difference between the highest price to buy and lowest price to sell a given asset, otherwise known as the spread.

Since market making is a resource-intensive operation that requires access to low-latency information and significant amounts of capital, the practice is dominated by financial institutions such as hedge funds and trading firms. Formally, the SEC defines a market maker as “a firm that stands ready to buy or sell a stock at publicly quoted prices”.

Market makers pay to trade against retail or “uninformed” flow, providing commission-free trading services to users in turn. This is known as Payment For Order Flow (or PFOF), and has proven to be a highly lucrative business for firms like Robinhood, which generated $185m in “transaction-based revenue” in Q3 2023 alone, and had earned 75% of its 2020 revenue ($959m) from PFOF alone.

Market makers play a critical role in maintaining efficient markets, though historically a majority of retail order flow has been and remains concentrated among a small group of market makers, placing the majority of value generated by financial markets into the hands of a select few entities. According to the SEC, over 90% of “marketable orders of individual investors” in the US are routed to a small group of just six market makers, otherwise known as “wholesalers”.

In other words, retail is actively trading against multi-billion dollar hedge funds like Citadel.

Market-Making in Crypto: 2009 - Present

The first cryptocurrency exchanges and market makers emerged once Bitcoin started trading. As trading activity for Bitcoin picked up, professional market makers like Jump Trading and Cumberland Mining emerged to begin offering specialized market making services.

The first iterations of DEXs, or smart contract trading platforms, like EtherDelta and 0x, used an order book mechanism, which relied on specialized market makers like Wintermute and SCP to provide liquidity and facilitate trading.

Uniswap And The Birth of The AMM

In 2018, Uniswap V1 launched, introducing the first Automated Market Maker (AMM) design for crypto. By replacing the order book with liquidity pools, and market maker firms with code, the AMM design enabled anyone to deposit funds into a pool used for trading, ultimately fronting capital in exchange for earning trading fees on the utility of their capital.

Asset prices are determined by a deterministic algorithm which accounts for real-time market demand reflected by the asset ratio in a liquidity pool. This is known as the Constant Function Market Maker (CFMM) which prices assets according  x * y = k , in which x and y represent each of the two assets in the liquidity pool, and k represents a fixed constant, demonstrating that the pool’s liquidity always stays the same no matter the value of x and/or y.  Liquidity could be provided to the pools permissionlessly - anyone could participate as a market maker by fronting capital to traders in exchange for a rebate on trading fees generated from said capital.

The AMM model was a success for protocols like Uniswap, and consequently Curve and Balancer, which dominate the majority of on-chain trading volume and TVL across the Ethereum ecosystem.

Yet, DEX volumes still pale in comparison to CEX volume, indicating that the quality of onchain markets is still in dire need of proper long-term optimizations.

AMMs can incur greater slippage to traders as they will receive a quote based on current market conditions, an external force beyond their control, as opposed to the flexibility of limit orders, which enables choosing the specific price they would like to buy or sell an asset at. Therefore, a large swap made on a low-liquidity pool will incur significant slippage, creating an inefficient and unattractive market for all participants involved.

LVR

As we have alluded to, AMMs face numerous inefficiencies, but perhaps none greater than reporting stale prices for traders. Given the isolated nature of blockchains and how data flows onchain, it is virtually impossible for the price of an asset on an AMM to be accurate with that of a CEX. This creates lucrative arbitrage opportunities for assets being traded both on and off-chain.

Loss-versus-Rebalancing, or LVR, is essentially a quantitative measure of the cost of providing liquidity on an AMM.

To simplify, consider an AMM quoting ETH at a price of $2000, while the market suddenly rips and the price hits $2500. Arbitrageurs will then purchase discounted ETH at $2000 from the liquidity pool, and sell at $2500 on a CEX to net $500 in profit. Given the 50/50 asset ratio which must be maintained in a liquidity-at-all-times by design, this buy pressure then forces the liquidity pool to rebalance, costing LPs the difference between the AMM price and the CEX price.

Democratizing Order Flow: DeFi’s Opportunity

Decentralized finance (DeFi) presents an opportunity to democratize the state of order flow in markets and create a financial system that benefits all participants more equally than asymmetrically. DeFi’s liquidity, volume, and the vast number of different assets traded onchain exemplify the extent of the global demand for trading, which goes far beyond what a small number of firms and entities are capable of serving.

Though significant strides have been taken, and the trillions of dollars cumulatively traded on Uniswap cannot be neglected, the fact remains DeFi has to this day lacked the appropriate tooling and services to break free from the centralizing forces of PFOF in TradFi and to truly democratize order flow and financial markets.

In fact, research from the Flashbots team demonstrates the convergence of order flow closely resembles that of PFOF in Tradfi.

Source: orderflow.art
Source: orderflow.art

Firms SCP and Wintermute, which run PLM and Rizzolver respectively, filled over 75% of ETH/BTC trade volume on the top four order flow sources on Ethereum.

Furthermore, these firms make up a large majority of the block market on Ethereum as well, as builders rsync and beaverbuild, which are also run by our favorite market makers, make up 16.1% and 34.6% of the blocks produced on Ethereum.

MEV: A Feature, Not a Bug

Though AMMs in theory democratized access to market making operations, they created newer problems in place, perhaps none more prolific than toxic order flow, which has grown to be associated with Maximal Extractable Value (MEV).

In short, MEV bots front-run transactions pending in the public mempool (all trades made on an AMM are routed to the public mempool by default) by paying a higher tip to block builders to receive top-of-block priority, enabling them to reap lucrative trades at the expense of the original trader by exploiting information asymmetries.

Though this practice has often been deemed predatory, we argue that it is ultimately just a result of market inefficiencies. Simply put, deep liquidity brings over more traders to a market, which shifts the utility of MEV from asymmetrical value capture carried out at the expense of unsuspecting traders, to a necessary function of an efficient market in which all participants benefit. Arbitrage, which constitutes the majority of MEV capture today, helps narrow the bid-ask spread to create fair and stable pricing for traders.

Therefore, Aori believes that in order to facilitate more efficient markets for DeFi, the proper tooling and services must be available for the actors who provide critical liquidity services to these markets.

Just-in-Time Liquidity

What if LPs were not required to actually hold an LP position (and thus bear the risk of impermanent loss) until said liquidity was required to be used for a trade? What if they could earn additional yield on their capital via lending, staking etc instead of being subject to impermanent loss, which is practically guaranteed?

Uniswap defines Just-In-Time (or JIT) liquidity as a “special form of liquidity provision where a liquidity provider mints and burns a concentrated position immediately before and after a swap”. In short, LPs monitor the public mempool for lucrative pending transactions, and then generate an intra-block profit by providing and withdrawing liquidity immediately before and after the trade goes through.

Or to break it down step by step, an LP:

  1. Detects a pending swap in the public mempool.

  2. Adds liquidity to the Uniswap pool that the swap will go through immediately before the swap happens, usually concentrated by the specific tick as well.

  3. Swap is executed, LP receives a fee in return for providing liquidity to the swap.

  4. LP then removes the liquidity and fees accrued immediately after the swap.

This dynamic in theory benefits the LPs by removing the risk of impermanent loss, and benefits traders who receive better pricing as a result of deeper, concentrated liquidity available at the time of execution.

We at Aori strongly believe that if appropriately designed, JIT liquidity provision can be a new paradigm in DeFi, which benefits all market participants over time. As such, Aori seeks to make the most of JIT liquidity innovation by implementing Virtual Limit Orders in its trading protocol, requiring capital only once a taker (or trader) has signed to take the other side of an order placed by a market maker. This enables market makers to compound their returns via lending, staking etc. prior to filling an order.

Why Aori?

Aori is built to address the many vulnerabilities of both centralized (CEXs) and decentralized (AMMs) trading venues today - users can mint options, trade ERC20 tokens, and access various structured products on Aori without compromising custody for capital efficiency and convenience.

That said, the DEX space has evolved a great deal. Uniswap and the AMM was a revolutionary breakthrough for DeFi, replacing human market makers with mathematical formulas and code. However, it has become evident that passive liquidity provision is above all - not a highly profitable endeavor. Teams in the ecosystem have caught on, and the shift towards a more active style of liquidity provision, namely JIT liquidity, is underway. Aori is grateful to be part of this shift, and aims to improve the DeFi liquidity landscape for all by catering to market makers first.

The Aori Advantage

Aori provides market makers and traders with a suite of key features to help ensure operations are seamless and profitable, namely gas-less order creation and cancellation, direct on-chain settlement without the need for any bridging, protection against toxic order flow, and more. Through these measures, we aim to foster accessible and efficient on-chain markets for all participants.

Where existing request for quote (RFQ) protocols like CoWSwap, 1inch Fusion etc have focused on the trading experience for market takers, Aori seeks to work on the flipside; providing the best trading experience for market makers in DeFi while helping plug their liquidity into the protocol for deeper overall liquidity.

Part 2: Protocol Mechanics

The Aori orderbook protocol flow can be summarized as follows:

  1. Maker creates a limit order at a given price. Limit order contains a signed message stating the assets offered and assets to be received.

  2. Taker attempts to fill the order by signing a limit order that mirrors the original order.

  3. Taker’s signature is propagated for the Maker to be settled on-chain via the Aori settlement contract. Maker receives both the original signature and the taker’s signature, plus an additional server signature which is used to sign off on order’s start/expiry time, chain ID, and matching of Maker <> Taker orders.

  4. Makers ultimately get the last say in whether they want to place an order they previously created; though they are penalized if orders aren’t settled by the set block deadline time.

To gain a better understanding of what makes Aori so powerful, it helps to unpack the various components of the protocol that come into play.

Trading: A Symbiosis of Makers & Takers

On Aori, anyone can choose to make or take orders. Makers can either select a private counterparty as a taker, or submit their order to the public UI for anyone to fill.

While a standard on-chain transaction on an AMM like Uniswap forces the user to select their liquidity source, Aori is part of a number growing of teams that are utilizing intents; signed messages that state a desired outcome (swap X for Y) while outsourcing the execution to market makers who compete to find the best optimal route for that trade. Limit orders are a premier example of intents, and they offer Aori numerous benefits such as concise trade information, zero slippage on trades, and an overall better user experience for both retail traders and seasoned institutions alike.

Virtual Limit Orders - No upfront liquidity required

Aori takes limit orders one step further by enabling “virtual” limit orders - market makers can place orders even without upfront liquidity available at the time, as liquidity is only required at settlement time. The matching of trades (as well as price pre-confirmation) occurs in real-time, meaning the price to be settled on-chain will be available to both parties.

  1. Maker creates public order for 1 ETH at 2000 USDC.

  2. While order sits in the orderbook, Maker can leverage trade, stake, lend etc with their liquidity.

  3. Once a Taker fills the order, the Maker can then pull funds just-in-time (JIT) from their own inventory or via flash loan.

Last Look Orders

Another critical feature that makes makers truly first-class citizens on Aori is the “Last Look Order” function. This refers particularly to the fact that a maker can take a “last look” and choose to accept or reject an order after a taker has filled it. This protects the maker as it ensures they will not fall victim to toxic flow at the time of settlement due to unforeseen changes in the onchain environment since placing the order, and avoids dealing with externalities like block building or pool fee tiers.

Settlement with PiraSea

Source: Aori
Source: Aori

Front and center in powering Aori is Pirasea, Aori’s settlement infrastructure.

Pirasea helps Aori optimize for many of the key features to market makers and traders, while retaining the renowned security properties of the original smart contract:

  • Censorship Resistance: orders contain important details and user-generated signatures for these details, ensuring no external actor can alter the order upon creation.

  • Guaranteed Exclusivity to Trade: Trade settlement requires three inputs - 1) order details, 2) user signature, 3) server-generated signature. This ensures only intended parties execute orders within specified parameters.

From a user perspective, utilizing Pirasea for managing order placement and execution enables gas-less trading, traditional limit order dynamics, and direct on-chain settlement all while retaining custody of assets up until execution. Pirasea builds on Seaport’s security guarantees of not being able to steal user assets, by merely providing a matching engine for makers and takers. It is not possible for Aori to edit or steal orders in any way, ensuring the orderbook remains trustless and decentralized.

That said, the intent layer is not confined to the Pirasea architecture by any means, and Aori intends to keep an open mind and monitor future developments in the intents landscape in case better alternatives come around. At a base level, the intent-layer must ensure the user's signature is both deterministic and unique as this is paramount to protocol security.

Part 3: MEV and Aori

Creating Good MEV

We believe MEV is one of the most misunderstood phenomena in DeFi, and is moreso an externality of inefficient protocol designs (i.e. 12-second block times, AMMs, etc). In many cases, MEV can actually be beneficial to the ecosystem - arbitrage can help stabilize prices over time, and liquidations help keep margin protocols nice and healthy. Order Flow Auctions (OFAs) are an emerging protocol design in which MEV profits are internalized and value is returned to the end-user.

Aori is designed to further enable MEV searchers to continue creating net positive value for the end-user, instead of looking for ways to restrict their performance and profitability.

Compared to existing intent-centric architectures like CoWswap, where solvers compete to provide the best price settlement for traders and are only compensated if they “win” the auction for the right to execute the orders, Aori enables market makers to essentially capture MEV against other on-chain venues using Aori orderbook liquidity. As competition among makers and searchers increases, pricing of orders becomes more competitive, which over time converges to value returned to Aori traders by the internalization of MEV profits.

It is important to note, however, that limit orders placed on Aori follow a set of predetermined conditions surrounding the value to be exchanged and the parties involved; they are not routed through the public mempool and therefore are not subject to frontrunning, sandwiching, etc. themselves.

MEV Strategies with Aori

“Flash market-making” - the ability for makers to provide JIT liquidity for settlement - means orders can be created without upfront liquidity available. This function enables a number of different trading strategies that can be implemented in conjunction with Aori to capture additional profits.

Makers

When a taker fills an order, the maker can unwind their position on another venue; profit can be captured through different forms of arbitrage such as atomic, cross-chain, and CEX-DEX arbitrage. This is what we refer to as Delta neutral market making; other more complex and traditional strategies that makers can implement include Scalping and Stoikov Market Making, both of which involve simultaneously placing both bids and asks on a market, e.g. ETH/USDC.

Takers

Takers on Aori also have a number of strategies for profit at their disposal after they lock in a price on an order. The resulting rate from a trade can be used for routing orders on CoWSwap, filling a Dutch auction limit order on 1inch Fusion or UniswapX to capture the resulting spread, or simply executing CEX-DEX arbitrage.

Recall from earlier that makers still possess the ability to turn down or cancel an order even after it has been placed. However, this does not imply takers are left empty-handed or unrewarded; on Aori a taker can still settle the original trade on-chain to capture MEV profits irrespective of the maker’s final decision and the original profitability of the trade for the maker.

Part 5 (Closing): Future Roadmap, How Aori fits into the broader context of DeFi

By providing a non-custodial, high-frequency orderbook, an ecosystem of innovative applications and use cases can be built on top of Aori to further bolster the onchain economy. Any token can be permissionlessly traded through Aori, giving protocol designers and builders the capabilities to leverage Aori as their liquidity layer to build on top of in a seamless manner. Price pre-confirmations offer them an overwhelmingly improved experience when trading on-chain and easier risk management, giving way to innovations like:

  • Market-making vaults: ERC4626 vaults enabling retail users to LP into an array of market making strategies

  • Derivatives Exchange: ERC20s, ERC721s, and ERC1155s are all currently supported on Aori. Orderbook means projects don’t have to worry about the complexities of pricing by an AMM convexity curve

  • MEV-Capture Vaults: stake to earn base yields on underlying lending protocols, while redeeming intra-block to execute profitable MEV arbitrages across AMMs. Vault retains both base yield from lending and additional arbitrage profits.

  • Execution Management Systems: Institutional-grade EMSs can be built on top of Aori to leverage price pre-confirmations in order to offer more efficient trading experiences for hedge funds and other large clients. Similarly, retail-focused products like Telegram bots can plug into Aori for pricing to provide their users with more certainty on price at settlement.

We are firm believers that the future of trading entails implementing the best tried and true practices from TradFi, into the fundamental innovations created by blockchains and smart contracts.

Stay tuned for updates on Aori today at https://x.com/aori_io

Subscribe to Aori
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.
More from Aori

Skeleton

Skeleton

Skeleton