Introduction
KyberSwap has integrated the Squid cross-chain swap and liquidity routing protocol to enable our users to perform cross-chain swaps directly on https://kyberswap.com/cross-chain.
More information can be found on our third-party integration page.
Swap tokens across chains
Step 1: Connect your wallet
You can navigate to the cross-chain swap page via the Swap dropdown in the navbar or by directly pasting the following URL in your browser address bar: https://kyberswap.com/cross-chain.
Connect your Web3 wallet to KyberSwap and select the network that you would like to use for the swap using the selector at the top right of the Swap page.
Step 2: Specify your chain and tokens to be swapped
As this is a cross-chain swap (i.e. swapping tokens on an origin chain to a different token on a destination chain), you will have to specify the following swap parameters:
- Origin chain: The input chain where the input token you are swapping out from is hosted. The origin chain will have to match the connected chain in step 1.
- Input token: The token to swap out from the origin chain.
- Destination chain: The output chain to receive the output tokens from the swap.
- Output token: The token to receive on the destination chain. Note that tokens will be sent to the same address on the destination chain (i.e. the address used to send input tokens will be equivalent to the output token address but on a different chain)
Step 3: Configure cross-chain swap amount
Specify the amount you would like to swap by either typing in an amount manually or by clicking the account balance in the input form to swap all tokens in your wallet. An estimate of the amount returned should appear in the quote field.
KyberSwap Interface allows users to customize trade parameters which enables greater trade security or even more advanced trade strategies.
Step 4: Approve or permit contract to swap tokens
Approve or Permit KyberSwap to swap the tokens on your behalf. Proceed to Step 5 if token approval/permit is not required.
If this is the first time you are swapping this token on this network using this wallet, the "Swap" button will be greyed out. You will first need to approve/permit the KyberSwap smart contract to spend your tokens before proceeding with the swap.
In the pursuit of greater gas savings for our users, KyberSwap has implemented a permit option for tokens which follow the ERC-2612 standard. In contrast to the basic ERC20 token implementation, ERC-2612 enables gasless approvals of smart contract allowances with just a signed message. In other words, approving a token via "Permit" does not require any gas and achieves the same effect as the ERC20 "Approve". If you see a "Permit" button, it means your token is eligible for gasless approvals!
Permitable tokens
Please refer to Permitable Tokens for the full list of tokens which have implemented the ERC-2612 standard.
Click on the "Permit [Token]" button to allow KyberSwap to swap the tokens on your behalf.
To ensure the safety of your tokens, users will be prompted to sign the transaction for the exact amount in their wallet UI. By signing the permit request, this ensures that KyberSwap is only able to swap the exact number of tokens from your wallet. As long as the accumulated tokens for current or future swaps exceeds this limit, another permit process will be required.
Upon signing the permit, you will then be able to proceed with the swap.
A note on permits
By permitting the swap, you are authorizing KyberSwap to swap the exact amount of tokens specified in the trade for the next 24 hours. This 24 hour deadline is implemented as a safety mechanism to ensure that the permit expires in case a corresponding swap order was not submitted or in the highly improbable event that an order was not filled. A new permit will be required upon the expiration of the current permit.
Note that the granting of a permit and the confirmation of a swap (step 5) are separate transactions whereby the latter is unable to proceed without the completion of the former. More importantly, as opposed to permits, swaps will always require gas to be paid as token transfers have to be confirmed by the network. As such, in the case whereby a swap remains in a pending state, it is possible to cancel the swap transaction in your wallet while the permit remains valid until expiry. If a future swap requires more tokens than an existing permit, the user will be requested to sign a new permit.
Click on the "Approve [Token]" button to allow KyberSwap to swap the tokens on your behalf.
To ensure the safety of your tokens, KyberSwap will also prompt you to select an allowance limit for the token being approved. By setting an allowance limit, this ensures that KyberSwap is only able to swap the specified number of tokens from your wallet. As long as the accumulated tokens for current or future swaps exceeds this limit, another approve process will be required. You can either set a custom allowance limit or opt for an infinite limit.
Hovering your mouse above the options will also bring up the helpers for your convenience.
Note that setting a custom allowance limit via the KyberSwap UI will be available for all wallets except for MetaMask and Trust Wallet. For these, users will be prompted to set the allowance limit directly in their wallet UI. This avoids any tx failures caused by amount mismatch.
Upon confirming an allowance limit, your wallet will then prompt you to sign the transaction request with the relevant gas fees.
Step 5: Confirm the swap
Click the “Swap” button to bring up the confirmation screen.
In the case of the standard flow where the cross-chain swap:
- is not expected to result in significant price impact or;
- has not been configured with an aggressive max slippage;
the confirmation pop-up will be as follows:
To protect our users from front-running, the confirmation pop-up will display a warning whenever a more aggressive max slippage has been configured for the swap.
Depending on the available liquidity for the tokens being swapped, the expected price impact could be significant. In such cases, the KyberSwap UI will display various warnings depending on the severity of the expected price impact. In the exceptional case that the price impact can not be determined, the swap will be disabled to ensure no negative impact to the trader.
Price impact is greater than 2% but below 10%
Price impact is greater than or equal to 10%
Note that to proceed with swaps with extremely high price impact, users must enable Degen Mode.
Third-party integration: Squid
Note that in order to proceed with the cross-chain swap, users must acknowledge that the swap will be handled by Squid x Axelar. As such, users are encouraged to visit Squid's Docs to understand how their swaps are being routed and secured across the supported chains.
In all the above cases, the confirmation screen will always display a few key pieces of information for review:
- Output Amount: Estimated return after the Swap.
-
Note: For every swap executed by the KyberSwap Aggregator, users will be able to see an estimated output amount based on the current price as well as a minimum received that takes into account the max slippage setting. KyberSwap Aggregator will always strive to execute swaps at the estimated output amount and revert the transaction if the minimum received amount is not achieved.
In the event that the market moves in favor of the trade which results in a surplus of tokens above the estimated output amount (i.e positive slippage), this surplus will initially accrue to KyberSwap. Surplus sharing programs will be explored as the KyberSwap ecosystem grows to be more self-sufficient. Critically, traders will always get the estimated output amount as long as the swap is executed at or above the current rate.
Note that this surplus is different from fees as it only applies in cases where the executed swap rate is better than the estimated rate at point of transaction confirmation. Please refer to this article for more information.
-
- Current Price: the rate at which the swap will happen (this can be inverted using the 🔁 button).
- Minimum Received: This is the minimum amount of output tokens that you will receive from the swap. The swap will only be completed if this minimum amount threshold is achieved else the transaction will revert.
- Gas Fee: The estimated network fee associated with this transaction.
- Price Impact: The estimated change in the market price due to the size of your transaction.
-
Do take note of the resulting price impact of your trade as this will determine the final average price of your trade. Higher trade volumes relative to available liquidity will result in each additional token unit being acquired at a higher price. As such, a higher price impact would result in subpar swap rates.
Please refer to this article for further details.
-
- Slippage: The estimated difference between the expected price and final price of the trade. Slippage is an inherent characteristic of all active markets whose risks can only be mitigated. For more detailed insights, please refer to Slippage.
Price impact
Do take note of the resulting price impact of your trade as this will determine the final average price of your trade. Higher trade volumes relative to available liquidity will result in each additional token unit being acquired at a higher price. As such, a higher price impact would result in subpar swap rates.
- Gas Fee: The estimated network fee associated with this transaction. As a cross-chain swap involves transactions occurring across two chains, Squid simplifies the fees by charging a fixed network gas fee for all cross-chain transfers.
- Service Fee: Cross-chain swap fees charged by Squid for servicing the swap across-chains. Note that this differs from the gas fees which is required for the blockchain to process your transactions as well as the message relay fees which ensures the security of the cross-chain messages by incentivizing the relayers.
Squid x Axelar fees
As an integrator, KyberSwap does not charge any additional fees for cross-chain swaps and have provided the functionality as a convenience feature for our users to quickly swap between tokens on different chains.
For more information on the fees that are incurred during a cross-chain swap, please refer to the Squid documentation on Fees and Gas Fees.
Upon confirming the swap in the UI, you will be prompted to sign the transaction in your wallet. In this example, we are using the MetaMask wallet to confirm the swap transaction.
Once the transaction has been confirmed in the wallet, your swap transaction will then be submitted to the network to be executed. You should see the Transaction Submitted screen appear. You can click on "View Transaction" to see your transaction on the blockchain explorer.
Upon the transaction being executed, KyberSwap will also send a notification to alert you that the cross-chain swap has been accepted by the network and is currently being processed.
As the swap requires value to be moved across different chains, each with their own security mechanisms, the end-to-end transaction will require additional time to be finalized. You can view the status of your cross-chain transaction by bringing up the KyberSwap wallet explorer.