The exchange of one token for another. In DeFi, swaps are atomic and non-custodial. Funds can be custodied in a smart contract with withdrawal rights exercisable at any time before the swap is completed. If the swap is not completed, all parties retain their custodied funds.