SV3 logo

floorValueDown

USDC value of an AVM amount at the floor, rounded down.

wadToRaw(avm × floorPrice / WAD), both steps floored. Used for redeem payouts and borrow capacity so the quoted USDC still fits on-chain.

The matching ceil path is used for liabilities (floorValueUp, not exported as a branded helper — see floorLiability).

Import

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

Usage

const gross = floorValueDown(parseAvm("1000"), snapshot.floorPriceWad);

Return Value

bigint (USDC raw, 6 decimals).

Parameters

avmAtoms

  • Type: bigint (AvmAtoms)

Token amount, 18 decimals.

floorValueDown(position.collateralAvm, snapshot.floorPriceWad);

floorPriceWad

  • Type: bigint (Wad)
floorValueDown(amount, snapshot.floorPriceWad);

Error

InvalidAmountError if either input is negative.