☝️Cross-chain Swaps with Symbiosis
Discover the concepts of seamless and secure cross-chain swapping and bridging capabilities offered by the Symbiosis protocol.
Curious to see how it works? Check it out with Symbiosis WebApp
The Symbiosis protocol was born for cross-chain operations. In the beginning it was cross-chain swaps and bridging, then more functionality was added to the protocol. This document explains the concepts of cross-chain swaps.
While doing a cross-chain swap with the Symbiosis protocol, three cases are possible:
The source and destination blockchains of a cross-chain swap are not S-Chain (Scheme 1),
The destination blockchain of a cross-chain swap is S-chain (Scheme 2),
The source blockchain of a cross-chain swap is S-chain (Scheme 3).
S-chain is Boba BNB: the Symbiosis host chain, all cross-chain operations pass through it. For more information about sTokens and bridging concepts in the Symbiosis protocol, please refer to sTokens in Symbiosis
Case 1: Blockchain ->
Blockchain
->
BlockchainThe source and destination blockchains of a cross-chain operation are not Boba BNB (S-Chain).
Let's consider an example of a cross-chain swap: a user wants to swap UNI tokens from Ethereum for ETH on Arbitrum, and wants to get the maximum possible amount of tokens and pay less on-chain and cross-chain fees.
Symbiosis supports two types of transit tokens:
Stablecoins: for all supported blockchains, and
WETH: for some supported blockchains.
If a pair of blockchains supports stablecoins and WETH as transit tokens, then Symbiosis finds two routes (a sequence of intermediate swaps) for each swap between these blockchains. For example, for the cross-chain swap UNI on Ethereum for ETH on Arbitrum there are two routes:
The best route using stablecoins as transit tokens (Scheme 1) (UNI
→
USDC on Ethereum)→
Bridging with Symbiosis→
(USDC → ETH on Arbitrum)The best route using WETH as transit tokens (Scheme 2) (UNI
→
WETH on Ethereum)→
Bridging with Symbiosis→
(WETH→
ETH on Arbitrum)
Then Symbiosis compares these two routes and offers the best one for the user. Please compare Scheme 1 & 2 below.
Important notices for Scheme 1 & 2
Steps 2 and 9. The Symbiosis protocol implements on-chain swap on behalf of the user with 1inch or OpenOcean.
Steps 3 and 8. In an ideal world, the same number of tokens would be released on the destination blockchain as were locked on the source blockchain. In reality, there are typically slightly fewer tokens released than were locked. For more details on the fee withholding process, please refer to Gas Fees for Cross-chain Operations via Symbiosis
Step 9. Once the last on-chain swap is accomplished, the user gets tokens to their address on the destination chain.
In some cases Step 9 may be omitted. In this case, an appropriate amount of transit tokens will be sent to the user's address. Please check the Guaranteed Transit Tokens section below.
Guaranteed Transit Tokens
Each cross-chain swap has a slippage tolerance limit that is set in Step 1. This value is distributed across all transactions of a cross-chain swap. This ensures that each individual transaction remains within its specified slippage tolerance fraction, guaranteeing that the cumulative price change doesn't exceed the overall slippage tolerance threshold.
If the transaction on the first (source) network surpasses the accepted price change, then assets stay in the wallet.
If the transaction on Symbiosis host chain surpasses the accepted price change, then the cross-chain swap gets halted. Please see Symbiosis & Emergencies for more details.
If the transaction on the destination blockchain surpasses the accepted price change, then the user will receive an appropriate amount of the transit token: Step 9 will be omitted and transit tokens will be sent to the user's address.
Case 2: Blockchain -> Boba BNB (S-Chain)
The destination blockchain of a cross-chain operation is S-chain. In this case, bridging on stablecoins is always used.
As an example, let's see how a cross-chain swap MATICs from Polygon for BOBA tokens on Boba BNB goes with Symbiosis (Scheme 3).
Important notices for Scheme 2
Step 2. The Symbiosis protocol implements on-chain swap on behalf of the user with 1inch or OpenOcean.
Step 6. The Symbiosis protocol mints tokens with a ratio of 1:1 and then withholds an amount that equals the transaction processing fee on the current blockchain. For more details on the fee withholding process, please refer to Gas Fees for Cross-chain Operations via Symbiosis
Step 8. Since there are no DEX aggregators on Boba BNB, Symbiosis uses existing DEXes for on-chain swaps on Boba BNB. Once the last on-chain swap is accomplished, the user gets tokens to their address on the destination chain.
Case 3: Boba BNB (S-Chain) -> Blockchain
The source blockchain of a cross-chain operation is Boba BNB (S-chain). In this case, bridging on stablecoins is always used.
As an example, let's see how a cross-chain swap BOBA tokens from Boba BNB for AVAXs on Avalanche goes with Symbiosis (Scheme 4).
Important notices for Scheme 4
Step 2. Since there are no DEX aggregators on Boba BNB, so Symbiosis uses existing DEXes for on-chain swaps on BOBA BNB.
Step 10. The Symbiosis protocol releases tokens with a ratio of 1:1 and then withholds an amount that equals the transaction processing fee on the current blockchain. For more details on the fee withholding process, please see Gas Fees for Cross-chain Operations via Symbiosis.
Step 11. The Symbiosis protocol implements on-chain swap on behalf of the user with 1inch or OpenOcean. Once the last on-chain swap is accomplished, the user gets tokens to their address on the destination chain.
More Information
For a more detailed explanation, please see Symbiosis Routing Contracts.
If you are curious to see how it works, try our web-based application: Symbiosis WebApp.
Last updated