How to make your first Uniswap swap safely: wallet steps
How to make your first token swap on Uniswap safely: route MetaMask through Flashbots Protect, set tight slippage, and verify minimum received on Etherscan.
The ChainBrief Editors
To make your first Uniswap swap on Ethereum safely, route MetaMask through Flashbots Protect, verify the token’s contract address, set tight slippage, and read the minimum received amount before signing. Bots can sandwich swaps they see in the public mempool, trading around your order to profit within your slippage tolerance.
Your wallet’s network setting determines which RPC sends the signed swap, so select the private RPC before connecting to Uniswap.
How do you route the swap through a private RPC?
Use the Ethereum mainnet RPC in MetaMask before opening Uniswap. Uniswap prepares the swap, but the wallet sends the signed transaction through the RPC selected in its network settings. A Uniswap page or swap screen does not change that setting.
Flashbots Protect is added to MetaMask as a custom network using https://rpc.flashbots.net and chain ID 1. A sandwich attack involves bots trading around a pending swap; sandwich attack protection is relevant because private routing changes how that pending transaction reaches the network. Flashbots Protect is the RPC to select for this walkthrough, though routing privately does not guarantee a profitable trade or a particular execution price.
How do you review and confirm the swap?
Follow these steps with a browser wallet funded with ETH for gas:
- Add a custom network in MetaMask with the Flashbots Protect RPC URL, https://rpc.flashbots.net, and chain ID 1. Save it, select it, and only then open Uniswap and connect your wallet.
- Choose the token you want to receive by pasting its contract address from the project’s official site. Token names and symbols can be copied, so match the address before proceeding.
- Enter the amount of ETH or the token you will swap. For a liquid pair, set slippage low. Slippage is the price movement you allow between submitting and executing the swap; bots can use that tolerance when sandwiching a visible transaction.
- Read Uniswap’s quoted output and minimum received amount before signing. Minimum received is the least output allowed under your selected slippage tolerance. If that amount is below what you are willing to accept, reduce the trade or adjust the settings and review the quote again.
- If Uniswap asks for token approval, review and approve the token first. Approval authorizes the Uniswap contract to use the specified token; it is a separate transaction from the swap and may require its own gas fee. Then return to the swap, review the minimum received again, and sign.
- Open the confirmed transaction on Etherscan. The task is complete when Etherscan shows success and the received amount is at or above the minimum received shown before signing.
Say you have ETH and want to swap a small amount for a project token. You select the saved Protect network, paste the project’s contract address, set tight slippage, and see a minimum received you accept. After any requested approval, you sign the swap and check its Etherscan result against that minimum.
Related
What is a sandwich attack on a swap?
A bot places trades around a pending swap it can see, aiming to profit from the price movement while keeping the user’s execution within their slippage tolerance. Tight slippage limits the permitted movement; private routing reduces exposure to the public mempool.
Why does Uniswap ask me to approve a token first?
Uniswap needs token approval before its contract can spend the token you are swapping. Approval and the swap are separate wallet transactions, so confirm each one deliberately and keep ETH available for gas.
Before signing, make sure MetaMask still shows the Protect network and Uniswap’s minimum received is acceptable.