quoteNextRaise
Read on-chain floor eligibility, the deterministic maximum-safe plan, and a typed ADR-004 witness.
Reads FloorPolicyController.quoteNextFloorRaise at a pinned block. The controller, not the SDK, chooses the plan. Use this before raiseIfEligible.
quoteNextRaiseMany is the same read over many markets in one multicall. That is the keeper discovery path.
Import
import { createSv3Client } from "@repo/contract-client";
Usage
const quote = await sv3.floor.quoteNextRaise(market);
quote.eligibility.eligible;
quote.eligibility.cooldownSeconds;
quote.plan.mode;
quote.plan.newFloorPriceWad;
quote.witness.expectedPlanHash;
quote.witness.deadline;
Many markets:
const quotes = await sv3.floor.quoteNextRaiseMany(markets);
const eligible = quotes.filter((q) => q.eligibility.eligible && q.plan.mode !== "None");
Factory-wide discovery uses sv3.factory.getNextMarketSequence and sv3.factory.predictMarketAddresses.
Related reads: getQuoteState for the market snapshot. Policy bands: sv3.floor.getPolicy(market) and sv3.floor.getEligibility(market).
Return Value
Promise<MarketFloorQuote>
| Field | Meaning |
|---|---|
market | FloorMarket that was quoted |
eligibility.eligible | Controller says a raise may execute now |
eligibility.reason | Bytes32 reason when not eligible |
eligibility.eligibleAt | lastRaise + cooldown |
plan.mode | None, PreserveArea, SurplusFunded, or Combined |
plan.newFloorPriceWad | Proposed floor. Never below the current floor if the controller is correct |
witness | Freshness-bound fields the write path must echo |
priceImpact is always null. A raise is not a trade.
Parameters
market
- Type:
Address
The FloorMarket proxy.
await sv3.floor.quoteNextRaise("0x…");
markets (quoteNextRaiseMany)
- Type:
readonly Address[]
Chunked multicall. Failed individual reads are skipped.
Error
| Error | When |
|---|---|
RpcUnavailableError | deployment.contracts.floorPolicyControllerProxy is missing |
| Transport errors | RPC / multicall failure |
An ineligible market is not an error. eligibility.eligible is false and plan.mode is None.
Tips
- Do not compute a floor target from spot or a TWAP. If you need a different plan than the controller, you are not using SV3's v1 policy.
- Re-quote immediately before signing. Eligibility can go stale between discovery and send.
- Indexer hints are optional. Chain-first factory scans keep liveness if the indexer is down.