DEV Community

Gogu
Gogu

Posted on

How to use SyncSwap on zkSync: complete one token swap

SyncSwap lets you swap tokens on zkSync Era when your wallet holds ETH there for gas: connect the wallet, choose a pair, check the minimum received, approve the input token if needed, and confirm.

  • Result: The output token appears in your wallet, and the swap appears on the zkSync Era explorer.
  • Before you start: Have MetaMask set to zkSync Era and some ETH on that network for gas.

Prepare MetaMask for a SyncSwap trade

A SyncSwap trade starts with MetaMask on zkSync Era and ETH available on that network. Add zkSync Era through MetaMask’s network selector if it is missing, and verify that you have selected mainnet, which uses chain ID 324. ETH held on Ethereum mainnet is a separate balance; the wallet needs ETH on zkSync Era to pay for this transaction.

Open the official SyncSwap app from a verified bookmark or address, paying attention to the destination rather than the name shown in a search ad. The SyncSwap site is where you connect your wallet and make the token swap.

Complete one swap on zkSync Era

One swap consists of choosing the trade, accepting its terms, and confirming it in MetaMask. The exchange draws on its Classic Pool or Stable Pool liquidity according to the trade. An ERC-20 approval, when required, is a separate transaction before the swap.

  1. Connect the funded wallet. Open the app, connect MetaMask, and select zkSync Era. Confirm that the account you connected is the one holding your input token and ETH for gas. A wallet connected to another network cannot spend the balance you see on zkSync Era.
  2. Choose the tokens and amount. Select the token you will spend and the token you want to receive, then enter the input amount. Read the quoted rate and price impact before proceeding. A larger trade relative to available pool liquidity can move the execution price further from the rate you expected.
  3. Set slippage and read the minimum received. Slippage is the amount of price movement you permit between the quote and execution. The minimum received is the lowest output you agree to accept under that setting. A wider allowance can let a changing quote complete, but it also permits a worse result. If the minimum is too low for your purposes, reduce the trade size or wait for a better quote.
  4. Approve an ERC-20 input if prompted. Approval gives the swap contract permission to spend the input token up to an allowance. Confirm that approval in MetaMask and wait for it to complete before submitting the swap. It costs gas because it is its own transaction. You generally need another approval only when the existing allowance is insufficient; spending ETH as the input does not require ERC-20 approval.
  5. Confirm the swap. Review the amount, minimum received, and wallet gas estimate, then confirm in MetaMask. zkSync Era charges gas in ETH by default. Its wallet estimate can reserve for more gas than execution uses: unused gas is refunded, so the final fee is often lower than the amount shown before confirmation. Keep enough ETH for the estimate when submitting, then use the completed transaction on the explorer to see what was actually charged. If you approved a token, account for that earlier transaction’s fee separately.
  6. Verify the result. Wait for the swap transaction to succeed on the zkSync Era explorer. Then view the output token balance in MetaMask on zkSync Era. The successful transaction and the new balance together confirm that the swap completed.

Related questions

These two checks help interpret the swap result and its quoted price.

Why doesn't my swapped token show in MetaMask?

A missing token display can mean MetaMask has not added that token to its list. First select zkSync Era and check the transaction on its explorer. If the swap succeeded and the explorer shows the token in your account, import it into MetaMask using its verified contract address on zkSync Era.

What does price impact mean on SyncSwap?

Price impact describes how the size of your trade affects its quoted rate against available pool liquidity. If it is high, try a smaller amount and compare the new quote and minimum received before confirming.

Start with a funded zkSync Era wallet, and submit the swap only when its minimum received is acceptable to you.

Top comments (0)