Skip to main content
Every order carries a deadline. If no driver fills it before that deadline passes, the order is refunded and the input returns to the sender. Mayan does not take custody of funds at any point, in either case.

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 the input goes back to the sender.

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 or ETH. If that order is later refunded, the user receives the converted asset rather than the token they started with. 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 a deadline64 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:
  • refundRelayerFee and refundRelayerFee64: the fee itself
  • clientRelayerFeeRefund: the total dollar value of relayer fees in the refund scenario
Both are available at quote time, so you can show a user what a refund would cost before they commit.

How do I know a swap was refunded?

Poll the Explorer API with the source transaction hash and read clientStatus. 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. The minAmountOut 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.