Read the fee split
split reads the split from the contracts on each call. It returns five legs in the order the market applies them: INFRASTRUCTURE, OPERATOR, DISTRIBUTOR, INSURANCE_FUND and LIQUIDITY_PROVIDERS.
rateBps is a leg’s rate against its own base, which is what the contracts store. effectiveBps is what the leg takes out of repaid interest once the legs before it came off, and the five always sum to 10000. Only the insurance-fund leg can move: it is the market’s protocolFeeRate, zero by default, which the issuer sets through market configuration.
operatorWallet names the wallet the operator share is paid to. transactionFees carries the fixed open and repay fees stamped on the market at deployment, which are separate from the interest split. The API caches the split for up to 60 seconds, so a change made on chain can take that long to appear.
Read what each leg accrued
cashflows returns, for every leg, what accrued over the market’s life, what was swept out and what is still pending on the market. Every amount is { raw, value }: raw in the smallest unit, value as a decimal string.
history.complete is false, reconciliation is null, and history.note says why. On a complete history, reconciliation checks each leg to the smallest unit.
Sweep a fee leg
Four sweeps pay out the legs that leave the market. Each pays a destination the market fixes, so the signer can neither withhold the payment nor redirect it.
Any wallet works, self-custody or regulated custodian, no preference. The API refuses before anything is signed whenever the contract would revert, for example when nothing is booked.
amount from the result. The result also carries txHash, signedBy and the transactions the SDK sent. See the signing model for the prepare and { txHash } shapes.
Deposit the protocol fee into the insurance fund
NO_PROTOCOL_FEES.
Pay a distributor slice
The market credits the distributor share to liquidity providers in proportion to the liquidity each supplied.sweepDistributorFees pays the slice of one direct provider, a provider that funds the pool itself rather than through a registered vault. Omit provider and the sweep is built for the operator wallet.
VAULT_COLLECTS_ITSELF: it collects its own slice through vault distributor fees. When the provider is a contract, such as a multisig, the market accepts the sweep only from that contract itself. On the current market implementation the slice goes to the provider. On the earlier fee implementation it goes to the operator wallet, and recipient names which.
Rotate the operator wallet
The operator wallet collects the operator share and is the one wallet, besides registered vaults, that may deposit liquidity directly. Both rights move together. Only the current operator wallet signs, which is the wallet that took the lender-of-record role unless it rotated since.signerAddress from the signer, so the API refuses another wallet with NOT_OPERATOR_WALLET before anything is built. The SDK checks the prepared requiredSigner against the signer again before it signs.
The API refuses a new wallet that is not verified on this instance with
WALLET_NOT_VERIFIED, and the current wallet with WALLET_UNCHANGED. A market without a lender of record answers MARKET_NOT_ADOPTED, and an implementation without rotation answers MARKET_UPGRADE_REQUIRED. See Lending errors.
