Read the fund
stats.currentBalance is what the fund can pay today. marketAuthorized says whether the fund covers this market at all: an unauthorized market gets no coverage, and its protocol-fee sweep reverts. It also reads false when the read failed, so a false is not proof of a withdrawn authorization.
Read marketBadDebt beside the fund, because a fund that covered nothing and a market that never took a loss otherwise look the same. borneByProviders is the loss the liquidity providers carried. earmarkedProtocolFees is protocol fee the market booked for the fund and has not swept yet, so an empty fund can still have money waiting. The fees page sweeps it.
disclosure holds plain-language statements written to be shown to liquidity providers as they are. The market draws on the reserve on every first settlement that retains less than the record’s claim. It also draws on it on the write-off after the 7-day window, and for the residual of an instant whole-position realization. generation.settlementDrawsReserve reads true, or null when it could not be read.
A fund whose owner withdrew this market’s authorization pays nothing and blocks nothing, so the whole loss lands on the pool.
Top up the fund
Any wallet may top up, whether the operator funding its own reserve or a third party standing behind the pool. The plan approves the fund to pull the settlement token (stablecoin), then calls the fund’stopUp. The SDK fills fromAddress from the signer, signs both steps in order, and records the top-up with the topUp step’s hash.
amount is a decimal string in the borrow asset. The API checks that the wallet holds enough before offering anything, and refuses a short balance with INSUFFICIENT_BALANCE.
To sign in your own environment, prepare with fromAddress, which the SDK requires when there is no signer. Both steps must come from that wallet, because the fund pulls from the sender of topUp and records it as the source. Confirm with the topUp step’s hash and the same amount and fromAddress.
duplicate: true means the hash was already recorded for the same amount, so the call is safe to repeat. A booked top-up nobody records is still picked up when the fund status is read, if it falls within the last 50,000 blocks.
Withdraw from the fund
Only the fund owner signs: the admin the lender of record named when it took the role. Before a lender of record takes the market, the market itself or the deploying factory owns the fund, and no wallet can withdraw.fundOwner before it signs. When the owner could not be read, it refuses with FUND_OWNER_UNREADABLE and a status of 503, and nothing is signed.
A fund on the role-model generation, withdrawalNotice.supported on the status, pays out only after a seven-day notice. The owner announces the amount and recipient with action: 'propose', executes the same amount to the same recipient with action: 'execute' once withdrawalNotice.ready is true, within seven days, and can withdraw the announcement with action: 'cancel', which takes no amount.
action, amount, recipient and, for an announcement, activatesAt. To confirm a step you broadcast yourself, pass { txHash } with the same action. A fund without the notice withdraws at once with the default execute, has no confirm leg and records nothing: with a signer the result is { transactions } only, and once the withdrawal mines stats.totalWithdrawn and stats.currentBalance reflect it. Without options the method returns the unsigned transaction under calldata, with fundOwner, fundAddress, currentBalance and notice beside it.
