Dexter v1 Deep Dive — Curating the best AMMs

Dexter
Dexter Zone
Published in
5 min readJan 26, 2023

Dexter has traveled far and wide and knows a lot about AMMs, and now brings all the wisdom into building his AMM base on Persistence Core. Let’s dive into the blueprints!

AMMs have revolutionized markets by allowing users to trade anytime without needing a counterparty. Pioneered by Uniswap in 2018, they serve as an essential building block in DeFi.

Dexter v1 will bring tried and tested AMM mechanisms to the Interchain, inspired by the best innovations in all of DeFi, and will support assets from other IBC-enabled chains.

At launch, Dexter would feature the following types of AMMs -

Stableswap — Inspired by Curve

A stableswap is an automated market maker (AMM) optimized for similarly priced tokens and provides minimum slippage and efficient liquidity provision.

Constant product AMMs are useful for price discovery since moving on the curve in either direction will affect the price of each asset. However, this price curve makes it difficult to swap closely pegged assets, which should theoretically trade without affecting each other’s price.

The constant sum pool (X + Y = K) has no slippage but can run out of liquidity when the pool is imbalanced on one side. The constant product pool (X*Y=K) has slippage but can always maintain liquidity since the price of an asset increases with the demand.

Stableswap combines the constant product and constant sum functions to achieve minimum slippage and provide a balanced pool. This function acts as a constant sum when the pool is balanced, providing low slippage trades, and shifts towards a constant product as the pool becomes more imbalanced to ensure the pool never runs out of liquidity.

Stableswap on Dexter will support liquid-staked assets, which are highly correlated with the underlying staked assets. Liquidity for these assets would boost their utility in DeFi.The stableswap will facilitate low slippage trades for assets like stkATOM and stATOM with base assets like ATOM. This will allow stakers to instantly redeem their staked assets by swapping their liquid-staked assets into the base asset.

Bridges like Axelar and Gravity are pouring massive amounts of stablecoin liquidity to Cosmos from Ethereum and other ecosystems. Moreover, with the rise of native stablecoins like IST and SILK, along with USDC coming up natively on a consumer chain with Interchain Security, stableswap would serve as a vital part of the Cosmos DeFi ecosystem.

By supporting these assets, Dexter aims to become the liquidity hub for yield-generating assets and stablecoins in the Cosmos ecosystem.

Stable -3/5 Pools

Dexter will also support stableswap pools with more than two tokens, like Curve’s 3pool, which provided enormous liquidity for three top stablecoins in DeFi — USDT, USDC, and DAI. Stable 3/5 pools on Dexter would support 3 to 5 highly correlated assets.

The liquid-staking landscape in Cosmos is diverse, with multiple players like pSTAKE, Quicksilver, and Stride. Stable — 3/5 pools on Dexter would support liquid-staked assets from all these zones and facilitate low slippage trading between these assets.

For example — stkATOM/stATOM/qATOM

Weighted Pools — Inspired by Balancer

Dexter will support a custom weighted pool AMM mechanism inspired by Balancer, which allows users to create a custom pool of assets and choose their weightage for each asset, such as pools with 60/40 or 60/20/20 weightage, in contrast to the constant product AMM mechanism, which only offers 50/50 weightage. This pool type supports up to 8 assets in a single pool.

Pools that weigh one token heavily offer a significant improvement in terms of impermanent loss to the user compared to 50–50 pools. Impermanent loss is significantly less for highly imbalanced pools like 95/5, but this leads to high slippage due to low liquidity for one of the assets. Weighted pools allow users to customize their exposure to assets and maintain a balance in impermanent loss.

Source — Balancer Docs

Weighted pools with more than two assets would allow traders to trade multiple combinations of assets on a single pool, saving them the swap fees to be paid on multiple swaps.

Fees on Dexter

There are two primary types of fees traders pay on Dexter —

  • On-Chain Transaction/Gas Fees
  • Swap Fees

Transaction Fees

Transaction fees are paid by any user to post a transaction on the chain. The transaction fee is distributed to XPRT stakers on the network as block rewards.

Swap Fees

Swap fees are charged to all traders performing swaps in any of the pools available on Dexter. Swap fees are calculated as a percentage of the swap amount specific to each pool. Swap fees are charged on the input asset of a swap (So if a user swaps ATOM for XPRT, they pay the swap fee in the form of ATOM). The default fee is set to 0.3%, which is a configurable parameter. The swap fee will be distributed between liquidity providers and protocol treasury.

Conclusion

Dexter v1 features tried and tested mechanisms, including weighted pools, and stable 3/5 pools, to facilitate efficient trading for yield-generating assets. Dexter would continue to explore more innovative AMM mechanisms and keep building upon its base in the future.

Join our Discord to be a part of our community, and follow us on Twitter and Telegram to stay tuned.

--

--