---
title: sampleCurve
description: Price and certified area at many curve supplies from one snapshot.
---

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

Maps each supply to `{ priceWad, areaUpRaw, areaDownRaw }`. Use this for a chart; do not call `priceAtSupply` in a loop from UI without need — this keeps rounding consistent with backing.

## Import

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

## Usage

```ts
import { asAvmAtoms } from "@repo/contract-client/types";
import { sampleCurve } from "@repo/contract-client/math";

const points = sampleCurve(snapshot, [
  asAvmAtoms(0n),
  snapshot.curveSupply,
  asAvmAtoms(snapshot.curveSupply * 2n),
]);

points[1].priceWad;
points[1].areaUpRaw;
points[1].areaDownRaw;
```

## Return Value

`readonly { supply, priceWad, areaUpRaw, areaDownRaw }[]`

`area*Raw` are 6-decimal USDC, already passed through [wadToRaw](/developers/math/wad-to-raw) with matching ceil/floor.

## Parameters

### snapshot

- **Type:** `MarketSnapshot`

Provides the engine and revision check.

```ts
sampleCurve(snapshot, supplies);
```

### supplies

- **Type:** `readonly AvmAtoms[]`

Any order; results are 1:1 with the input.

## Error

`UnsupportedCurveRevisionError`. Nested `InvalidAmountError` for a bad supply.
