DX25, the dex of reality.

Captain RoXtar
17 min readMay 7, 2023

--

Summary :

Beginner level (Chiller)
1- Introduction
2- Participate inthe devnet event
3- 1000XP per day tutorial

Advanced level (User)
4- General principles of a CLMM
5- Strategies
6- Devnet case study
7- Features of the devnet
8- Perspectives
9- Conclusion

1- Introduction

I am pleased to share with you this long article, DX25 deserved no less, I hope you will find it useful.
The first part of this article is for chillers, who want to take their share of the event’s rewards, you will find a step-by-step tutorial, so you don’t miss any registration procedure, and find your way on this exotic platform.

For the more advanced or curious users, who like me only knew the classic AMM, I tried to explain as best as I could what a CLMM is.
I also added a detailed explanation of all DX25 features, as well as the perspectives I could discern.

Wishing you a good reading !

Captain RoXtar

2 Participate inthe devnet event

I’ll start with what most people will be interested in: how to participate in devnet to get beta tester rewards.

You have to start by registering on different platforms:

You will need a MultiversX wallet to do this, if you don’t have one yet, you will find them in the next chapter.

Next, here is the list of tasks to perform, and the number of XP points associated with them:

Make a swap — 100 XP
Add liquidity — 250 XP
Close the position — 100 XP
Collect a reward — 100 XP
Bug reports — 1000 XP

You can’t earn more than 1000 XP points per day, whether it’s making 10 swaps, or opening 4 positions it’s all the same.

However bug reports are unlimited and can be added to the 1000 XP points earned daily.

Bug reports are done on the DX25 Discord, scroll down the right column, create a ticket to write your report.

Don’t forget to include your test ERD address, screenshots, and a brief description of the bug.

3- 1000XP per day tutorial

Disclaimer:

The devnet is a test environment, not to be confused with the mainnet, which is the real MultiversX network.

MultiversX wallets are functional with the same ERD address on the devnet, the testnet, and the mainnet, no need to install a specific wallet, the change of network is done automatically by connecting to a dApp, depending on the network where it is deployed.

  • The requirements

1- A wallet :
I recommend the DeFi wallet, the most ergonomic for this exercise, however let me introduce you to the three options available to you:

  • xPortal : the mobile application, simply the best all in one wallet, user friendly, with a very nice design. This link includes a sponsorship, it’s a way to encourage my work. Welcome to MultiversX.
  • Devnet Web Wallet : Create a JSON file, save it in your computer, define an access password. You will just have to drop the JSON file on the login interface and type your password to access it.
  • DeFi Wallet : the equivalent of a Metamask, a browser extension, as the name suggests, to sign dozens of DeFi transactions, it remains the most practical and efficient.

Be careful, the 24 words that will be proposed to you are to be written down by hand on paper, and to be kept carefully. If you lose them, you will never have access to your wallet again, if it contains funds they will be lost, if someone can access it in your place he can take control of your wallet, steal from you, or do something stupid with it.

2- Gas:

Transactions on the blockchain are paid for with gas. This is the main purpose of the native corner of any blockchain, here EGLD.

In order to avoid abuse, and to limit the use of the infrastructure to what is necessary, each action has a gas cost, think of EGLD as a fuel to move on the MultiversX highway.

On the devnet, we talk about xEGLD, to avoid confusion.
You can claim 30xEGLD per day on
the Devnet Web Wallet.

Connection possible via JSON file (keystore), xPortal, and DeFi Wallet
Click on “Faucet” in the left column
Click on the captcha, then on “Request Token”, and here are 30 fresh xEGLD.

It may be that the faucet is empty, in case of high influx of testers on the network, in this case do not hesitate to send me a message on the Entity Telegram group. Ask for Captain RoXtar, I will send you 1 xEGLD to pay your transaction fees on the devnet.

3- Test tokens :
In order to be able to evolve on the DX25 devnet, you will need “fake tokens” , in order to be able to run the different tools.

Click on the “Faucet” tab, select one of the proposed cryptocurrencies, sign the transaction with your wallet.

You can claim up to 1 million units at a time, there is no point in abusing it, but there is no limit.

You have become the Michael Saylor of Devnet.
  • Make a swap — 100 XP

Nothing could be simpler, click on the “Swap” tab, select at the top the asset you wish to sell, at the bottom the one you wish to acquire, enter the desired amount at the top, or at the bottom, click on Swap, and sign the transaction with your wallet.

  • Add liquidity — 250 XP

A little more complex, but nothing impossible. Click on the “Pool” tab at the top of the page.

Click on “Add new position”
In “Select exchange pool”, enter a different asset on each side
Enter an amount in “Deposit amount”, then on “Confirm adding liquidity”, sign the transaction with your wallet.
  • Collect a reward — 100 XP

Of course, you must have created a position beforehand, as explained above.

Click on the “Pool” tab, then click on the 1st row (wBTC ETH position)
Click on “harvest rewards”, sign the transaction
  • Close the position — 100 XP

Of course, you must have created a position beforehand, as explained above.

Click on the “Pool” tab, then click on the 1st row (wBTC ETH position)
Click on “Close position”, sign the transaction.

4- General principles of a CLMM

  • Impermanent losses

A subject that frightens and dissuades many users from committing to DeFi, we see many protocols claiming to “make IL disappear”, it is a real subject of debate in the Web3 sphere.

However, it is important to understand that in a financial market, in order for one person to make money, another must lose money, magic money does not exist, it is a zero sum game.

Understand that you cannot expose yourself to the market without exposing yourself to the risks of the market, it is to want to have your cake and eat it too, in other words it is impossible.

If there are stablewaps, offering pairs with assets that are supposed to retain roughly the same value, there will always be some IL left, and this is not applicable to volatile pairs containing two uncorrelated assets.

A Concentrated Liquidity Market Maker (CLMM), contrary to popular belief, does not decrease the IL, on the contrary it increases it tenfold.
High profits = high risks.

This is a constant to always keep in mind, as unavoidable as Newton’s law.

Newton’s law is hard, but it is the law.
  • AMM, operation and issues.

In an AMM such as xExchange, or OneDex, the liquidity provider provides the smartcontract with two tokens in equal proportion of value (50/50).

All the liquidity is combined into a single pool, called the liquidity pool.

The liquidity provider receives in return an LP token, which represents its share of the liquidity pool.

When a swap is performed, a trading fee is applied, which is added directly to the pool of liquidity.

When the liquidity provider returns its LP token to the smartcontract to retrieve its initial pair of tokens, it receives its share of the total value of the liquidity pool.
The trading fees added to the liquidity deposited by the liquidity providers allow them to theoretically recover more value than initially deposited.
Obviously, the market environment plays a huge role, you will recover more value if the market has gone up than if it has gone down.

When reclaiming his capital, the liquidity provider receives 50/50 of each token, the value of each having been able to evolve he will receive more of the token having lost its value and less of the token having appreciated.

The total value of the recovered assets can be lower than the initial value of the provided assets, if they had been kept separately: these are the famous impermanent losses.

Moreover, the liquidity provided to the protocol is distributed from plus infinity to minus infinity, according to the famous equation x*y=k .

Unlike an order book, which will only execute the trade if liquidity is available, an AMM will never refuse a trade.

However, slippage will mean that the more the trade unbalances the available liquidity pool, the more catastrophic the exchange rate will be, and the more violent the impermanent losses.

This is the actual income from trading fees, which can be seen on the “Liquidity” tab of xExchange
Not to be confused with the farm APRs paid in dex tokens

Since trading fees are rarely incentive enough, AMMs often offer farms, or deposit their LP tokens, in order to obtain additional returns.

However, this strategy cannot be eternal, if it allows to attract liquidity providers during the deployment of the AMM, these dex tokens quickly lose value.

Indeed, liquidity providers generally prefer to sell them, as they know that the crazy inflation due to high APRs, coupled with the lack of utility that these tokens often have, make them quickly lose their value.

The solutions for the sustainability of AMMs and the value of their tokens are complex, staking with long lock, advantages on APRs for those who stake, partnerships with other projects to bring more utility, decrease of the emission, etc…

These liquidity mining programs should be seen as a fuel to leave the Earth’s atmosphere. By this I mean achieving enough TVL (total value locked into the protocol) to attract whales, and allow them to trade large volumes without suffering from slippage, all of which allows for trading fees high enough to make liquidity provisioning profitable.

However, if the protocol does not manage to leave the earth’s attraction, Newton’s law obliges, it is the failure, the fall, and the death of the protocol.
Many called, few chosen.

It was therefore necessary to find another model that would allow to collect enough trading fees to avoid the problems linked to the dex tokens, to finally find a long term sustainable model.

  • CLMM, operation, risks and benefits

In a CLMM, liquidity providers do not expose themselves to infinity, but choose to expose themselves only to a range of exchange rates, called the “range”.

The liquidity provided is thus distributed, logically accumulated around the spot price, the further away from it, the less likely it is that the liquidity providers will be able to receive trading fees, and therefore the less liquidity is found.

A trader comes to sell massively his EGLD to buy USDC, the spot price moves. The EGLDs replace the USDCs, in the logic of a zero sum game.

The exchange rate remains the same for the trader, however, as there is less liquidity on the right side of the pyramid, they are shared between less liquidity providers, making the latter earn more trading fees.

Now let’s take a closer look at what the range is.

A liquidity provider may decide to concentrate his liquidity between $45 and $55 if the spot price is $50, which makes sense.

He deposits 5 EGLD for 250 USDC, which is $500 in total value at the time of the liquidity deposit.

As long as the spot price remains “in range”, between $45 and $55, our liquidity provider will receive trading fees.

If the price goes out of range, either way the liquidity provider will find himself “single sided”, in other words, he will no longer own a pair of tokens, but a single token.

Obviously, he will have collected the trading fees, but you can see that his impermanent losses will be much more violent than on a classic AMM.

As said before, high profits = high risks.
If concentrating your liquidity allows you to multiply your received share of the trading fees, getting out of the range excludes you from those who share it, while at the same time making you suffer the worst kind of impermanent loss: owning only the asset that has lost (or not gained, in the case of a stablecoin) value.

While this financial tool eliminates the need to rely on a dex token to induce liquidity providers to gain exposure, it requires real expertise, understanding, and anticipation of the financial markets, as well as constant monitoring to be used wisely.

This approach is halfway between trading and farming, it is not like on an AMM to let your liquidity sleep for months without touching it, by coming to collect once a week its magic dex tokens.

5- Strategies

  • Single sided trader (easy level)

The idea here is to provide liquidity “out of range”, so on a single asset, in order to take advantage of a market movement to sell well, or buy well.

For example you are ready to buy EGLD if it goes down between $40 and $45, so you open your position in this range with USDC.

If the spot price goes down to $39.9, you will have sold all your USDC, and in addition you will have collected the trading fees while the spot price is crossing your range.

Conversely, if you want to sell EGLDs if they rise between $55 and $60, you open your position in this range, if the spot price crosses it, you will have sold your EGLDs taking advantage of the momentum, while collecting the trading fees.

This strategy can be extremely profitable in the event of a big move, as little liquidity will have been placed there, so you will get a better share of the trading fees.

On the other hand, don’t sleep, you will have to cut the position, because if the market turns around, you will get your original asset back, not the one you were aiming for. You will, however, retain the trading fees collected by the rise and fall.

  • Follow the tide (professional level)

For this strategy, you need to get out of the investor mindset, and adopt the market maker one. Your goal here is no longer to speculate on the rise or fall in value of a particular asset, but rather to take advantage of trading volumes to take the lion’s share of the market.

The concept is to invest a sum of money, let’s say $1000, which you will place in a range defined by a thorough technical analysis.

You will have to watch the market like milk on fire, and be ready to cut your position, to readjust it at once on the new level of the momentum.

It is important to remember that sufficiently concentrated liquidity can significantly increase the income from trading fees.

6- Devnet case study

To compare the efficiency of the concentration of liquidity, and the differences in income, I had fun creating different positions with different ranges, on the pair wBTC USDT, always with 1000 wBTC

The liquidity in USDT varies according to the range determined, let’s leave it aside and see what it gives on the income in wBTC.

  • 1st line I have widened the range to deconcentrate liquidity

Despite a wide and secure range, we can see that I still earn more wBTC than on the classic AMM model

The IL is stronger than on the classic AMM model, but less than on the other CLMM models

  • 2nd line, I put an infinite range, on the classic AMM model

The least profitable of all my positions, obviously.

The IL is on the other hand better distributed between the two assets than on the custom CLMM models, and less than on the automatic CLMM model.

  • 3rd line, I reduced the range to overconcentrate the liquidity

The profitability explodes, it is much higher than its little sisters.

On the other hand, the IL is unequal between the two assets, and by far the strongest of all the scenarios.

  • 4th line, I let the protocol manage the range in automatic mode

A reasonable compromise, probably the wise way.
Our devs have talent.

A well distributed IL, however stronger than on the classic AMM model.

7- Features of the devnet

  • Swap

1- Adjust the slippage.

Click on the bars at the top right
Select a preset option, auto, or enter a number to customize.

2- Trading fees and swap effects.

Select a pair, enter the amount of your swap, click on the drop-down menu above the swap button.

Pool fee: exchange rate
Price impact: effect on the spot price
Slippage tolerance : how much slippage you are willing to accept
Receive at least : what you will receive after signing the deal

  • Pool

1- “Add new position”

A- Choose the type of position

Select a pair, then click on the “Concentrated liquidity” drop-down menu

Concentrated liquidity: provide two assets to farm in a range.
Full range: classic AMM.
Single sided liquidity: provide a single asset for a long or short.

B- Define your range

You can click on on at the bottom right, for a hybrid position where you cannot be out of range on either side.
You can adjust the range by yourself, to concentrate it more or less according to your strategy. Pay attention to the spot price in the upper right corner, so you don’t end up single sided if that’s not the goal.

B-Fee level

On the top left you can set your fee level. The line just below gives you an idea of where your competing liquidity providers are placed.

2- Details of an open position.

Click on one of your open positions

Initial liquidity: liquidity initially deposited
Current liquidity: the % in green or red shows what you have gained or lost on this asset (more exactly bought or sold)
Fee reward: your rewards to be collected
Historic fee rewards: history of rewards collected since the opening of this position

You will also find the spot price of the assets of the pair against each other, as well as the opening date of the position.

Coming soon, a nice overview of the liquidity placed on this pair, as well as your range.

  • Wrap
The Wrap tab is used to wrap the xEGLDs that you retrieve daily from the devnet Web Wallet.

The MultiversX blockchain is composed of several shards, this article does not aim to explain the consensus, just remember that EGLDs are the unit of account on the Metachain, and that on the shards wEGLDs are floating.

The smartcontracts of the dApps are deployed on the shards, so to avoid having to go through the Metachain, and to save time and gas costs, DX25 only accepts wEGLDs.

Devnet regulars will appreciate to finally have a place to find wEGLD easily, as the swap on devnet xExchange is often empty.

  • Analytics

1- Pools tab

Pair name: name of the pair
Pool fee: exchange rate
Effective TVL: all liquidity placed, including out of range
TVL: liquidity available at spot price
Volume 7D & 24h: volume of the past week / past 24h
Rewards 7D & 24h: rewards of the last week / last 24h.

Click on one of the pools.

A different display of previously seen data, a historical chart of future volumes.

Possibility to make a swap, or to place liquidity, for always more ergonomics.

Detail of the liquidity on the different fee levels.

Of course, the protocol favors the least “greedy” liquidity, and therefore placing oneself on the highest yield, with “the pack” is not necessarily the most judicious.

It is sometimes better to capture less but for oneself, than to want to capture more, but to share with the whole world.

M’kay.

Transaction history, filters by transaction type.

2- Token tab

Pair name: name of the pair
Price: spot price
Price change : price evolution over the last 24 hours
TVL: available liquidity
Volume 7D & 24h: volume traded in the last week / in the last 24h

8- Perspectives

We are dealing here with a serious financial platform, which does not rely on a magic token to attract TVL.

For traders, it is a fantastic tool, which allows them to get much lower exchange rates than the classical AMMs.

The single sided liquidity, can also serve as a kind of order book, but one that would pay you to buy or sell, which is absolutely fabulous.

As far as liquidity providers are concerned, this is a new playground, infinitely more profitable, but also much more dangerous.

Professionally oriented, I recommend to amateurs to farm magic tokens in classic AMM, which requires much less skill and attention.

However, in the advertised products, the protocol will be able to manage your range for you, to allow amateurs to reach professional yields.

I’ll save the best perspective for my conclusion, see you soon.

9- Conclusion

I named this article the “dex of reality” to insist on the singularity of the CLMM model.

If tomorrow we want to conquer the financial markets, it will not be with meme of little rabbits making pancakes on their nose, nor with promises of magic token “to the moon”.

The reality of the market is brutal, there are necessarily losers and winners, there is no decentralized finance without impermanent losses to manage. Any exposure to the market is a gamble, that’s how it is.

However, if we learn to accept and manage this reality, the world will open up to us, and its trillions of dollars will soon end up in our TVLs, because a liquid market, open 24/7, is simply the ideal market of any self-respecting classical economist.

Unsponsored content.
Purely crypto enthusiast, for the sake of sharing.
This is not investment advice.

My ERD address if you liked it: erd1d5zzxsv5tahv6lq99465w0rqxgteucxz6n63qfles9uytq7cwmqq2d2l4y

Any questions?
I’m at your service every day on the Entity Telegram group.

--

--

Captain RoXtar

Community builder pour Istari Vision & Entity, crypto enthousiaste.