SV3 logo

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>

FieldMeaning
marketFloorMarket that was quoted
eligibility.eligibleController says a raise may execute now
eligibility.reasonBytes32 reason when not eligible
eligibility.eligibleAtlastRaise + cooldown
plan.modeNone, PreserveArea, SurplusFunded, or Combined
plan.newFloorPriceWadProposed floor. Never below the current floor if the controller is correct
witnessFreshness-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

ErrorWhen
RpcUnavailableErrordeployment.contracts.floorPolicyControllerProxy is missing
Transport errorsRPC / 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.