---
title: quoteSellExactReserveOut
description: Quote the AVM that must be burned to take home an exact net USDC amount.
---

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

Exact-output curve sell. Sizes `avmIn` so that **net** USDC (after the 1.25% sell fee) equals `amount`. This is the **expensive** selector: the user burns whatever AVM it takes.

The quote attaches warning `exact-out-sell-expensive`. Prefer [quoteSellExactAvmIn](/developers/math/quote-sell-exact-avm-in) unless the UI is a "I want $X out" ticket.

## Import

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

## Usage

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

const quote = quoteSellExactReserveOut(snapshot, parseUsdc("10"));

quote.netReserveOutRaw; // the $10 you asked for
quote.avmIn; // tokens burned
quote.grossReserveOutRaw;
quote.residualRaw;
quote.provenance.warnings; // includes exact-out-sell-expensive
```

## Return Value

`SellExactOutQuote`

| Field                                       | Meaning                          |
| ------------------------------------------- | -------------------------------- |
| `kind`                                      | `'sellExactReserveOut'`          |
| `netReserveOutRaw`                          | Target proceeds                  |
| `grossReserveOutRaw`                        | Curve payout before fee          |
| `avmIn`                                     | Tokens that must be burned       |
| `residualRaw`                               | Rounding dust kept in the market |
| `priceImpact` / `nextEngine` / `provenance` | Same family as other sells       |

## Parameters

### snapshot

- **Type:** `MarketSnapshot`

```ts
quoteSellExactReserveOut(snapshot, parseUsdc("10"));
```

### amount

- **Type:** `UsdcRaw`

Net USDC the wallet should receive. Must be ≥ `100` raw.

```ts
quoteSellExactReserveOut(snapshot, asUsdcRaw(10_000_000n));
```

## Error

| Error                                | When                       |
| ------------------------------------ | -------------------------- |
| `ProtocolRevertError` `BelowMinimum` | Target too small           |
| `ProtocolRevertError` `ZeroAmount`   | Curve cannot pay that much |

## Tips

- `prepareSellForNetTarget` is the prepare helper that uses this intent without forcing the expensive selector when an exact-in sell is cheaper.
