If your transaction fails, you still pay a network fee, sometimes called gas. It covers the computational work validators do to process, validate, and confirm transactions on the blockchain. This is not a fee that Phantom charges, and network fees are non-refundable regardless of whether a transaction succeeds or fails.
What happens when a transaction fails?
When you send tokens, interact with a smart contract, or take any other action on the blockchain, you pay for the computational work required. This fee is paid in the native token of the network where the transaction occurs. If you perform a cross-chain swap, you pay network fees on both networks.
If something goes wrong during processing, such as hitting compute limits, exceeding slippage, or calling a contract that returns an error, the transaction fails. Even so, the network still used resources to attempt to process your request, just as it would for a successful transaction, and the fee stands.
See also