SV3 logo

quoteRedeemAtFloor

Quote net USDC out for redeeming AVM at the current floor price.

Burns amount AVM at floorPriceWad (not along the curve). Spot does not move. Gross payout is floorValueDown; the 1.25% redeem fee is then taken.

Use this when the holder wants the floor, not the live curve. When spot is above floor, quoteSellExactAvmIn usually pays more.

Import

import { quoteRedeemAtFloor } from "@repo/contract-client/math";

Usage

import { parseAvm } from "@repo/contract-client";
import { quoteRedeemAtFloor } from "@repo/contract-client/math";

const quote = quoteRedeemAtFloor(snapshot, parseAvm("1000"));

quote.grossReserveOutRaw;
quote.netReserveOutRaw;
quote.priceImpact.curvePriceImpactWad; // 0 — no curve walk
quote.nextEngine; // unchanged

Return Value

RedeemAtFloorQuote

FieldMeaning
kind'redeemAtFloor'
avmInTokens burned
grossReserveOutRawfloor × amount, rounded down
netReserveOutRawAfter 1.25%
priceImpactCurve impact forced to 0; spot delta is 0
nextEngineSame as input

Parameters

snapshot

  • Type: MarketSnapshot

Provides floorPriceWad and actualSupply.

quoteRedeemAtFloor(snapshot, parseAvm("1000"));

amount

  • Type: AvmAtoms

Must be > 0 and ≤ actualSupply. Gross floor value must be ≥ 100 raw.

quoteRedeemAtFloor(snapshot, asAvmAtoms(10n ** 18n));

Error

ErrorWhen
ProtocolRevertError ZeroAmountAmount is 0 or exceeds supply
ProtocolRevertError BelowMinimumFloor value < 100 raw

Tips

  • sv3.quote.quoteExitOptions({ market, avmIn }) returns both the curve sell and this redeem, plus economicallyFavored.