---
title: lockedCollateral
description: AVM that must stay pledged to cover a position's debt at the current floor.
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

Ceil-rounded AVM whose floor value covers `position.debtRaw`. Same formula as [collateralForDebtUp](/developers/math/collateral-for-debt-up). Zero debt locks zero tokens.

## Import

```ts
import { lockedCollateral } from "@repo/contract-client/math";
```

## Usage

```ts
const locked = lockedCollateral(position, snapshot.floorPriceWad);
```

A floor raise **reduces** locked collateral for the same debt, which is why raises increase borrow capacity.

## Return Value

`AvmAtoms`

## Parameters

### position

- **Type:** `PersonalPosition`

Uses `position.debtRaw`.

```ts
lockedCollateral(position, snapshot.floorPriceWad);
```

### floorPrice

- **Type:** `Wad`

Must be `> 0` if debt is nonzero.

## Error

`InvalidAmountError` if `floorPrice <= 0` and debt is being converted.

## Tips

- Surrender burns exactly this amount (for the cancelled debt slice), not the whole position.
