Skip to main content
POST
Builds the sweepProtocolFees transaction, which deposits everything the market has booked for its insurance fund into that fund. The protocol fee is the insurance-fund rate’s share of repaid interest and of interest recovered through liquidation. The on-chain name protocolFeeRate is kept from v1. Any wallet may sign. The market deposits into its own insurance fund, never to the signer, and the fund books the deposit with the market recorded as its source. From then on the money is the reserve that absorbs this market’s shortfalls. See Get Insurance Status. At the default insurance-fund rate of zero, nothing accrues and there is nothing to sweep. The issuer sets the rate through Update Market Config.
The fund accepts a deposit only from a market it authorizes. If the fund’s owner has withdrawn this market’s authorization, the sweep reverts on chain, and this endpoint does not check for it first. Read marketAuthorized on Get Insurance Status before signing.

Path Parameters

string
required
Market ID.

Body Parameters

string
Hash of the sweep you broadcast. Send it to confirm the transaction and record the result. Omit it to receive the calldata.

Response Fields

object
The sweep deposits whatever is booked when it mines, which can exceed the amount quoted when the calldata was built. A confirmed sweep is recorded on the market as a PROTOCOL_FEES_SWEPT transaction, visible through List Transactions. Record Insurance Top-Up refuses it, because a sweep is not a top-up.

Error Codes

Confirming with txHash can also return any transaction verification error.