When does a swap get refunded?
When no driver takes the order before its deadline. The order can no longer be filled after that point, and it is refunded as described below.What does the user get back?
On Swift, the input may be converted into the primary locked asset on the source chain before the order opens, typically USDC, USDT or ETH. If that order is later refunded, the user receives the converted asset rather than the token they started with. On MCTP and Fast MCTP, the input is swapped to USDC on the source chain and bridged through Circle’s CCTP before the order is filled. A refund pays that USDC, minus the refund fee, to the recipient’s address on the destination chain, together with any gas drop. Nothing goes back to the source chain or to the sender’s wallet. Surface this in your interface. A user who sent one token and got a different one back will otherwise open a support ticket.Where is the deadline?
Each quote carries adeadline64 value. That is the timestamp after which the order becomes refundable rather than fillable.
Does a refund cost anything?
Yes. A refund is an onchain action and carries its own relayer fee, which is returned in the quote before the user signs:refundRelayerFeeandrefundRelayerFee64: the fee itself.clientRelayerFeeRefund: the total dollar value of relayer fees in the refund scenario.
How do I know a swap was refunded?
Poll the Explorer API with the source transaction hash and readclientStatus. A refunded order reports REFUNDED rather than COMPLETED.
See track transactions for handling terminal states in your interface.
Can a swap fill below the quoted minimum?
No. TheminAmountOut the user signs is part of the instruction. An order that cannot be filled at or above it is not filled at all, and is refunded instead.