---
title: borrowCapacity
description: Additional USDC that can be drawn against a position 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.

`floorValueDown(collateral) − debt`, floored at `0`. This is gross debt headroom before the 3% advance fee. [quoteBorrow](/developers/math/quote-borrow) refuses amounts above this.

## Import

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

## Usage

```ts
const capacity = borrowCapacity(position, snapshot.floorPriceWad);
```

Also `sv3.position.getBorrowCapacity(market, owner)`.

## Return Value

`UsdcRaw` — 6-decimal USDC.

## Parameters

### position

- **Type:** `PersonalPosition`

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

### floorPrice

- **Type:** `Wad`

Usually `snapshot.floorPriceWad`.

## Error

None for empty positions. Floor must be positive to value collateral.

## Tips

- Capacity uses **down** rounding on floor value so a quoted borrow still fits on-chain.
- Liquid reserve can still block a borrow (`InsufficientBacking`) even when this number is large. Check [getMaxActions](/developers/math/get-max-actions).
