Par 1:1 FX
Quote engine & swap lifecycle
A Par swap is a quote, a swap, a deposit, a screen, and a settlement — in that order, with every transition checked against an explicit table. This page is the state machine as implemented, including the states where a swap stops and what an operator can do about it.
The quote engine
A quote fixes the rate, the corridor and the amount for 15 minutes. It is the unit of price certainty: after it expires, a new quote is required, and the rate a customer gets is whatever the next quote says.
| Parameter | Type | Description |
|---|---|---|
| quoteIdrequired | uuid | Server-minted identifier of the locked quote. Required to open a swap. |
| sellTokenrequired | USDT | USDC | Asset the customer sends. |
| buyTokenrequired | USDT | USDC | Asset the customer receives. Must differ from sellToken. |
| sellNetworkrequired | network id | Source chain. Must be a network the sell token settles on. |
| buyNetworkrequired | network id | Destination chain. Must be a network the buy token settles on. |
| sellAmountrequired | decimal string | Amount to sell. At most 6 decimals, greater than zero, at most 50,000,000. |
| operatorRefoptional | string ≤64 | Your own reference. Echoed onto the swap and the invoice. |
The quote is single-use
idempotencyKey and the rail returns the swap that already exists rather than opening a second one.An indicative rate is what the market is doing right now — the Par console shows it beside the locked rate so you can see what the par guarantee is worth. An executablequote is the 1.000000 contract above. Only the second one binds Furlpay.
curl -X POST https://furlpay.com/api/par/quotes \
-H "authorization: Bearer sk_test_..." \
-H "content-type: application/json" \
-d '{
"sellToken": "USDT",
"buyToken": "USDC",
"sellNetwork": "tron",
"buyNetwork": "base",
"sellAmount": "100000"
}'The swap state machine
Eight states, and a table of legal transitions between them. An illegal transition is a409, not a silent move of money.
| Parameter | Type | Description |
|---|---|---|
| lockedoptional | state | Quote consumed, swap open, deposit address assigned. Awaiting the sell leg. |
| deposit_detectedoptional | state | The sell leg was seen on chain (mempool or first confirmation). Not yet final. |
| deposit_confirmedoptional | state | The network's own confirmation depth is reached. Depth is per-chain, not global. |
| aml_screeningoptional | state | Both legs are being screened. A 'review' verdict parks the swap here and opens a compliance case. |
| settlingoptional | state | Approved and past screening. Vault legs are being moved and the ledger is being posted. |
| completedoptional | state | Terminal. The payout reference is recorded and the invoice line is billed. |
| failedoptional | state | Terminal. Carries a failure reason. A sanctions block ends here. |
| expiredoptional | state | Terminal. The deposit arrived after the rate lock closed. No settlement, no fee. |
A review verdict parks the swap; it does not fail it
Screening returns three verdicts. allow continues to settlement. block fails the swap permanently — nothing is settled, and an operator cannot approve it away.
review is neither. The swap stays in aml_screening, a compliance case is opened against it, and the operator resolves that case. Approving the case resumes settlement from where the swap stopped. Failing the swap on a review verdict instead would leave an approved case with a dead swap and no path to payout.
Deposit detection and confirmation
There are two ways a deposit is reported, and they are not interchangeable.
- Inbound notification — a chain watcher or your own operator posts to
POST /api/webhooks/par-depositwith an HMAC signature over the raw body. The route verifies the signature, rejects a stale timestamp, and refuses a deposit hash that another swap already claimed. - On-chain verification — in a live or production deployment the rail reads the transaction over the network's RPC and checks it itself: the receipt succeeded, the token contract matches, the recipient matches, the amount is at least the quoted amount, and the confirmation depth is deep enough. A signed report is not enough on its own.
Confirmation depth is a property of the chain
Settlement
Settlement is where the money actually moves, and it moves in the ledger first. The rail debits the payout vault, credits the collection vault, and posts a balanced double-entry pair — and only then records the payout reference. If the ledger posting fails, the swap does not report as completed.
The payout is executed by the deployment's payout executor, and the deployment does not get to choose per call: in production the only executor is the KMS-backed on-chain one. It builds an ERC-20 transfer from the custody vault, has the configured key-management backend sign it under a deny-by-default transaction policy, broadcasts it over the chain's RPC, and waits for the network's confirmation depth.
- The deterministic simulator cannot run in production. It refuses there rather than returning a hash. A swap that cannot be paid is held at
settlingwith the refusal recorded — not failed, and not reported as completed. - The key can sign one transaction class. The signing guard refuses anything that is not this transfer, of this token, to this address, on this chain. A key provisioned for settlement cannot be used for anything else.
- A swap is paid once. The payout slot is claimed atomically before the broadcast, so two concurrent settlements cannot both send. A retry after a crash polls the existing transaction instead of sending a second one.
- The rail is checked at the broadcast boundary. A pause that lands between the request and the signature stops the payout — and an unreadable control store is treated as paused, because settlement never proceeds on an assumption.
A simulated payout is not a transaction
0xsim-prefixed reference, which is deliberately not a valid transaction hash. No explorer, reconciliation job or downstream system can read it as an on-chain transfer.