Find something... ⌘K

Swaps / Recovery

When it fails

Where the money is when an order goes wrong, and who acts next. Every exit but a proven BTC payment sends a buyer's coins back, and no Maxy server can change that.

Refunds

Use this when a buy reads refundable. The refund is a contract call, sent from the user's wallet. GET /orders/{id}/refund builds it and simulates it, with no key. To try it, quote with scenario=refund_available; the sandbox transaction is never sent.

Escrow open on the settler
Escrow deadline EXPIRED 0:00 remaining
Escrow back swap.refund picks the call
curlTypeScriptPython
Copy
curl -s "$BASE/orders/$ORDER_ID/refund?chainId=8453"
What happenedWhere the money isWho acts, when
Rejected a signaturethe walletnobody
Gasless, escrow never openedthe walletnobody: the signature lapses after 2 hours
Escrow open, no solverthe settlerthe user any time; anyone after 2 hours
Solver committed, did not paythe settler, plus the bondanyone, after 144 Bitcoin blocks, about a day
Refund sentthe wallet, with the bond if there was onenobody

The bond goes half to whoever sends the refund, half to the user, so a user who sends it gets it all. Pausing the settler never blocks a refund. While no solver has committed, the user can also cancel: POST /orders/{id}/cancel?chainId=8453 answers the call to send.

If the answer is refundable: false, it is before the deadline or there is nothing to refund: read reason, and wait for unlocksAt. The SDK says the same with not_refundable. tx_reverted means it was already refunded or settled.

Failed sells

A sell goes wrong when the payment is the wrong amount or too late. The contract proves only an output of exactly the amount in sats, inside the window.

What happenedstateResultDo
Exact, in timein_progress, completedPayout releasedNothing
Exact, one block after the deadlinein_progressStill the user'sGET /orders/{id}/claim
Different amountawaiting_deposit, expiredThe contract cannot payContact Maxy with the txid
Later than thatexpiredEscrow returns to the solverContact Maxy with the txid
Never paidexpiredNothing was sentNew order

The solver sends the proof itself. If a paid order sits unproven, GET /orders/{id}/claim answers the proof as a transaction any wallet may send. The payout still goes only to the user. Prevent support cases: show the exact amount, ask for one payment, and show the time left from expiresAt.

Support script

For any order a user asks about.

  1. 01 Look up the order: GET /status?txHash=, with any transaction of the order.
  2. 02 completed: send the btcTxId link.
  3. 03 pending or in_progress under an hour: it is in flight.
  4. 04 refundable: the user takes the coins back, as above.
  5. 05 Anything else: send Maxy the order id, the hashes and the time.