Skip to main content
POST
Builds the fund owner’s withdrawal from the market’s insurance fund, and confirms it once mined. A withdrawal is announced with propose, may be withdrawn with cancel, and executes with execute no earlier than 7 days after the announcement and no later than 14, for exactly the announced amount and destination. Only the fund owner can sign any of the three: the admin the lender of record named when it took the role.
Every unit withdrawn is a unit the reserve can no longer pay toward this market’s losses. Whatever the reserve cannot cover lands on the liquidity providers. The notice exists so that every provider can see the first-loss buffer leaving a week before it does. Get Insurance Status shows the balance, what is announced, when the reserve is drawn on this market, and the losses it has absorbed so far.
Coverage keeps running during the notice. A draw that empties the fund in the meantime leaves the announced amount unpayable, and emergencyWithdraw then reverts InsufficientBalance, rather than leaving the market uncovered. An announcement not executed within 7 days of becoming ready lapses, and a fresh one is needed. A later propose replaces a pending one and restarts the week. The API checks the amount against the fund’s balance when it builds propose and execute, but it does not check who will sign. A transaction from any wallet other than fundOwner reverts. Before a lender of record takes the market, the market itself or the deploying factory owns the fund. Neither can announce or sign a withdrawal, so no wallet can withdraw until adoption.

Path Parameters

string
required
The market’s record ID, as id on List Markets, not its contract address. See Market IDs.

Body Parameters

string
default:"execute"
propose, cancel or execute. Required on the confirm call too, where it selects the function and event the receipt must carry.
string
Amount to withdraw as a positive decimal string, in the market’s borrow asset. It may carry at most as many decimal places as the borrow asset supports, and must not exceed the fund’s balance. Required on propose and execute, and on execute it must repeat the announced amount exactly. Not needed on cancel or when confirming.
string
The wallet that receives the withdrawal, as a 0x-prefixed 20-byte address other than the zero address. Required on propose and execute, and on execute it must repeat the announced destination. Not needed on cancel or when confirming.
string
Hash of the mined transaction. Send it with the same action to confirm. Omit it to receive the calldata.

Calldata Response

object

Confirmed Response

The confirm call verifies that the transaction targeted the fund, called the function action names, and emitted EmergencyWithdrawProposed, EmergencyWithdrawProposalCancelled or EmergencyWithdraw on it. It records nothing. Once an execution mines, stats.totalWithdrawn and stats.currentBalance on Get Insurance Status reflect it.
object

Error Codes

Confirming with txHash can also return any transaction verification error.