Skip to main content
A swap moves through five stages.
1

Sealed RFQ

A taker posts a request for quote: which asset, how much, which asset in return, and how long the request lives (ttlSeconds). Makers see the RFQ and answer with a price. Prices are not published on a public book.A private RFQ carries the creator’s asking price and is reachable by link only. It can be addressed to one wallet (targetAddress), in which case only an account holding that wallet can answer it.
2

Negotiation thread

A maker’s quote opens a thread between the two parties. Either side can propose a new price (propose) and the other can take it (accept-proposal). Every accept names the price the caller read, and is refused if the terms moved since.
3

Agreed swap

Both sides accept the current terms. The initiator sends hashlock = sha256(secret) with their accept; only the hash leaves their machine. When both have accepted, the swap is created with two legs, each with its chain, amount, and timelock.
4

Two HTLC legs

Each party sets its payout and refund addresses, then funds the leg it gives. The initiator funds first, on the leg with the longer timelock. The counterparty funds the other leg after that. Both escrows are locked to the same hashlock.
5

Claim reveals the secret

The initiator claims the leg they receive on by presenting the secret. That puts the secret on chain. The counterparty — or the keeper on their behalf, where the chain allows it — uses the same secret to claim the other leg. Funds can only go to each leg’s fixed recipient.
If a leg is never claimed, its funder can refund it after its timelock. The timelocks are ordered so that the counterparty always has time to claim after the secret is revealed. See HTLC and timelocks.

Swap statuses

GET /v1/swaps/{id} returns the swap’s status. The values are:
counterparty_claimed can also appear before the initiator has claimed their own leg — for example when the counterparty collected first. The initiator can still claim their leg in that state.

Where each step lives in the API