> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hadron.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring Your Pool

All Hadron Pools have price and risk curves which help maker encode their trading strategy into the on-chain PDA for the operator's propAMM.

A operator deploys a pool by describing a quoting function:

<Frame>
  <img src="https://mintcdn.com/hadron/gXIQJ65wvvAbSptY/images/Screenshot-2026-05-08-at-10.14.28-AM.png?fit=max&auto=format&n=gXIQJ65wvvAbSptY&q=85&s=63bfbc1a7cdcad6a41b6a1169e5ebd59" alt="Screenshot 2026 05 08 At 10 14 28 AM" width="912" height="92" data-path="images/Screenshot-2026-05-08-at-10.14.28-AM.png" />
</Frame>

The operator picks the midprice, picks how price changes with trade size, picks how price shifts with their inventory. Hadron is the engine that runs that function on chain.

## Hadron Quoting Pipeline

<Frame>
  <img src="https://mintcdn.com/hadron/gXIQJ65wvvAbSptY/images/image-3.png?fit=max&auto=format&n=gXIQJ65wvvAbSptY&q=85&s=23855d1e1c4bee874b19679d5fadd15d" alt="Image" width="884" height="347" data-path="images/image-3.png" />
</Frame>

## **updateBaseSpread**

Add a flat pool level fee to all swaps. This is added to any additional spread initialised later in the curve setup by default.

```typescript theme={null}
pool.updateBaseSpread(authority, { spreadFactorQ32: newSpreadQ32 });
```

| **Param**                | **Type** | **Description**                                                                                  |
| :----------------------- | :------- | :----------------------------------------------------------------------------------------------- |
| `params.spreadFactorQ32` | `bigint` | Spread discount factor in Q32 (e.g. `toQ32(0.9995)` = 5 bps)                                     |
| `params.sequence?`       | `bigint` | Deprecated — ignored in v2. The standalone base-spread instruction no longer carries a sequence. |

## **Creating Price Curves**

Write a price curve to a prefab slot.

* Curves comprise of three key ideas
  * `AmountIn`: Stored in atoms(lowest unit of the token based on the token decimal) of the amount inputed by the taker. Stored internally as `Bigint`
  * `PriceFactor` : Distance from the midprice in BPS

```typescript theme={null}
const ix = pool.setCurve(authority, { 
side: Side.Bid, 
defaultInterpolation: Interpolation.Linear, 
points: [ 
//Midprice is initialized as 1. AmountIn is based on the decimals for the input amount 
{ amountIn: 100_000n, priceFactor: 0.99 }, // For an input of 
{ amountIn: 500_000n, priceFactor: 0.95 }, 
], slot: 0, 
}); 
```

| **Param**                     | **Type**               | **Description**                                                      |
| :---------------------------- | :--------------------- | :------------------------------------------------------------------- |
| `authority`                   | `PublicKey`            | Pool authority                                                       |
| `params.side`                 | `Side`                 | `Bid` or `Ask`                                                       |
| `params.defaultInterpolation` | `Interpolation`        | `Step`, `Linear`, `MarginalStep`, `Hyperbolic`, `Quadratic`, `Cubic` |
| `params.points`               | `SetCurvePointInput[]` | Array of `{ amountIn, priceFactor, interpolation?, params? }`        |
| `params.slot?`                | `number`               | Target prefab slot (default: 0)                                      |
| `params.xMode?`               | `CurveXMode`           | X-axis mode                                                          |

## **switchPriceCurve**

Switch between different price curves in a single instruction. Up to 16 per curve side, set at pool initialization.

```typescript theme={null}
pool.switchPriceCurve(authority, { sequence: 1n, side: Side.Bid, slot: 1 });

//slot number set presets 
```

| **Param**         | **Type**    | **Description**                                                                                           |
| :---------------- | :---------- | :-------------------------------------------------------------------------------------------------------- |
| `authority`       | `PublicKey` | Pool authority                                                                                            |
| `params.sequence` | `bigint`    | Monotonic ordering guard. Must be ≥ the pool's current switch sequence (`pool.curveMeta.switchSequence`). |
| `params.side`     | `Side`      | `Bid` or `Ask`                                                                                            |
| `params.slot`     | `number`    | Slot to activate                                                                                          |

<Warning>
  Hadron protocol fees are added at the pool level to all pools and need to be factored into pools to remain competitive. For the latest fee rates go to [https://docs.hadron.fi/fees](https://docs.hadron.fi/fees)
</Warning>

## **setRiskCurve**

Write a risk curve using percent-of-vault x-axis.

```typescript theme={null}
pool.setRiskCurve(authority, {
  side: Side.Bid,
  defaultInterpolation: Interpolation.Linear,
  points: [
    { pctBase: 0.25, priceFactor: 0.995 },
    { pctBase: 0.75, priceFactor: 1.005 },
  ],
});
```

| **Param**                     | **Type**                   | **Description**                          |
| :---------------------------- | :------------------------- | :--------------------------------------- |
| `authority`                   | `PublicKey`                | Pool authority                           |
| `params.side`                 | `Side`                     | `Bid` or `Ask`                           |
| `params.defaultInterpolation` | `Interpolation`            | Interpolation mode                       |
| `params.points`               | `SetRiskCurvePointInput[]` | `{ pctBase: 0.0–1.0, priceFactor, ... }` |
| `params.slot?`                | `number`                   | Target prefab slot                       |
| `params.riskMode?`            | `RiskMode`                 | `Virtual` or `Integrated`                |

## **setRiskCurveAbsolute**

Write a risk curve using absolute token amounts on the x-axis.

```typescript theme={null}
pool.setRiskCurveAbsolute(authority, {
  side: Side.Ask,
  defaultInterpolation: Interpolation.Step,
  points: [
    { vaultBalance: 1_000_000_000n, priceFactor: 1.002 },
    { vaultBalance: 2_000_000_000n, priceFactor: 1.006 },
  ],
});
```

| **Param**                     | **Type**                           | **Description**                      |
| :---------------------------- | :--------------------------------- | :----------------------------------- |
| `authority`                   | `PublicKey`                        | Pool authority                       |
| `params.side`                 | `Side`                             | `Bid` or `Ask`                       |
| `params.defaultInterpolation` | `Interpolation`                    | Interpolation mode                   |
| `params.points`               | `SetRiskCurveAbsolutePointInput[]` | `{ vaultBalance, priceFactor, ... }` |
| `params.slot?`                | `number`                           | Target prefab slot                   |
| `params.riskMode?`            | `RiskMode`                         | `Virtual` or `Integrated`            |

## **switchRiskCurve**

Switch between different risk curves in a single instruction. Up to 16 per curve side, set at pool initialization.

```typescript theme={null}
pool.switchRiskCurve(authority, { sequence: 1n, side: Side.Ask, slot: 2 });

//slot number set presets 
```

| **Param**         | **Type**    | **Description**                                                                                           |
| :---------------- | :---------- | :-------------------------------------------------------------------------------------------------------- |
| `authority`       | `PublicKey` | Pool authority                                                                                            |
| `params.sequence` | `bigint`    | Monotonic ordering guard. Must be ≥ the pool's current switch sequence (`pool.curveMeta.switchSequence`). |
| `params.side`     | `Side`      | `Bid` or `Ask`                                                                                            |
| `params.slot`     | `number`    | Slot to activate                                                                                          |

<Tip>
  For a visual helper please visit [https://dashboard.hadron.fi/curves](https://dashboard.hadron.fi/curves)
</Tip>
