🎯How Do Cross-Chain Swaps Operate
Last updated
Last updated
Let's illustrate the process of executing a swap from ETH (on Ethereum) to SOL (on Solana) using RepoSwap:
On the RepoSwap User Interface (UI), users will find a pool called 'ETH-SOL pool'. This pool comprises two components: one containing ETH tokens on the Ethereum blockchain and the other containing SOL tokens on the Solana blockchain. Users execute token swaps leveraging the liquidity available in these pools. Liquidity providers have the opportunity to claim swap fees whenever users execute trades, with rewards proportional to their share in the liquidity pools. The user's ETH is transferred to the ETH liquidity pool within the ETH-SOL pool on RepoSwap's platform. Utilizing data on the existing tokens within the pool, the conversion rate to SOL is calculated. Subsequently, the RepoSwap smart contract facilitates the transfer of SOL tokens back to the user's wallet, thereby completing the swap process.
Within RepoSwap's Decentralized Application (DApp) UI, users have the flexibility to choose a slippage rate for the swap, depending on their specific requirements. A higher slippage rate increases the likelihood of a successful transaction, albeit at the expense of receiving a slightly lower amount of tokens and susceptibility to bot-induced frontrunning.
Assuming a hypothetical scenario where the current ETH price is $1000 and the SOL price is $10, the liquidity pools maintain a ratio of 1 ETH:100 SOL. For illustrative purposes, let's consider the pool contains 100 ETH and 10,000 SOL tokens. When a user intends to swap x amount of ETH to y amount of SOL, the number of SOL tokens received is calculated according to the specific formula provided by RepoSwap's platform.
In summary, RepoSwap provides users with a seamless and transparent platform for executing cross-chain swaps, offering liquidity, flexibility, and security in the decentralized finance (DeFi) space.