Early exit at fair value
A live (unsettled) parlay has a marked-to-market value: the probability that all remaining legs still win, times the pot. Cash-out lets the taker realize that value now instead of riding to settlement. It is the same trust model as opening the parlay: the relayer’s quoter signs an EIP-712 message, the escrow verifies it on-chain.
How a cash-out is priced
POST /cashout (wrapped by client.cashoutQuote(parlayId, taker)):
- Reads the live parlay from escrow and checks it is yours and unsettled.
- Prices every leg from live HL mids and runs the same correlation engine as opening quotes, producing the joint probability that all legs win.
- Applies a buy-back spread (default 300 bps) the vault keeps:
cashValue = pot * jointProbBps * (10000 - cashoutSpreadBps) / 10000^2
cashValue is clamped to the escrowed total, mirroring the contract guard. The response is a signed quote:
{
"parlayId": 42,
"cashValue": "31250000",
"quoterNonce": "8412...991",
"deadline": "1782950400",
"sig": "0x...",
"jointProbBps": "4180",
"pot": "78400000"
}
Cash-out quotes expire after 120 seconds (deadline is unix seconds). Show a countdown and re-quote on expiry rather than letting the user submit a dead quote.
Execution: escrow.cashOut
Unlike opening (which the relayer relays), the cash-out transaction is sent by the taker’s wallet: the taker calls ParlayEscrow.cashOut(parlayId, cashValue, quoterNonce, deadline, sig). The escrow verifies the quoter signature, pays cashValue to the taker, marks the parlay settled, and frees the rest of the escrowed funds back to the vault.
The SDK provides the exact writeContract parameters:
const q = await taker.cashoutQuote(42, address);
const hash = await walletClient.writeContract(taker.cashOutCall(42, q));
In React, useCashOut wraps the whole flow with a status machine (idle -> quoting -> quoted -> cashing -> done), analytics events, and error handling. See the cash-out guide for a complete position-row integration.
Display conventions
cashValue vs the original stake tells the user whether they are locking in a profit or salvaging a loss; both are raw 6-decimal USDC (formatUsdc).
jointProbBps is the live probability the parlay still wins; Number(q.jointProbBps) / 100 renders it as a percentage.
- After a cash-out the position’s
settled flag flips on the next positions refetch, so it drops out of open-position filters automatically.