Please note, this article is for MetaMask swaps performed with the Swap button within our app or extension (as shown below). For all other swap inquiries, please contact the third-party swap system you used, as they will have a better understanding of their system's intricacies, nuances, and issues. For general information regarding transactions, see here.
MetaMask Swaps can fail for multiple reasons but the primary one is due to slippage. When you perform a swap, you are agreeing to a price quote. If the price of the swap goes outside of the allowed slippage set (typically 2-3%), it will fail, in order to prevent you from seeing a huge variance in value when completed.
If your swap fails, you can retry the swap, but this time click "custom", and then input a higher slippage percentage. Please be aware that this means the swap will still complete even if the price of the token changes more drastically during the pending/confirmation time.
If the swap fails and persists, you can contact our support team so we can investigate the underlying DEXs and assets to ensure it is due to slippage each time.
When a swap fails, some gas (ETH) will still be spent. This ETH goes to the network miners/validators and not to MetaMask. This is unavoidable and part of the nature of blockchain.