ConstReadonlyadjustPreview: (MK-042. Carries all four legs, because a preview for "add 1 BTC" and one for "add 1 BTC and borrow 500" are different questions with different answers.
MK-085. The legs arrive as the same object the fetch sends, not as four positional
values assembled a second time, so the key cannot describe a different call from the one
that was made. An ABSENT leg is null here and a leg of 0n is "0", because on chain
those are different inputs: _adjustTrove takes _isDebtIncrease independently of
_mUSDChange (BorrowerOperations.sol:757-758) and refuses (0, true) at :785-787.
Encoding both as 0 made "no debt leg" and "a debt increase of zero" share a cache entry.
Readonlybalance: (Query key for an MUSD balance read.
ReadonlyborrowingCapacity: (Key for useBorrowingCapacity: one entry per owner (MK-002).
ReadonlyborrowingPower: (Query key for the borrowing power ceiling (collateral stringified, keys are JSON-hashed).
ReadonlyborrowPreview: (Key for useBorrowPreview: one entry per owner and draw (MK-002).
MK-085. amount is optional and an ABSENT amount is null, not "0". The hook disables
itself without one, and a disabled TanStack query still reads whatever sits at its key, so
encoding "not asked yet" as 0 let an empty input box render the verdict computed for a
draw of zero. Every amount-carrying key below follows the same rule.
ReadonlyclosePreview: (MK-042. Whether closing is permitted, and the MUSD the caller must hold to do it.
ReadonlydrawForMargin: (Query key for a margin draw (MK-240): the ceiling's key parts, and the caller's margin. A different
margin is a different answer, so both inputs are in the key; an absent one is null, which the
hook never fetches, and never a default written out.
ReadonlymaxWithdrawable: (MK-042. The largest withdrawal the contract would accept now, and which gate caps it.
ReadonlyoraclePrice: (chainId: number) => readonly ["musd", number, "oraclePrice"]Query key for the oracle BTC/USD price.
ReadonlyredeemPreview: (MK-048. What a single redeemCollateral call will actually redeem, per redeemer and amount.
ReadonlyrefinancePreview: (Key for useRefinancePreview: one entry per owner (MK-003).
Readonlytrove: (Query key for a Trove read (shared by useTrove/useHealthFactor/useLiquidationPrice).
ReadonlywithdrawCollateralPreview: (MK-042. A pure collateral withdrawal of amount, keyed per owner and per amount.
Stable TanStack query keys (chainId + method + args). Hooks that share a key dedupe to a single fetch (e.g.
useTrove/useHealthFactor/useLiquidationPricefor one address differ only byselect). bigints are stringified, TanStack hashes keys withJSON.stringify, which throws on bigint.