SV3 logo

freeCollateral

AVM in a position that is not locking outstanding debt.

collateral − lockedCollateral. Floors at 0. This is the AVM the holder can withdraw or sell without first repaying or surrendering.

Import

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

Usage

const free = freeCollateral(position, snapshot.floorPriceWad);

Also available as sv3.position.getFreeCollateral(market, owner) (loads chain state).

Return Value

AvmAtoms — 18-decimal token amount.

Parameters

position

  • Type: PersonalPosition
freeCollateral(position, snapshot.floorPriceWad);

floorPrice

  • Type: Wad

Current floor, usually snapshot.floorPriceWad.

freeCollateral(account.position, account.snapshot.floorPriceWad);

Error

None beyond invalid floor inputs inside collateralForDebtUp (floor must be positive when debt > 0).

Tips

  • Pause does not change this number. getMaxActions zeros withdrawable size when paused.