---
title: quoteSellExactAvmIn
description: Quote net USDC out for selling an exact AVM amount on the curve.
---

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

Burns `amount` AVM along the curve and returns gross USDC, the 1.25% sell fee, and net proceeds. This is the **cheaper** sell selector.

Compare with [quoteRedeemAtFloor](/developers/math/quote-redeem-at-floor) when spot is close to floor. `sv3.quote.quoteExitOptions` runs both and tells you which pays more.

## Import

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

## Usage

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

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

quote.avmIn;
quote.grossReserveOutRaw;
quote.netReserveOutRaw;
quote.fees.totalRaw;
quote.priceImpact.totalPriceImpactWad;
quote.nextSpotPriceWad;
```

A curve sell **does** move spot down. Floor redemption does not.

## Return Value

`SellExactInQuote`

| Field                | Meaning                                   |
| -------------------- | ----------------------------------------- |
| `kind`               | `'sellExactAvmIn'`                        |
| `avmIn`              | Tokens burned                             |
| `grossReserveOutRaw` | Curve payout before fee                   |
| `netReserveOutRaw`   | Wallet proceeds after 1.25%               |
| `nextEngine`         | Coefficients after a possible contraction |
| `priceImpact`        | Uniswap-style, worse-is-positive          |

## Parameters

### snapshot

- **Type:** `MarketSnapshot`

```ts
quoteSellExactAvmIn(snapshot, parseAvm("1000"));
```

### amount

- **Type:** `AvmAtoms`

AVM to sell. Must be `> 0` and ≤ `curveSupply`. Gross payout must be ≥ `100` raw.

```ts
quoteSellExactAvmIn(snapshot, asAvmAtoms(10n ** 18n));
```

## Error

| Error                                | When                                |
| ------------------------------------ | ----------------------------------- |
| `ProtocolRevertError` `ZeroAmount`   | Amount is 0 or exceeds curve supply |
| `ProtocolRevertError` `BelowMinimum` | Curve payout `< 100` raw            |

## Tips

- Prefer this selector unless the user typed a USDC target. Exact-output sells are the expensive path — see [quoteSellExactReserveOut](/developers/math/quote-sell-exact-reserve-out).
