What are Cross-Chain Swaps?

As most blockchains operate independently, cross-chain swaps become crucial to enable users to be a part of an engaging Web3 ecosystem.

NEWS
TECHNOLOGY
February 2, 2023
Abhishek Purushotham
February 2, 2023

Table of Contents

Back to blog

The nature of Web3 is dynamic: as with most new technologies, things move fast. Prominent cryptocurrencies often vanish overnight while a new one takes its place. Similarly, a new platform may emerge, offering users a chance to participate in DeFi with products yet to be envisioned. The Web3 ecosystem is ever-expanding, making blockchain interoperability an extreme necessity.

The current Web3 ecosystem is fragmented, with blockchain networks operating as independent identities. Therefore, to explore the dynamic Web3 ecosystem efficiently, there is a need for cross-chain swaps.

The growth of centralized exchanges has made cross-chain swaps extremely easy. But with centralization comes risk, with a prominent example being the FTX exchange, where investor funds were greatly misused and lost. Therefore, users may need to look at executing cross-chain swaps without an intermediary.

An

In this article, we will thoroughly explore what cross-chain swaps are, how they work and how they open doors to a more accessible ecosystem.

Cross-chain bridges

Before we dive deeper into cross-chain swaps, let us look at cross-chain bridges. To get assets across chains, users have been predominantly using such bridges. Through a cross-chain bridge, users can send wrapped versions of the native tokens on the source chain to the destination chain. Simply put, a cross-chain bridge enables a wrapped representation of the native token on the target chain while the user still holds the native token on the native chain. They are critical for building liquidity when new bridges launch: the August, 2023 launch of the Base bridge is a good example.

Here’s how a bridge works: it takes a deposit of native tokens on Chain A, verifies that deposit, and mints a corresponding number of wrapped tokens on Chain B. To execute a cross-chain transaction through a bridge, here’s what you must do: find a bridge connecting Chain A and Chain B, deposit your Chain A tokens and send a wrapped version of them to the destination chain where your desired token lives. Then, you swap the wrapped tokens through a DEX on the destination chain.

A

This is the flow for most cross-chain bridges, including Axelar’s Satellite bridge (with the exception that Axelar security is based on proof-of-stake consensus, instead of a multisig). Finding a bridge that connects your two desired chains may be a bit easier now than it was some time ago, but cross-chain bridges are still not the ideal solution. They come with multiple limitations and risks, making transactions a bit risky. Moreover, cross-chain liquidity is also a significant factor when it comes to bridges. Since many chains and assets have limited liquidity, finding exchanges with the desired tokens to execute a trade may be a hurdle.

While cross-chain bridges are a prominent solution, interchain-native applications are now simplifying the process. Applications such as Squid and InterSwap enable users to do cross-chain swaps in one click without needing wrapped tokens. Users can seamlessly execute cross-chain swaps without needing to course through different applications, bridges and wallets. This makes the Web3 experience smoother and more straightforward.

How do cross-chain swaps work?

Here’s what a traditional cross-chain swap looks like. Let’s say Bob wants to exchange Asset A with Asset B. The problem is both assets are on different blockchain networks (Chain A and Chain B, respectively), and Bob does not wish to go through a centralized exchange. Therefore, this swap requires multiple steps, with some of them being complicated, depending upon the tokens Bob wishes to trade. Additionally, more operators mean more points of failure, adding to the risk.

  1. First, Bob must find a trusted decentralized exchange on Chain B that has enough liquidity for the pair he wants to swap. This will be a pair between the bridged version of Asset A and the native version of Asset B. If it doesn’t exist, Bob has to find another asset to swap the wrapped version of Asset A with it and then swap the new asset with Asset B.
  2. Before Bob can execute the swap, he'll need to ensure he has a Chain B wallet and enough of the Chain B gas token to pay the transaction fee for the swap.
  3. Once Bob finds liquidity and has wallets and gas tokens set up on both chains, he heads to a bridge that links the two chains, connects her Chain A wallet, and initiates the bridge to Chain B.
  4. Bob initiates the swap on a DEX on Chain B and finally receives Asset B.
A

This process is extremely confusing and time-consuming, especially for a regular guy like Bob, who does not trade much. What if there was a more efficient way of doing things between blockchain networks? Would that be something Bob (and you) might be interested in?

Automating cross-chain swaps with GMP

The key to consistent and accessible cross-chain swaps lies in Axelar’s General Message Passing (GMP) capability. GMP does more than just wrapping assets and sending them from one chain to another. With GMP, users can execute a cross-chain swap in just a single click without leaving the interface. This is because GMP enables developers to build on any supported chain while leveraging the key features of other supported chains with ease. Developers can call any function on any other connected chain, ensuring complete composability across Web3 (‘function’ here encompasses both smart contracts at the application layer and functions built at the protocol layer)! Axelar GMP opens up endless possibilities for seamless interoperability across decentralized exchanges, DeFi, NFTs, games, liquid staking and many other decentralized applications.

One of the vital developmental successes of GMP is protocols like Squid and InterSwap, cross-chain swap and liquidity routers built on the Axelar network. Through liquidity routing, these protocols allow users to swap any tokens across supported chains by connecting them to liquidity pools on DEXs anywhere in Web3.

A

Traditional crypto bridges depend on liquidity pooled in the bridge itself, which makes them highly susceptible to attacks. As per DefiLlama, over $2.5 billion have been hacked from crypto bridges, with the number still growing. Squid, on the other hand, operates by leveraging the liquidity stores of USDC, routing all swaps through USDC.

Here’s what an automated cross-chain swap looks like for the user, with Squid or InterSwap, powered by Axelar.

A

In traditional cross-chain swaps, users must hold wallets on both the source and destination chain while ensuring they have enough assets to cover the gas fees. Squid makes it easy for users by calculating the cross-chain gas fees and removes the need to hold multiple wallets and DEX accounts. Cross-chain gas services handle the conversion of source-chain tokens into AXL for paying fees to Axelar validators and the destination-chain token for paying required gas.

Cross-chain swaps and the future of Web3

Liquidity routing such as this is of many examples of how General Message Passing makes it easy to execute cross-chain swaps. Recently, Axelar extended its support to Cosmos, connecting it with EVM chains to provide composability for dApps that span both ecosystems.

Cosmos-based automated market maker (AMM) Osmosis has adopted Axelar’s GMP to offer a one-click experience to users and take cross-chain swaps to the next level. This will enable users on other networks to tap into Osmosis's immense liquidity. Similarly, Sommelier, a Cosmos-based protocol for intelligent vaults, also announced that they are building connections to Arbitrum using Axelar GMP.

The possibilities are endless, considering how easily applications can implement cross-chain swaps with General Message passing! Axelar GMP powers hundreds of applications to achieve seamless cross-chain transfers across supported chains. With the recent integration of Cosmos, the platform currently supports 35+ blockchains.

Interested in using GMP and building with Axelar? Check out our docs on General Message Passing to know more, and reach out to us on Axelar Discord for any questions.