Veax DEX Architecture: Combining concentrated liquidity and multiple fee levels for the best prices

Press release
Published
January 31, 2023

Decentralized exchanges (DEX) are the cornerstone of the multi-billion dollar DeFi ecosystem. Veax provides a robust DEX implementation that is capital efficient and minimizes impermanent loss. To do this, Veax combines these two features:

  • Concentrated liquidity.
  • Multiple fee levels.

#1 Concentrated liquidity

Concentrated liquidity is an AMM (automated market maker) model that was popularized by Uniswap v3. In this model, liquidity is allocated within a custom price range. In the x*y=k model, the liquidity was distributed uniformly through the entire price range. In this new model, you can choose the price range where you want your tokens to be allocated. For example, an LP may allocate their tokens in the $20-$30 price range. LPs only receive rewards if the token price is within this range.

There are several advantages to this approach:

  • Allocates liquidity more efficiently
  • LPs can earn more fees for fewer tokens deposited.
  • Traders can experience less slippage due to liquidity differences.
  • Trade execution is faster since a large amount of capital is provided by fewer LPs.

As you can see, the concentrated liquidity model has plenty of advantages and has been widely adopted by DEXes for its versatility when dealing with both volatile and stable assets. This is why Veax has adopted the concentrated liquidity model to fulfill this vision.

However, there is a major flaw with the concentrated liquidity model – impermanent loss. As per a study by IntoTheBlock, providing concentrated liquidity in a specific price range increases potential impermanent loss, despite making the whole process more capitally efficient.

To counteract this, Veax implemented multiple fee levels.

#2 Multiple fee levels

Any exchange, decentralized or otherwise, must define a "fee" for each trading pair. These fees are used to economically incentivize liquidity providers. DEXes can choose one of the following fee models:

  • Fixed fee: A predefined number, as decided by the protocol. For example, Uniswap V2 had a fixed trading fee of 0.3% for all pairs.
  • Dynamic fee: A fee that continually changes based on market performance
  • Governance: A number set by a majority of the governance token holders.
  • Free market: LPs the fee they want to pay given the available range 

The fixed and dynamic models are extremely limited, while the governance approach creates a conflict between traders looking for short-term value and liquidity providers looking for long-term gain. By the process of elimination, the obvious model to choose is the “free market” approach.

This approach works for both traders and LPs since:

  • Traders have the best swap conditions.
  • LPs can choose the fee level that’s the fairest.

How do you choose a fee level?

LPs are free to choose a fee level. As with anything, there are pros and cons in selecting a high or a low fee level:

  • Low fee level: If an LP sets a low fee level for their pool, they will attract more activity. However, their ROI will be less.
  • High fee level: If the LP sets a high fee level, it will get higher relative profits, but the utility will be low.

This competition between different LPs will eventually bring the transaction fees to the fairest level. This “fee equilibrium” is dependent on various factors, such as:

  • Long-tail pairs: Exotic tokens with low volume and high volatility require high fee levels to compensate for the impermanent loss.
  • Popular stablecoin pairs: These have high volume and low volatility and require low fees so that the DEX remains affordable for everyday users.
  • Strong buy trend: Reduces liquidity of the pairs and increases impermanent loss. The fees are increased to compensate the LPs.
  • No trend: LPs reduce the fee level to ensure that the DEX remains competitive.

Can you change the fee level?

It’s not possible to change the fee tier of an existing position because:

  • The positions are immutable.
  • Each position has a specific ratio of tokens in it.

To change fee tiers, LPs must close existing positions and open new ones.

Veax vs Uniswap V3: Multiple fee level implementation

Uniswap isn’t precisely offering their LPs multiple fee levels. Instead, they provide multiple pools per liquidity pair with different fee levels. So, let’s say we have the DAI/USDC pair. Uniswap V3 provides us with four DAI/USDC pools with a unique fee percentage – 0.01%, 0.05%, 0.3%, and 1%. 

An LP should be able to choose the fee percentage and provide liquidity to any pool they want. However, in practice, LPs would be more incentivized to give liquidity to the most popular pool.

Why is that the case? The profits collected by an LP roughly follow this formula:

Profits = Fees - Impermanent Loss.

So, the profit generated is directly proportional to the fees collected, which is directly proportional to the frequency of pool usage. In simpler terms, if an LP provides liquidity to a popular pool, the increased usage will generate more fees and profits.

Also, note that in this formula, the only factor within an LP’s control is the Fee range. The spot price directly determines impermanent loss. However, Uniswap’s multi-pool solution doesn’t encourage LPs to choose their preferred fee percentage. It ultimately boils down to LPs providing liquidity to the most popular pool.

So, how does Veax fix this conundrum? By offering multiple fee levels within the same pool. 

Each pool in Veax offers 8 different fee levels for each pool, with fees ranging from 0.01% to 1.28%.

LPs may select any fee level for their positions. This approach is far more advantageous for both LPs and traders.

For LPs 

  • LPs have far greater control over the fee rate they impose on their liquidity.
  • LPs in other Dexes are incentivized to move liquidity to the pool where the product of trading volume is maximal. However, unequal access to volume creates a situation where more liquidity -> less price impact -> more volume -> more liquidity.  Because of this, LPs and traders are stuck in suboptimal local extremum. In Veax, traders can't choose which fee tier they can trade, which breaks this feedback loop (since less price impact doesn't lead to more trading volume). This leads to more profits for LPs.

For traders

  • Veax guarantees the best possible swap price, no matter what. For example, if achieving an efficient swap requires using liquidity from five different fee tiers, Veax will enforce it to carry out the trade. In this hypothetical scenario, these five fee tiers receive volume/fee/profit from the single swap. This differs from the Uniswap V3 scenario, where “unpopular” tiers receive volume only when arbitrage becomes possible and profitable. Simply put, in Uniswap, arbitrage across fee tiers happens occasionally. While in Veax, arbitrage occurs on every single swap.

Processing efficiency

As mentioned above, each liquidity pair in Uniswap V3 has four pools which require a dedicated smart contract. This dramatically increases the cost of transactions and required processing power. In Veax, all fee levels are managed in the same smart contract – reducing the cost of transactions and simplifying swap implementation.

Plus, by building on Near Protocol, our developers have far more flexibility when implementing complex and sophisticated processes without incurring massive gas fees.

In Closing

By combining concentrated liquidity with multiple fee levels, Veax gets all the advantages of the former without falling prey to its biggest flaw – higher impermanent loss. In addition, by providing true fee levels to each pool, instead of implementing multiple pools for each pair, Veax drastically reduces processing time and fees. All these factors combine to make Veax one of the most efficient and affordable DEX implementations.

NOTE: Unlike Uniswap, liquidity positions in Veax aren't minted as NFTs yet. However, for all intents and purposes, Veax liquidity positions act as NFTs since they are non-fungible and immutable.