LayerZero’s Stargate

Tanay Venkata
4 min readApr 20, 2022

--

A new approach to traditional bridging.

Introduction

Each blockchain has unique rules and consensus mechanisms that prevent them from communicating with one another. So bridges are used to communicate with and move assets across blockchains. Through bridges, I was freed from Ethereum’s bloated network and experienced the 19% APY on Terra’s Anchor, Wonderland Money’s uprise on Avalanche, and the immaterial fees on Arbitrum.

Connecting blockchains is vital to allow DeFi users a greater variety of opportunities: better yields, innovative protocols, and adventurous ideas. All of which would be inaccessible on a single chain.

But LayerZero took blockchain communication a step further — a better solution must exist.

Stargate is a new interpretation of the cross-chain functionality. Until now, three conditions could not be met simultaneously on any bridge, coined “The Bridging Trilemma.”

source: https://medium.com/stargate-official/the-bridging-trilemma-d80788cce4ef

Meaning — for blue and red, respectively — the assets you deposit will be the assets you receive on the new chain, and you will get your money less fees the moment you submit a transaction. Green says the protocol uses one liquidity pool between multiple chains (this isn’t self-explanatory and will be explained below).

Utility

You may be asking why LayerZero is trying to change from the tried and tested ways of bridging. We experienced a similar phenomenon of unsustainability presented as innovation through “DeFi 2.0” after all. Is the “bridging trilemma” a real issue, and does their algorithm meet those goals?

This section will explore the three areas and how traditional bridges fall short of what Stargate accomplishes. Multiswap has users deposit their assets, locks that asset into a smart contract, and mints a synthetic version on your destination chain for you. However! If you wish to bridge a native asset such as USDC and Multiswap does not have enough liquidity of USDC to withdraw, they mint new tokens that “represent the number of XYZ that the user SHOULD receive on that chain…” and “…the user is left with their anyXYZ (called ‘Your Pool Share’) and they have to manually ‘Remove’ them, converting anyXYZ to XYZ when sufficient XYZ become available again” (Multichain Docs Cross-Chain Router). Looking at the Multiswap Pool Liquidities as of April, is it a likely possibility to want to bridge one asset and find yourself holding pool-tokens waiting for your liquidity to be released, an example of forgoing instant guaranteed finality.

In another case, bridging USDT using the Avalanche Bridge nets users USDT.e and Multiswap dispenses fUSDT for Fantom bridging, both wrapped versions of the token they initially deposited. So users have to perform another conversion step on the destination chain to interact with protocols and contracts necessitating native USDT.

Unified liquidity brings ease of maintenance to liquidity pool providers. As stated in their LP Guide documentation, the cBridge transfer station moves users’ liquidity to different chains. This movement brings an added effort on the LP provider’s part to aggregate and remove said liquidity. cBridge “can aggregate your liquidity from multiple chains to one chain, and remove the aggregated liquidity from that one chain all at once,” which would seem convenient but is a hassle in a monetary sense. More movement of assets involves more gas, and more gas involves more fees… one click, more costs, doesn’t seem appetizing. Even the bridging process of assets contains higher fees than other alternatives.

Stargate remedies the issue using soft-partitioned unified liquidity pools. They collect liquidity of an asset from the source chain and allocate balances to destination chains to reap the benefits of unified liquidity and guaranteed finality. Unified liquidity allows LP providers to collect fees on all connections rather than having to split funds into multiple liquidity pools individually. Scalability is another perk, allowing the addition of more chain destinations of an asset without needing to build new bilateral connections involving the new chain and every single preexisting one.

User in Mind

The most important thing to note in the Stargate Whitepaper is the emphasis on user experience and the ability to build upon their created algorithm. In fact, the whitepaper mentions of user experience were accounted for a whopping twelve times and composability three, underscoring the broader facets of DeFi LayerZero wishes to enhance.

LayerZero presents the Delta (Δ) algorithm to solve the Trilemma. Stargate is termed a ΔBridge as it employs said algorithm. Simply put, the Δ Algorithm achieves the trifecta by distributing newly deposited funds to deficits of channels on a chain and taking remaining funds after filling deficits to be spread across channels based on their weight (derived from the volume expected per channel. Ex: Ethereum to Arbitrum is especially attractive, so allocate more liquidity to that channel versus Ethereum to the BNB chain). As to not make this article too long, I will review the whitepaper’s code and theorems in-depth in a later post.

Stargate functions using the Δ algorithm developed by LayerZero. Not only has LayerZero developed a more efficient, convenient bridging solution, but they have also sown the seeds for more significant growth within the DeFi ecosystem as a whole. More liquidity to move funds across chains translates to consumers having access to more protocols at a lower cost. Creators can feel confident that their projects on whichever chain they choose to build on will have greater reach and liquidity opportunities. Collaborations with Sushiswap noted in the whitepaper could bring swaps across chains with various assets with a single click. The algorithm built for Stargate makes for a promising future for DeFi. LayerZero’s Stargate demonstrates nothing but convenience and creativity.

Thank you for reading, and if you have any comments or recommendations, I am happy to listen!

--

--