> ## 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.

# HumidiFi

> Rebuilding HumidiFi's Curve With Hadron

**HumidiFi:** HumidiFi is the largest propAMM on Solana, with over \$50bn in 90day volume.

<img src="https://mintcdn.com/hadron/DSUsYRxaDLWeTPBz/images/image(18).png?fit=max&auto=format&n=DSUsYRxaDLWeTPBz&q=85&s=152689fa3dbc06f1582a248be16cc2f3" alt="Image (18)" title="Image (18)" width="1280" height="544" data-path="images/image(18).png" />

*Source: Bid/Ask curve plotted from running the HumidiFi binaries in liteSVM. Note that HumidiFi curves follow this general shape, widening, shrinking, and shifting every slot.*

<Info>
  For simplicity, we will linearly approximate humidifi's curve with just a few knots, although you can get even closer with more data points or hyperbolic interpolation.\
  \
  Under the hood, Humidifi is approximating log decay with very small linear segments.
</Info>

HumidiFi Bid/Ask Curve:

| **amount\_in\_sol** | **average\_price\_usdc\_per\_sol** |
| :------------------ | :--------------------------------- |
| 1                   | 101.11448                          |
| 491.12256128        | 101.109647509533                   |
| 493.12306153        | 101.10963548795                    |
| 4000                | 101.08382844375                    |

| **amount\_in\_sol** | **average\_price\_usdc\_per\_sol** |
| :------------------ | :--------------------------------- |
| 1.0                 | 101.135357068354                   |
| 491.122561279057    | 101.141372888682                   |
| 493.123061523928    | 101.141398399866                   |
| 4000.0              | 101.172231918849                   |

Creating this curve with Hadron:

```typescript theme={null}
// `pool` is a loaded Hadron instance; `authority` is the pool authority (see SDK ▸ Quickstart)
// creating a 4 point bid/ask curve with hadron with midprice of 101.125

const bidCurveIx = pool.setCurve(authority, {
  side: Side.Bid,
  defaultInterpolation: Interpolation.Linear,
  points: [
    { amountIn: 1n, priceFactor: 0.99989678, interpolation: Interpolation.Step },
    { amountIn: 491n, priceFactor: 0.99984899, interpolation: Interpolation.Linear },
    { amountIn: 493n, priceFactor: 0.99984887, interpolation: Interpolation.Linear },
    { amountIn: 4000n, priceFactor: 0.99959367, interpolation: Interpolation.Step },
  ],
});

const askCurveIx = pool.setCurve(authority, {
  side: Side.Ask,
  defaultInterpolation: Interpolation.Linear,
  points: [
    { amountIn: 1n, priceFactor: 1.00010322, interpolation: Interpolation.Step },
    { amountIn: 491n, priceFactor: 1.00016271, interpolation: Interpolation.Linear },
    { amountIn: 493n, priceFactor: 1.00016297, interpolation: Interpolation.Linear },
    { amountIn: 4000n, priceFactor: 1.00046787, interpolation: Interpolation.Step },
  ],
});
```

*Note: This is a simple linear based approximation of the curve, however the Hadron quadratic and other non linear interpolation leads to a smoother replica of the HumidiFi curve*
