Osmosis Alloyed Assets

Osmosis Alloyed Assets: Improving Liquidity Fragmentation & DeFi UX

27. November 2024

The contributors to Osmosis have a long history of pushing the limits of what is possible on a decentralized exchange. Since their launch in 2021, they have continuously improved user experience and added functionalities that allow them to compete with their centralized counterparts. Their latest innovation is alloyed assets and with a relatively soft launch, many people may have missed how important this new feature is, both for user experience and for safety. In this article, after setting a little bit of context, I’m going to

  • Introduce alloyed assets
  • Show you how they work
  • Explain why they are necessary

Let’s dive in.

Context: Idiosyncratic Risks

When a person purchases stock of a single company, they take on two types of risk. Systematic risk is the set of all things that could wrong and affect every business, while idiosyncratic risk is the set of things that could go wrong with that particular company. Idiosyncratic risks include

  • Poor resource management
  • Regulatory changes
  • Product or service failures

And all sorts of other issues, large and small. The problem is that average retailer investors (and also many above-average institutional investors…) are not good at measuring these idiosyncratic risks. This leads to the construction of investment theses which are missing critical information, costing people time, energy, and capital.

This is why index funds are so important. An index is essentially a basket containing many different stocks across many different industries, and their respective funds allow people to invest in the entire basket, hedging against idiosyncratic risks. After all, a disaster for one company might be an opportunity for several others. If you own them all, your portfolio is much safer. While not the first of its kind, Vanguard launched an investment revolution with its first public index fund in 1976.

Ok, so what does this have to do with Osmosis?

Bridges

The Cosmos was designed with blockchain interoperability at its center, facilitated by the inter-blockchain communication protocol (IBC). This has far reaching consequences for its design space, but for normal users it means that assets can flow back and forth between blockchains seamlessly, safely, and permissionlessly. This has not been replicated in other ecosystems (yet…), so in order to service many important blockchain assets (Bitcoin, Ethereum, Solana, etc), Osmosis relies on bridges.

A bridge is a piece of software that lets you move an asset from an origin chain to a destination chain. If I want to use some of my Bitcoin in an Ethereum smart contract for example, I need some way of representing my Bitcoin on the Ethereum chain, since it does not exist there natively. We won’t worry about too many details for now but there is one critical concept we will need.

Cryptocurrency bridges

General structure of cryptocurrency bridges

Bridges are Hard

Using cryptocurrencies has always been a bit risky, but ever since their popularity began to rise in 2021, bridges have become a prime target for hackers. A few bridge incidents of note:

The Nomad hack is of particular interest because just months prior, they had been nominated to be the canonical bridge from Ethereum to Osmosis alongside Gravity Bridge, Wormhole (hacked earlier that year) and Axelar which actually won the title.

Much like stocks, bridges also have idiosyncratic risks that are challenging for even sophisticated blockchain users to gauge. Despite that, these hacks also highlight that the demand for cross-chain interactions is only growing.

If only there was some way to hedge against these risks…

Alloyed Assets

Osmosis’ solution to the potential perils of non-IBC bridges is alloyed assets – a way of indexing across multiple bridges for like-kind assets. To illustrate how they work, I’ll use an example scenario: A user wants to sell their BTC, which is currently on the Bitcoin blockchain, on Osmosis. In order to do so, they must bridge the BTC tokens over.

Deposit

Because of the structure of blockchains, like-assets that arrive from different bridges are not fungible – that is, they are not recognized by the protocols as being the same token. In the past, a user would need to contend with complicated naming schemes:

  • WBTC is Cosmos-native Wrapped Bitcoin from Bitgo
  • WBTC.eth.axl is the Ethereum-native version, bridged via Axelar
  • nBTC is bridged using Nomic
  • Etc etc etc

Each one of these representations is a separate token with separate liquidity pools, but all fundamentally represent the same asset. The nomenclature makes for a confusing experience for users and the fracturing of liquidity makes for a much worse experience for traders. More importantly, each one of these assets is tied directly to the idiosyncratic risks of its particular bridge.

Let’s return to our user wishing to move their BTC to Osmosis. There are two possibilities for such a user: (1) They have no idea what bridges exist or which one to use or (2) They have a bridge in mind they want to use.

If we search BTC on the Portfolio page, we can see that Osmosis has made some very deliberate choices:

Osmosis portfolio page

Osmosis portfolio page

First, we can see all the ugly BTC versions that are bridge dependent, but the simplest version appears at the top. This is a perfect choice for users who neither know nor care about how their tokens arrive. When they click deposit, they are presented with a screen like so:

Osmosis alloyed asset deposits

Users who wish to receive a particular version of BTC can simply select one they want from the dropdown, but most users will probably review this screen and continue to sign the transaction which will forward their BTC through an automatically selected bridge to Osmosis. Once the transaction has been confirmed on the source blockchain and in the bridge, their BTC will be visible in their Osmosis account. Easy.

But wait… what even IS this BTC token?

This is alloyed Bitcoin. It is a tokenized mixture of several BTC variants that exist on Osmosis. You can think of it like a basket of different bridged versions of BTC, much like an index fund is a basket of stocks.

To understand how this token comes to be, we need to look at liquidity pools.

How to Make an Alloyed Asset

Alloyed assets are actually just liquidity provider (LP) tokens for special transmuter liquidity pools. Let’s break that down a bit.

First, I mentioned that each alloyed asset is like a basket, so somewhere we have pull together all of the different tokens that will contribute to it. This occurs in a special smart contract called a liquidity pool. A typical pool has two assets and will aim to store 50/50 dollar value of each. For example, if a BTC/USDC pool had $10k work of USDC, it would also need to hold $10k worth of BTC. These pools are how an automated market maker (AMM) like Osmosis automates its trading – users are not buying from or selling to one another directly, but from the liquidity pool.

Users can contribute funds to a liquidity pool to receive LP tokens. These tokens are like a proof-of-contribution and they can always be redeemed for some fraction of the pool’s contents. Typically, holders of LP tokens are entitled to some pro-rata share of the fees that the pool generates as traders exchange between its two assets.

Typical liquidity pools for Automated Market Makers

Typical liquidity pools for AMMs

The transmuter liquidity pools that power alloyed assets are not typical, but do behave in a similar way. For starters, these pools can have more than two assets in them, and the ratios of these assets are more flexible. All of them, however, need to be ‘like-kind’ – each is a different representation of the same original asset.

Just like a typical pool, users can deposit funds in the form of any one of the accepted representations, and in return they will receive LP tokens. But unlike in normal pools, this LP token is scaled such that for every one of the like-kind asset you deposit, you receive back one LP token. These LP tokens ARE the alloyed asset, representing a scaled share of the pool’s contents.

Transmuter liquidity pools for alloyed assets

Transmuter liquidity pools for alloyed assets

It is worth remembering that although this article is focussing on alloyed Bitcoin and its constituent representations, it is only an example. It is possible to create alloyed versions of Ethereum, stablecoins like USDT, and any other tokens in the same manner.

Conclusion

In this article, we managed to cover the basics of what alloyed assets are and why they are important. Hopefully you now you understand that

  • Bridges come with idiosyncratic risks that are hard to measure
  • Alloyed assets allow users to hedge against these risks
  • They do this by being composed of many bridged representations
  • This cleans up the user experience and increases safety

Having started our own journey validating the Osmosis chain, we at CryptoCrew are thrilled at the incredible progress that the contributors have made continuously improving their product. They have cemented themselves as a pillar of the interchain, and are one of several shining examples of the appchain thesis in action. We look forward to many future developments which keep their users’ interests at heart, and will continue to contribute to their bold and exciting experiment.

Thanks for reading!
~Robin Tunley