The secret edge of oracle based AMMs (Swaap at EthCC)

Source: https://www.youtube.com/watch?v=bySxJeA2i3A

The secret edge of oracle based AMMs (Swaap at EthCC)

MEV (Maximal Extractable Value)

Users submit transactions → Actors reorder/include/exclude transactions → Block validated with value extracted

Types of MEV:

  • Front-running: Inserting a transaction before the victim's
  • Sandwich attack: Transactions placed before and after the victim's
  • Arbitrage: Exploiting price discrepancies between exchanges

Uniswap and Constant Product AMMs pricing is based on reserves of two assets (e.g., USDC and ETH)

The pricing model relies on arbitrageurs to actively set prices, so it generally lags behind market price

Oracle-based AMM for on-chain implementation (4:30)

Swaap is an Oracle-based AMM, meaning that price feeds are provided by oracles

Their goal is to provide a solution where user can have a better performance with holding an asset rather than being a liquidity provider on AMMs.

The main challenge is the difficulty in onchain heging. Swaap's solution to this challenge is the fee adjustment based on inventory's distance from holding

Comparison of inventory evolution

Uniswap in a price increase scenario:

  • Depletes ETH inventory, increases USDC inventory
  • Deterministic relationship based on market price
  • Tends to keep less of the appreciating asset (ETH)

Swaap in a price increase scenario:

  • Maintains the same reserve levels
  • Oscillates around the initial reserve

Swaap's inventory management mechanism aims to oscillate around holding inventory.

It uses markup on top of mid-price, and larger swap sizes incur higher markups. So it adjusts fees to favor trades that bring inventory back to HODL to discourage moving far from HODL).

Swaap reduces fees for trades that balance the inventory, and increases fees for traders that move away from the markup

Swaap's dynamic pricine mechanism (8:50)

Real-life Example: ARB-USDC Pool

  • Blue line: Price evolution of the pair (declining trend)
  • Orange line: Inventory imbalance (oscillating around zero)

So we can see large, short-lived spikes in imbalance. Above zero, USDC tokens are in excess. And below zero, ARB tokens are in excess

In declining markets, inventory tends to be on the "right side" more than 50% of the time

What does that mean for yields?

This phenomenon increases APR (Annual percentage rate) by a few percentage points. Those APRs can vary between pools, but are generally significant. In the end, MEV (Maximal Extractable Value) is benefiting Swaap

Example: ETH price goes from $1.000 to $1.500 but with no trades on Uniswap.

There is an arbitrage opportunity:

  1. Arbitrageur buys ETH from Uniswap (at lower price)
  2. Sells on an aggregator or other platform
  3. Some ETH is then sold on Swaap (at higher price)

This ultimately increases ETH inventory on Swaap, and depletes ETH inventory on Uniswap

The reason about it that Uniswap prices often lag behind real-time market prices. This lag creates frequent arbitrage opportunities, albeit at smaller scales than the example

Swaap benefits (13:00)

Long story short, Swaap does not suffer from impermanent loss due to absence of constant product formula

Furthermore, yields are measured net, while the impermanent Loss must be taken into account for other AMMs

Introduction of Swaap Earn

Swaap Earn is designed for passive LPs (Liquidity Providers). It offers single asset exposure, a feature popular in crypto markets

Swaap Earn utilizes AAVE for market making

  1. DeFi user provides a single asset (e.g., ETH)
  2. Part of the ETH is supplied to AAVE
  3. AAVE is used to borrow the missing asset for the Swaap Maker pool
  4. Borrowed asset joins the liquidity pool

This allows efficient Liquidity Management. Only necessary liquidity is provided to the Swaap Maker pool, while excess liquidity is kept on AAVE or used for other purposes.

So the LPs profit from market-making yields and get additional yield from AAVE supply (boosted pool)

There is a possibility of nesting multiple pools for excess ETH:

  • Supply to other pools
  • Recursive staking
  • Recursive restaking

Questions & Answers

Can you tell me what APRs are you experiencing with the passive LP experience, and how much capital are you managing through this?

It's live but in MVP (Minimum Viable Product) stage. The current APY is around 10% with $1 million USD equivalent in ETH in the pool.

What are the limitations on assets you can put into these pools? Are there requirements on Oracle availability and latency?

Customized Oracle feeds are used. Swaap is not using Redstone or Chainlink directly, but a custom Oracle using a mix of sources

The main limitation is that it's not suitable for very long tail assets. Swaap focuses on blue chip assets like ETH, USDC, USDT, and L2 tokens (ARB, OP)

With Uniswap integrating RFQ (Request for Quote) with concentrated DEXs, don't things become more efficient now and you don't need an Oracle Based AMM?

Swaap is also an RFQ system. The main advantage of Oracle Based AMMs over constant product formula AMMs is the elimination of impermanent loss or Loss versus rebalancing