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 chosen for this market’s generation, written to be shown to liquidity providers as they are. generation.settlementDrawsReserve decides when the market draws on the reserve.
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. A fund on the earlier implementation cannot book a top-up and is refused with FUND_UPGRADE_REQUIRED until the fund owner upgrades it.
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.
The route has no confirm leg, and the API records nothing. With a signer the result is { transactions } only, and { txHash } is refused. Once the withdrawal mines, stats.totalWithdrawn and stats.currentBalance reflect it. Without options the method returns the unsigned transaction under calldata, with fundOwner, fundAddress and currentBalance beside it.
