Stargate Finance is a multi-chain cross-chain bridge protocol based on Layerzero, created by LayerZero Labs in March 2022. It mainly supports the cross-chain of stablecoins and its native token STG. Currently, Stargate supports cross-chain asset transfer between eight blockchains: Ethereum, BNB, Avalanche, Polygon, Optimism, Arbitrum, Fantom, and Metis.
Layerzero is a full-chain interoperability protocol built for cross-chain information transfer. At the same time, it is also a cross-chain communication infrastructure on which developers can build cross-chain applications that meet full-chain interoperability, such as cross-chain DEX or multi-chain revenue aggregators.
Stargate adopts the [Liquidity Swap] scheme for cross-chain assets. However, unlike most cross-chain bridges that set up independent liquidity pools for specific networks, Stargate uses a unified liquidity pool to support cross-chain transfer of assets.
Stargate’s unified liquidity pool allows all chains to share the liquidity of the same currency, that is, each chain can access the liquidity on other chains. For example, if there is a USDT pool on chain A, then USDT-related transaction requests initiated by other chains such as chain B and chain C can borrow liquidity from the USDT pool of chain A. This design can help Stargate maximize capital efficiency in the cross-chain process.
However, the unified liquidity pool may face transaction failure problems caused by insufficient liquidity depth. That is, when multiple chains share a liquidity pool, the number of users and the number of parallel transactions will increase accordingly, thereby reducing the liquidity in the pool and making some cross-chain transactions impossible.
Therefore, Stargate introduces a set of "resource balancing algorithms" to solve the above problems. Stargate divides the liquidity pool on each chain into multiple intervals according to different blockchains for management. For example, 100 USDT on chain A is divided into 50 USDT on chain B and 50 USDT on chain C. When a cross-chain request is received, the resource balancing algorithm will review the liquidity of each interval and divide the assets deposited by users to the intervals with insufficient liquidity for replenishment, thereby avoiding transaction failures caused by liquidity depletion.
In terms of cross-chain communication, Stargate adopts Layerzero's [Oracle + Relay] communication mechanism. Cross-chain information transfer.
Stargate's relayer is an off-chain data storage service provided by LayerZero. Its main function is to read the transaction proof from the original chain and transmit it to the target chain.
Stargate’s oracle is provided by the third-party service provider Chainlink, which can pass block header information to the target chain and help verify the validity of the transaction proof.
Stargate's cross-chain information transmission requires cross-verification in combination with block header information and transaction proof. Verification/cross-chain success can only occur when the information provided by the relay and the oracle matches. This mechanism can reduce the probability of malicious attacks to a certain extent. Because the attack can only occur when there is a problem with the oracle and the relay and they collude maliciously.
The specific process of Stargate’s cross-chain information transfer is as follows: