If a cross-chain swap doesn’t complete, the user gets their full deposit back, in the same token, at the address they sent from (sender). Tern sends the refund and pays its gas. Only the gas the user spent on the deposit itself isn’t returned. Same-chain and private swaps never need a refund. If they can’t meet the minimum, the transaction reverts and nothing moves.

When a cross-chain swap refunds

When a swap is refunded, its status includes source.refundTxHash: the transaction that returned the deposit.

Deposit addresses

A deposit address accepts any transfer, so it can receive the wrong amount, the wrong token, or a late payment. None of it can be lost: funds at a deposit address can only go into the swap or back to the user. Tern watches each deposit address for several hours after its deadline. After that, anyone can return late funds to the user by calling sweep on the contract. See Deposit addresses in the specification.

Refunds don’t depend on Tern

Anyone can trigger a refund once a lock expires, and it can only ever pay back the original sender. Tern does this automatically, but if Tern stopped, anyone else could do it with the same result.
Refunds go to sender. Make sure it’s an address the user controls, never an exchange deposit address: exchanges may not credit a refund they weren’t expecting.