Logo
Cardano Ecosystem

WingRiders

01/07/2023

·

1.1K views


StableSwap Pools on WingRiders

Hey Riders, today we are introducing an addition to the WingRiders protocol — StableSwap pools. In a nutshell, a more efficient way of swapping two assets of the same value, such as two different USD stablecoins.

StableSwap Pools on WingRiders

Hey Riders,
today we are introducing an addition to the WingRiders protocol — StableSwap pools. In a nutshell, a more efficient way of swapping two assets of the same value, such as two different USD stablecoins. The feature is now available on our preprod. First, let’s get back to the basics of a DEX and then compare our current model with the StableSwap one.

There are two major types of DEXes — order book and AMM (Automated Market Maker). All AMM DEXes, including WingRiders, have liquidity pools where a function determines the exchange rate between the assets.

One commonly used function for pools with two assets is constant product market maker.

x * y = k

The x here represents the amount of one asset, and y is the amount of the other asset. As the name of the functions hints, the principle is that the product of the asset amounts remains constant — the k in the formula. So if you want to swap asset one for asset two, x will increase, and y will decrease so that k is kept constant.

Constant product AMM is suitable for volatile token pairs because they enable trading at all possible prices. That means it can facilitate trading even during market fluctuation. It is also beneficial for primary markets, where traders are more likely to guess and act based on information from outside the market, despite higher slippage.

Following is the resulting price curve of the constant product AMM function. As you can see, large trades relative to the size of the pool move prices further along the curve in both directions. It is an elegant solution well-suited to most crypto assets that behave more like traditional stocks.

However, while the constant product market maker model is a great leap forward for DeFi, it is not ideal for trading pairs of USD stablecoins or any other two same-valued assets. For such trading pairs, it is desirable to exchange in a 1:1 ratio between them. In a constant product AMM world, it requires high liquidity to ensure low slippage, and even then, it can fall short of the set expectations.

This is where StableSwap comes in.

StableSwap is an automated market maker (AMM) function focused on swapping between two stable assets with minimal slippage and more efficient trading for liquidity providers. The concept was pioneered by Michael Egorov, founder of Curve Finance, in a whitepaper published in late 2019, and this has majorly impacted the DeFi ecosystems.

As you can see on the graph below, StableSwap is the middle ground between two functions. The constant product described above, and the constant sum function, x + y = k. The latter means the exchange rate between the assets, or price, is always constant, hence the name. Even though it has practically zero slippage, it’s not ideal, as the pool can run out of tokens or become significantly unbalanced. StableSwap invariant is a more complex function optimised for minimal slippage and a flatter curve around the optimal peg range. That results in mostly keeping the desirable 1:1 exchange ratio, better efficiency with big trades, and benefiting traders and liquidity providers.

We implemented StableSwap on top of our existing audited contracts. They have been in production since our mainnet launch and make a perfect foundation for this. We kept all the trusted and secure parts and only changed the AMM function used in the contracts to the StableSwap invariant. That enabled us to speed up our development and make relatively few and easily auditable changes. If you want to dive deeper into the mathematics behind it, check out the StableSwap whitepaper.

But why is StableSwap necessary? A common problem when swapping tokens via standard constant product function AMM DEX is that trades between one pegged asset to another are seldom as efficient as they could be. Now, with the new WingRiders StableSwap pools, the advantages are clear:

  • Traders can swap between stablecoin (pegged) assets with minimal possible slippage and price impact.
  • Liquidity providers can use StableSwap pools, which dramatically reduce the risks associated with impermanent loss, which could lead to benefits resulting in deeper liquidity, higher volumes, and an overall larger pool of fees from which liquidity providers benefit. Important to note this is only true until the stablecoins maintain their peg.

In crypto, stablecoins are a crucial part of the ecosystem. And as we have seen on other blockchains, StableSwaps are a critical foundation to help other DeFi projects, such as borrowing and lending, grow even more. On Cardano, we hope to continue our mission to be a key infrastructure component for all the other projects building out there, and now also with the addition of stableswap.

Why Stablecoins Matter?

Stablecoins are digital currencies that are pegged to the value of assets such as fiat currencies like the US Dollar, other cryptocurrencies, or commodities such as gold. Read here for more about the different types of stablecoins. Even though the price of a national currency, such as the US Dollar also fluctuates, this movement is very small compared to the roller coaster fluctuations in crypto assets.

Making investment and trading decisions given the volatile nature of the cryptocurrency markets, where price movements are sudden and, in many cases, extreme, becomes very challenging. Also, often the high positive correlation between tokens leads to price movements in the same direction. So, if the price is moving downward for the assets you hold or the tokens you are trading, it is impossible to lock in any gains or protect your positions against a loss in value. This is where stablecoins come in. In effect, stablecoins act as a safe haven in volatile markets.

Stablecoins coming to Cardano

Given the importance of stablecoins and the role they play in an ecosystem it is exciting to see various projects bringing different flavours to Cardano.

Indigo Protocol has launched a series of synthetic assets, including it’s stablecoin iUSD. A synthetic asset gives you price exposure to an asset without needing to own the asset. In Indigo, these synthetic assets are called iAssets. An iAsset acts the same as the asset it’s tracking. If the price of the tracked asset goes up or down, so does the price of the iAsset. For example, iUSD will track the price of USD, and thus will be valued at $1. Irrespective of the price of other assets in the market, iUSD will maintain its value of $1.

Other stablecoins are on their way too like Coti’s DJED, an algorithmic stablecoin, that is currently on testnet. EMURGO, the official commercial arm and a founding entity of the Cardano blockchain, recently announced the planned launch of its new U.S. dollar-backed stablecoin, USDA. USDA will be the first fully fiat-backed, regulatory compliant stablecoin in the Cardano ecosystem.

Also multichain, the largest bridge in crypto is enabling bridging of three stablecoins to cardano. There are DAi, USDT, and USDC. Multichain is now the leader in the cross-chain field, with a rapidly expanding family of chains (currently 26) and daily volumes in excess of $100 million (https://anyswap.net). Its sustained daily volume is more than $100 million, and its Total Value Locked in excess of $5 billion. This will enable assets from other chains to be bridged and used in Cardano, increasing liquidity within the ecosystem. Once the bridge is live, you will be able to bridge assets via http://app.multichain.org to swap, stake, provide liquidity to pools, and deposit into yield farms on WingRiders.

⚠️That being said, every bridge, similar to any asset, protocol, or type of stablecoin (synthetic, algorithmic, or currency-backed), carries inherent risks! All users should DYOR and realize that, at the same time they empower DeFi, they also carry risks, and we are all responsible for our decisions and their consequences. Please also note that neither we nor Indigo or Djed or Emurgo did not audit multichain, nor are we responsible for their code quality or the solution’s robustness. Also, it should be noted, as in the advice for bridges above, that all the stablecoins mentioned come with their own inherent risks, and you should fully study and understand the risks before getting involved. WingRiders welcomes all of these stablecoins and what they will bring to Cardano, but is not responsible for any of their successes or failures as they are all independent projects. ⚠️

Understanding risks of Stablecoins

Though stablecoins bring immense benefits to any ecosystem they also come with some inherent risks which is important to understand. Let’s discuss some of the risks to be aware.

Stablecoins are digital assets that are pegged to underlying real world assets, such as fiat currencies or gold. For example, the two largest stablecoins by market cap, USD Tether (USDT) and USD Coin (USDC) are pegged 1-to-1 to the value of the US dollar.

Maintaining a stablecoin’s peg to the underlying asset is a challenge. The two largest stablecoins by market cap, USDT and USDC, accomplish this by securing the tokens they issue with assets they keep in custody, such as treasuries, commodities, fiat currencies, or other comparable, liquid, high credit grade assets kept in a bank or held at a custodian. If the reserves are at risk in any way that will affect the stablecoin’s value.

Decentralized or algorithmic stablecoins, on the other hand, use an algorithmic strategy that is automatically carried out by smart contracts to achieve parity with their underlying asset. When it comes to algorithmic stablecoins, it is important to distinguish between those that over-collateralize their stables, such as DAI, and those that are under-collateralized or not collateralized at all.

If the pegging mechanism fails for whatever reason, this will have an adverse effect on the value of the stablecoin as in the case of Luna and UST.

Over the past couple of years, successful attacks on “blockchain bridges” have become increasingly common.

Blockchain bridges, also known as network bridges, are applications that allow people to move digital assets from one blockchain to another. Cryptocurrencies are typically siloed and can’t interoperate — you can’t do a transaction on the Bitcoin blockchain using Dogecoins — so “bridges” have become a crucial mechanism, almost a missing link, in the cryptocurrency economy.

To change one type of cryptocurrency into another, bridge services “wrap” the currency. It represents stored value in a flexible alternative format, similar to a gift card or a check. Bridges require a supply of cryptocurrency coins to back all of those wrapped coins, and hackers frequently target this stash.

Bridges will always be a popular target, according to James Prestwich, who researches and creates cross-chain communication protocols. “Any capital on-chain is subject to attack 24/7/365,” he says. “People will always want the chance to enter new ecosystems, so bridges will continue to grow. More people will be able to create and analyze bridge code as we become more professional and establish best practices. Bridges are new enough that there are very few experts.”

If an attack happens on a bridge and the collateral is stolen, the bridged assets will also become worthless as the backing is no longer there.

If any of the stablecoins we have discussed fail, be it through depegging or for any other reason, in pools exposed to those assets on WingRiders, all swapping will be automatically halted to safeguard the portion of the other asset locked in that pool. In the case of a 15% depegging of a stablecoin, the halting mechanism described will automatically occur on the transaction execution level.

Now that the advantages of using these StableSwap pools are clear, start swapping and adding liquidity to reap the benefits on WingRiders.


 

AD

SNEKbot by DexHunter on CARDANO

Cardano's Telegram Trading Bot live on Cardano mainnet!TRADE NOW!


Read Original Article on WingRiders

ORIGINAL SOURCE

https://medium.com/@wingriderscom/stable...

Disclaimer: Cardano Feed is a Decentralized News Aggregator that enables journalists, influencers, editors, publishers, websites and community members to share news about the Cardano Ecosystem. User must always do their own research and none of those articles are financial advices. The content is for informational purposes only and does not necessarily reflect our opinion.


Genius Yields DEX Launched!

More from WingRiders

See more
WingRiders Launchpad benefits
WingRiders
WingRiders Launchpad benefits

10/05/2023

·

455 views

Related News

See more
Genius Yields DEX Launched!

Featured News

See more



    DEFAULTENGLISH (EN)SPANISH (ES)RUSSIAN (RU)GERMAN (DE)ITALIAN (IT)POLISH (PL)HUNGARIAN (HU)JAPANESE (JA)THAI (TH)ARABIC (AR)VIETNAMESE (VI)PERSIAN (FA)GREEK (EL)INDONESIAN (ID)ROMANIAN (RO)KOREAN (KO)FRENCH (FR)CZECH (CS)PORTUGUESE (PT)TURKISH (TR)